Statistics 2: Statistical Inference: cram pack

Formula sheets, the key method steps for every topic and 10 practice problems, with full solutions at the back.

New problemsBack to the course

In the print window, choose “Save as PDF” to keep a copy on your device.

1Formulas and methods

Normal distribution

z-score
z = (x − μ)/σ
Below x
P(X < x) = Φ(z)
Above x
P(X > x) = 1 − Φ(z)
Between
Φ(z2) − Φ(z1)
Percentile
x = μ + z·σ

Method

  1. Convert the value to a z-score: z = (x − μ)/σ.
  2. Look up Φ(z), the area to the left of z.
  3. For the area to the right use 1 − Φ(z); for an interval subtract the two left areas.
  4. For a percentile, work backwards: find z for the area, then x = μ + z·σ.

Confidence intervals

σ known
x̄ ± z·σ/√n
σ unknown
x̄ ± t·s/√n, df = n − 1
Critical z
90%: 1.645, 95%: 1.96, 99%: 2.576
Sample size
n = (z·σ/E)², rounded up

Method

  1. Decide between z (population σ known) and t (only the sample s, with n − 1 degrees of freedom).
  2. Find the critical value for the confidence level.
  3. Margin of error: E = critical value × standard deviation/√n.
  4. Interval: x̄ ± E.

Hypothesis tests & confidence intervals

z-test for a mean
z = (x̄ − μ0)/(σ/√n)
t-test for a mean
t = (x̄ − μ0)/(s/√n), df = n − 1
Two-sided at 5%
reject H0 if |z| > 1.96
Confidence interval
x̄ ± z·σ/√n

Method

  1. State H₀ and H₁ and decide whether the test is one- or two-sided.
  2. Calculate the test statistic: (x̄ − μ₀)/(σ/√n), or with s and t.
  3. Compare with the critical value, or find the p-value.
  4. Reject H₀ if the statistic is beyond the critical value (p below α), and state the conclusion in words.

Linear regression & correlation

Sums of squares
Sxx = Σ(x − x̄)² = Σx² − (Σx)²/n, Sxy = Σxy − ΣxΣy/n
Slope
b = Sxy/Sxx
Intercept
a = ȳ − b·x̄
Correlation
r = Sxy/√(SxxSyy)
Residual
e = y − ŷ

Chi-square tests

Test statistic
χ² = Σ(O − E)²/E
Goodness of fit
E = n·p, df = k − 1 − (estimated parameters)
Independence
E = row total × column total / grand total, df = (r − 1)(c − 1)
Critical values (α = 0.05)
df 1: 3.841, 2: 5.991, 3: 7.815, 4: 9.488
Decision
reject H0 if χ² > χ²crit

2Practice problems

1.Normal distributionMedium
245.25251P = ?

The bag weights are normally distributed with mean 250 g and standard deviation 5 g. What fraction lies between 245.25 and 251 g? Give P as a decimal.

μ = 250σ = 5x1 = 245.25x2 = 251
P =
2.Normal distributionHard
157164171178185192199cmtop 90%

The heights of adult men are normally distributed with mean 178 cm and standard deviation 7 cm. Drag the cut-off so the shaded top 90% is to the right of it. Find the cut-off x.

μ = 178 cmσ = 7 cm90%
x = cm
3.Confidence intervalsMedium
n = 12, s = 10.5LU = ?x̄ = 43.5E95%

A sample of 12 items has mean 43.5 and standard deviation s = 10.5. The population is roughly normal. Find the upper limit of the 95% confidence interval for the mean.

n = 12x̄ = 43.5s = 10.595%t(11) = 2.201
upper limit =
4.Confidence intervalsHard
p ≈ 0.6, n = ?p̂ − Ep̂ + Ep̂E = 0.0199%

A pilot study suggests that about 0.6 of products are defective. How many products n must be inspected so that a 99% confidence interval for the proportion has a margin of error of at most 0.01?

p ≈ 0.6E = 0.0199%
n =
5.Hypothesis tests & confidence intervalsMedium
−2.1792.179t = ?df = 12

Two teaching methods are compared. Group 1: 6 students, mean score 101, standard deviation 11.5. Group 2: 8 students, mean score 92.1, standard deviation 10.5. Assume equal population variances and use the pooled two-sample t test. Find the test statistic t for H₀: μ₁ = μ₂, taking the difference as x̄₁ − x̄₂ (group 1 minus group 2).

n₁ = 6x̄₁ = 101s₁ = 11.5n₂ = 8x̄₂ = 92.1s₂ = 10.5
t =
6.Hypothesis tests & confidence intervalsHard
μ₀x̄c

