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
The heights of adult men are normally distributed with mean 178 cm and standard deviation 7 cm. What fraction lies between 169.95 and 183.95 cm? Give P as a decimal.
μ = 178σ = 7x1 = 169.95x2 = 183.95
P =
2.Normal distributionHard
Runner A's lap time X and runner B's lap time Y are independent and normal: X has mean 52 s and standard deviation 4 s, Y has mean 48 s and standard deviation 3 s. Find the probability P that X is greater than Y. Round z to two decimals.
μX = 52 s, σX = 4 sμY = 48 s, σY = 3 s
P =
3.Confidence intervalsMedium
The blood pressure of 13 patients is measured before and after a treatment. The differences d = before − after (mmHg) have mean 4.5 and standard deviation 6.1. Find the margin of error E of the 95% confidence interval for the mean difference.
n = 13d̄ = 4.5sd = 6.195%t(12) = 2.179
E = mmHg
4.Confidence intervalsHard
The population standard deviation is 29. How large a sample n do you need so that a 95% confidence interval for the mean has a margin of error of at most 2.5?
σ = 29E = 2.595%
n =
5.Hypothesis tests & confidence intervalsMedium
8 employees take a typing test before and after a training course. For each person the difference d = after − before (words per minute) is recorded. The mean difference is 3.58 and the standard deviation of the differences is 9.2. Find the paired test statistic t for H₀: μd = 0.
n = 8d̄ = 3.58sd = 9.2
t =
6.Hypothesis tests & confidence intervalsHard
A sample of 64 measurements has mean 104.5. The population standard deviation is 20. Find the lower limit L of the 95% confidence interval for the mean.
x̄ = 104.5σ = 20n = 6495%
L =
7.Linear regression & correlationMedium
The table gives 5 paired observations of x = hours studied and y = exam score. Their sums are given. Find Pearson's correlation coefficient r from these sums.
n = 5Σx = 20Σy = 234Σx² = 90Σy² = 11050Σxy = 966
r =
8.Linear regression & correlationHard
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. For which value x does the line predict ŷ = 23?
n = 6ŷ = 23
x =
9.Chi-square testsMedium
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 = 1002 × 3
χ² =
10.Chi-square testsHard
The table shows observed counts. Test at α = 0.05 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.05
χ² =
3Solutions
1.Normal distribution
Answer: P = 0.6773
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₁ = (169.95 − 178)/7 = −1.15
z₂ = (183.95 − 178)/7 = 0.85
Area between
P = Φ(0.85) − Φ(−1.15) = 0.8023 − 0.1251 = 0.6773
Answer
P = 0.6773
2.Normal distribution
Answer: P = 0.7881
Sums and differences of normal variables: if X and Y are independent and normal, X + Y and X − Y are normal too. Means add or subtract: E(X ± Y) = μX ± μY. Variances always add, also for a difference: Var(X ± Y) = σX² + σY², so σ = √(σX² + σY²). Standard deviations never add directly. The total of n independent items with the same distribution has mean n·μ and standard deviation σ·√n. Then standardise as usual: z = (x − mean)/σ and read Φ(z).
Distribution of the difference
μ = 52 − 48 = 4 s, σ = 5 s
Standardise
z = (0 − 4)/5 = −0.8
Probability
P = 1 − Φ(−0.8) = 0.7881
Answer
P = 0.7881
3.Confidence intervals
Answer: E = 3.687 mmHg
Interval for a difference: estimate ± critical value × standard error. For two independent means with known σ: SE = √(σ₁²/n₁ + σ₂²/n₂) and z. With equal unknown variances: pooled s_p and t with n₁ + n₂ − 2 degrees of freedom. For paired data, work with the differences: d̄ ± t·s_d/√n.
Critical value
df = 12, t = 2.179
Margin of error
E = 2.179·6.1/√13 = 3.687
Answer
E = 3.687 mmHg
4.Confidence intervals
Answer: n = 517
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.
Solve for n
n = (1.96·29/2.5)² = 516.9
Round up
A sample size is a whole number, and rounding down would make the margin too large.
n = 517
Answer
n = 517
5.Hypothesis tests & confidence intervals
Answer: t = 1.101
Testing a mean: the test statistic measures how many standard errors the sample mean lies from the value claimed in H₀: z = (x̄ − μ₀)/(σ/√n) when σ is known, t = (x̄ − μ₀)/(s/√n) when it is estimated from the sample. A confidence interval is x̄ ± (critical value)·(standard error).
Standard error of the mean difference
SE = 9.2/√8 = 3.253
Test statistic
t = 3.58/3.253 = 1.101
Answer
t = 1.101
With df = 7, the two-sided 5% critical value is 2.365; |t| is smaller, so H₀ is not rejected.
6.Hypothesis tests & confidence intervals
Answer: L = 99.6
Testing a mean: the test statistic measures how many standard errors the sample mean lies from the value claimed in H₀: z = (x̄ − μ₀)/(σ/√n) when σ is known, t = (x̄ − μ₀)/(s/√n) when it is estimated from the sample. A confidence interval is x̄ ± (critical value)·(standard error).
Margin of error
E = 1.96·20/√64 = 4.9
Interval limit
L = 104.5 − 4.9 = 99.6
Answer
L = 99.6
7.Linear regression & correlation
Answer: r = 0.9544
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 = 966 − 20·234/5 = 30
Sxx = 90 − 20²/5 = 10
Syy = 11050 − 234²/5 = 98.8
Correlation coefficient
r = 30/√(10·98.8) = 0.9544
Answer
r = 0.9544
8.Linear regression & correlation
Answer: x = 2.564
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
ȳ = 125/6 = 20.83
Sums of squares and products
Sxx = Σ(x − x̄)² = 17.5
Sxy = Σ(x − x̄)(y − ȳ) = −40.5
Regression line
b = −40.5/17.5 = −2.314
a = 20.83 − (−2.314)·3.5 = 28.93
ŷ = 28.93 − 2.314·x
Solve for x
x = (23 − 28.93)/(−2.314) = 2.564
Answer
x = 2.564
9.Chi-square tests
Answer: χ² = 13.75
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 α.
df = 2. At α = 0.05 the critical value is 5.991, so H₀ (independence) is rejected.
10.Chi-square tests
Answer: χ² = 22.15
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 α.