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 battery lifetimes are normally distributed with mean 500 h and standard deviation 40 h. What fraction lies between 482 and 542 h? Give P as a decimal.
μ = 500σ = 40x1 = 482x2 = 542
P =
2.Normal distributionHard
The battery lifetimes are normally distributed with mean 500 h and standard deviation 40 h. Find the value x below which 95% of them lie (the 95th percentile).
μ = 500σ = 40P = 95%
x = h
3.Confidence intervalsMedium
A sample of 21 items has mean 100 and standard deviation s = 17. The population is roughly normal. Find the margin of error E of a 99% confidence interval for the mean.
n = 21x̄ = 100s = 1799%t(20) = 2.845
E =
4.Confidence intervalsHard
The population standard deviation is 21. How large a sample n do you need so that a 90% confidence interval for the mean has a margin of error of at most 2?
σ = 21E = 290%
n =
5.Hypothesis tests & confidence intervalsMedium
A sample of 36 students has a mean score of 46.33 and a sample standard deviation of 10. Find the test statistic t for H₀: μ = 50.
μ₀ = 50x̄ = 46.33s = 10n = 36
t =
6.Hypothesis tests & confidence intervalsHard
How large must a sample be so that the 95% confidence interval for a mean has a margin of error of at most 0.5? The standard deviation is 4. Find the smallest sample size n.
σ = 4E = 0.595%
n =
7.Linear regression & correlationMedium
The table gives 6 paired observations of x = car age in years and y = price in k€. Their sums are given. Find Pearson's correlation coefficient r from these sums.
n = 6Σx = 21Σy = 115Σx² = 91Σy² = 2269Σxy = 372
r =
8.Linear regression & correlationHard
The table gives 5 paired observations of x = temperature in °C and y = ice creams sold. Use the least-squares line ŷ = a + b·x. A new observation (18, 64) is made. Find its residual e = y − ŷ.
n = 5(18, 64)
e =
9.Chi-square testsMedium
The contingency table shows observed counts. For a chi-square test of independence, find the expected count E for the cell “staff, bus”.
row total = 78column total = 75N = 174
E =
10.Chi-square testsHard
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 = 2403 × 2α = 0.01
χ² =
3Solutions
1.Normal distribution
Answer: P = 0.5268
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₁ = (482 − 500)/40 = −0.45
z₂ = (542 − 500)/40 = 1.05
Area between
P = Φ(1.05) − Φ(−0.45) = 0.8531 − 0.3264 = 0.5268
Answer
P = 0.5268
2.Normal distribution
Answer: x = 565.8 h
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 for the percentile
Φ(z) = 0.95 → z = 1.645
Back to x
x = 500 + 1.645·40 = 565.8 h
Answer
x = 565.8 h
3.Confidence intervals
Answer: E = 10.55
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 = 20, t = 2.845
Margin of error
E = 2.845·17/√21 = 10.55
Answer
E = 10.55
4.Confidence intervals
Answer: n = 299
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.645·21/2)² = 298.3
Round up
A sample size is a whole number, and rounding down would make the margin too large.
n = 299
Answer
n = 299
5.Hypothesis tests & confidence intervals
Answer: t = −2.202
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
SE = 10/√36 = 10/6 = 1.667
Test statistic
t = (46.33 − 50)/1.667 = −2.202
Answer
t = −2.202
t0.025; df = 35 = 2.03
|t| > 2.03, so H₀ is rejected at the 5% level (two-sided).
6.Hypothesis tests & confidence intervals
Answer: n = 246
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).
Solve for n
n = (1.96·4/0.5)² = 245.9
Round up
n = 246
Answer
n = 246
7.Linear regression & correlation
Answer: r = −0.9055
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 = 372 − 21·115/6 = −30.5
Sxx = 91 − 21²/6 = 17.5
Syy = 2269 − 115²/6 = 64.83
Correlation coefficient
r = −30.5/√(17.5·64.83) = −0.9055
Answer
r = −0.9055
8.Linear regression & correlation
Answer: e = −4.55
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̄ = 105/5 = 21
ȳ = 426/5 = 85.2
Sums of squares and products
Sxx = Σ(x − x̄)² = 40
Sxy = Σ(x − x̄)(y − ȳ) = 222
Regression line
b = 222/40 = 5.55
a = 85.2 − 5.55·21 = −31.35
ŷ = −31.35 + 5.55·x
Predicted value
ŷ = −31.35 + 5.55·18 = 68.55
Residual
e = 64 − 68.55 = −4.55
Answer
e = −4.55
The point lies below the line.
9.Chi-square tests
Answer: E = 33.62
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 count
E = 78·75/174 = 33.62
Answer
E = 33.62
10.Chi-square tests
Answer: χ² = 1.536
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 α.