A one-sided z test of H₀: μ = 200 against H₁: μ < 200 is done at α = 0.05 with a sample of 25; the standard deviation is known to be 12.5. In reality the mean is 196.25. Find the power 1 − β of the test in percent.

μ₀ = 200μ = 196.25σ = 12.5n = 25α = 0.05
1 − β = %
7.Linear regression & correlationMedium
xy125238342445554656xy246304050

The table gives 6 paired observations of x = advertising spend in k€ and y = sales in k€. Their sums are given. Find Pearson's correlation coefficient r from these sums.

n = 6Σx = 21Σy = 260Σx² = 91Σy² = 11910Σxy = 1013
r =
8.Linear regression & correlationHard
xy125221322420518617xy2462025x = 2.5

The table gives 6 paired observations of x = car age in years and y = price in k€. Use the least-squares line ŷ = a + b·x. A new observation (2.5, 24) is made. Find its residual e = y − ŷ.

n = 6(2.5, 24)
e =
9.Chi-square testsMedium
improvednot improvedTotalnew drug124860placebo3664100Total48112160

The contingency table shows observed counts. Compute the chi-square statistic χ² for the test of independence between the row and column variables. Do not use a continuity correction.

N = 1602 × 2
χ² =
10.Chi-square testsHard
passfailTotalage 18–30162440age 31–50132740age 51+2575100Total54126180dfα = 0.05α = 0.0113.8416.63525.9919.21037.81511.34549.48813.277511.07015.086612.59216.812714.06718.475815.50720.090916.91921.6661018.30723.209

The table shows observed counts. Test at α = 0.01 whether the two variables are independent (no continuity correction). Compute the test statistic χ², then compare it with the critical value from the table.

N = 1803 × 2α = 0.01
χ² =

3Solutions

1.Normal distribution

Answer: P = 0.4082

Normal distribution: convert a value x to a z-score, z = (x − μ)/σ, which counts standard deviations from the mean. A z-table (or Φ(z)) gives the area to the left of z, which is P(X < x). The area to the right is 1 − Φ(z), and the area between two values is the difference of their two areas.

z-scores

z₁ = (245.25 − 250)/5 = −0.95
z₂ = (251 − 250)/5 = 0.2

Area between

P = Φ(0.2) − Φ(−0.95) = 0.5793 − 0.1711 = 0.4082

Answer

P = 0.4082
2.Normal distribution

Answer: x = 169 cm

From an area back to z: Φ(z) is the area to the left of z. For a left-tail area A, find z with Φ(z) = A in the table. A right-tail area A means Φ(z) = 1 − A. A central area A between −z and z leaves (1 − A)/2 in each tail, so Φ(z) = (1 + A)/2. For a value x, use x = μ + zσ.

Area to the left

Φ(z) = 0.1

z from the table

z ≈ −1.28

Back to the original units

x = 178 − 1.28·7 = 169 cm

Answer

x = 169 cm
3.Confidence intervals

Answer: upper limit = 50.17

Confidence interval for a mean: x̄ ± margin of error. With a known population σ the margin is z·σ/√n; with only the sample standard deviation s, use t with n − 1 degrees of freedom: t·s/√n. Critical values: z = 1.645 (90%), 1.96 (95%), 2.576 (99%). To get a margin E or smaller, you need n ≥ (z·σ/E)², rounded up.

Critical value

df = n − 1 = 11, t = 2.201

Margin of error

E = 2.201·10.5/√12 = 6.671

Interval

43.5 ± 6.671 → [36.83, 50.17]

Answer

upper limit = 50.17
4.Confidence intervals

Answer: n = 15926

Confidence interval for a proportion: p̂ ± z·√(p̂(1 − p̂)/n), where p̂ = x/n. To reach a margin E you need n ≥ z²·p(1 − p)/E², rounded up; without a prior estimate use p = 0.5, which gives the largest n.

Solve for n

n = 2.576²·0.6·0.4/0.01² = 15926

Round up

n = 15926

Answer

n = 15926
5.Hypothesis tests & confidence intervals

Answer: t = 1.508

Hypothesis test: the test statistic = (estimate − value under H₀)/(standard error under H₀). The p-value is the probability, assuming H₀ is true, of a statistic at least as extreme as the one observed: the area in one tail for a one-sided H₁, twice the tail area for a two-sided H₁. Reject H₀ when p ≤ α.

Pooled variance

sp² = (5·11.5² + 7·10.5²)/12 = 119.4
sp = 10.93

Standard error

SE = 10.93·√(1/6 + 1/8) = 5.902

Test statistic

t = (101 − 92.1)/5.902 = 1.508

Answer

t = 1.508

With df = 12, the two-sided 5% critical value is 2.179; |t| is smaller, so H₀ is not rejected.

6.Hypothesis tests & confidence intervals

Answer: 1 − β = 44.24 %

Power of a test: power = 1 − β is the probability of rejecting H₀ when it is false. Find the cutoff x̄c from μ₀ and z_α, then compute the probability of landing beyond x̄c using the true mean: z = (x̄c − μ)/(σ/√n).

Critical sample mean

SE = 12.5/√25 = 2.5
x̄c = 200 − 1.645·2.5 = 195.9

z under the true mean

z = (195.9 − 196.25)/2.5 = −0.145

Power

power = P(Z < −0.145) = 44.24%
1 − β = 44.24%

Answer

1 − β = 44.24%
7.Linear regression & correlation

Answer: r = 0.9707

Least-squares regression: with x̄ and ȳ the means, Sxx = Σ(x − x̄)², Syy = Σ(y − ȳ)² and Sxy = Σ(x − x̄)(y − ȳ), the line ŷ = a + b·x has slope b = Sxy/Sxx and intercept a = ȳ − b·x̄, so it always passes through (x̄, ȳ). Pearson's correlation coefficient r = Sxy/√(Sxx·Syy) lies between −1 and 1; r² is the fraction of the variation in y explained by the line.

Centred sums

Sxy = 1013 − 21·260/6 = 103
Sxx = 91 − 21²/6 = 17.5
Syy = 11910 − 260²/6 = 643.3

Correlation coefficient

r = 103/√(17.5·643.3) = 0.9707

Answer

r = 0.9707
8.Linear regression & correlation

Answer: e = 2.043

Least-squares regression: with x̄ and ȳ the means, Sxx = Σ(x − x̄)², Syy = Σ(y − ȳ)² and Sxy = Σ(x − x̄)(y − ȳ), the line ŷ = a + b·x has slope b = Sxy/Sxx and intercept a = ȳ − b·x̄, so it always passes through (x̄, ȳ). Pearson's correlation coefficient r = Sxy/√(Sxx·Syy) lies between −1 and 1; r² is the fraction of the variation in y explained by the line.

Means

x̄ = 21/6 = 3.5
ȳ = 123/6 = 20.5

Sums of squares and products

Sxx = Σ(x − x̄)² = 17.5
Sxy = Σ(x − x̄)(y − ȳ) = −25.5

Regression line

b = −25.5/17.5 = −1.457
a = 20.5 − (−1.457)·3.5 = 25.6
ŷ = 25.6 − 1.457·x

Predicted value

ŷ = 25.6 + (−1.457)·2.5 = 21.96

Residual

e = 24 − 21.96 = 2.043

Answer

e = 2.043

The point lies above the line.

9.Chi-square tests

Answer: χ² = 4.571

Chi-square tests: compare observed counts O with the counts E expected under H₀ using χ² = Σ(O − E)²/E. Goodness of fit: E = n·p for each category, df = k − 1 (minus one more for each parameter estimated from the data). Independence in an r × c table: E = row total × column total / grand total, df = (r − 1)(c − 1). Reject H₀ when χ² exceeds the critical value for the chosen α.

Expected counts

new drug: 60·48/160 = 18, 60·112/160 = 42
placebo: 100·48/160 = 30, 100·112/160 = 70

Chi-square statistic

χ² = (12 − 18)²/18 + (48 − 42)²/42 + (36 − 30)²/30 + (64 − 70)²/70
χ² = 4.571

Answer

χ² = 4.571

df = 1. At α = 0.05 the critical value is 3.841, so H₀ (independence) is rejected.

10.Chi-square tests

Answer: χ² = 3.214

Chi-square tests: compare observed counts O with the counts E expected under H₀ using χ² = Σ(O − E)²/E. Goodness of fit: E = n·p for each category, df = k − 1 (minus one more for each parameter estimated from the data). Independence in an r × c table: E = row total × column total / grand total, df = (r − 1)(c − 1). Reject H₀ when χ² exceeds the critical value for the chosen α.

Expected counts

age 18–30: 12, 28
age 31–50: 12, 28
age 51+: 30, 70

Chi-square statistic

χ² = (16 − 12)²/12 + (24 − 28)²/28 + (13 − 12)²/12 + (27 − 28)²/28 + (25 − 30)²/30 + (75 − 70)²/70
χ² = 3.214

Decision

df = 2, χ²crit = 9.210
3.214 < 9.210

Answer

χ² = 3.214

χ² is below the critical value, so H₀ is not rejected: there is no significant evidence of a relationship.

ExamProblems · examproblems.com/courses/statistics-2-inference