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
X is normal with mean 250 g and standard deviation 4 g; Y is independent and normal with mean 500 g and standard deviation 9 g. Find the probability P that X + Y is more than 759.8 g. Round z to two decimals.
μX = 250, σX = 4μY = 500, σY = 9X + Y > 759.8 g
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 97.5% of them lie (the 97.5th percentile).
μ = 500σ = 40P = 97.5%
x = h
3.Confidence intervalsMedium
A 90% confidence interval for a mean, based on 36 observations and a known σ, has a margin of error of 5.4. What is the margin of error E₂ of a 99% interval from the same data?
90%n₁ = 36E₁ = 5.499%
E₂ =
4.Confidence intervalsHard
The population standard deviation is 17. 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 4?
σ = 17E = 495%
n =
5.Hypothesis tests & confidence intervalsMedium
15 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 0.91 and the standard deviation of the differences is 1.1. Find the paired test statistic t for H₀: μd = 0.
n = 15d̄ = 0.91sd = 1.1
t =
6.Hypothesis tests & confidence intervalsHard
In a trial, 120 of 300 patients on treatment A recover, and 42 of 150 patients on treatment B. Using the pooled proportion, find the test statistic z for H₀: p₁ = p₂.
x₁ = 120n₁ = 300x₂ = 42n₂ = 150
z =
7.Linear regression & correlationMedium
The table gives 6 paired observations of x = hours studied and y = exam score. Find Pearson's correlation coefficient r.
n = 6
r =
8.Linear regression & correlationHard
The table gives 5 paired observations of x = advertising spend in k€ and y = sales in k€. Use the least-squares line ŷ = a + b·x. A new observation (3, 39) is made. Find its residual e = y − ŷ.
n = 5(3, 39)
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 “students, bike”.
row total = 108column total = 70N = 202
E =
10.Chi-square testsHard
A chi-square goodness-of-fit test compares observed counts in 8 categories with fully specified expected proportions (no parameters are estimated from the data). Using the table, find the critical value χ²crit at significance level α = 0.01.
α = 0.01
χ²crit =
3Solutions
1.Normal distribution
Answer: P = 0.1587
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 sum
μ = 750 g, σ = √(4² + 9²) = 9.849 g
Standardise
z = (759.8 − 750)/9.849 = 1
Upper tail
P = 1 − Φ(1) = 1 − 0.8413 = 0.1587
Answer
P = 0.1587
2.Normal distribution
Answer: x = 578.4 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.975 → z = 1.96
Back to x
x = 500 + 1.96·40 = 578.4 h
Answer
x = 578.4 h
3.Confidence intervals
Answer: E₂ = 8.456
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.
Ratio of margins
E₂/E₁ = (2.576/1.645)·√(36/36) = 1.566
New margin
E₂ = 5.4·1.566 = 8.456
Answer
E₂ = 8.456
4.Confidence intervals
Answer: n = 70
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·17/4)² = 69.39
Round up
A sample size is a whole number, and rounding down would make the margin too large.
n = 70
Answer
n = 70
5.Hypothesis tests & confidence intervals
Answer: t = 3.204
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 = 1.1/√15 = 0.284
Test statistic
t = 0.91/0.284 = 3.204
Answer
t = 3.204
With df = 14, the two-sided 5% critical value is 2.145; |t| is larger, so H₀ is rejected.
6.Hypothesis tests & confidence intervals
Answer: z = 2.5
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 ≤ α.
Sample proportions
p̂₁ = 120/300 = 0.4
p̂₂ = 42/150 = 0.28
p̂ = 162/450 = 0.36
Standard error under H₀
SE = √(0.36·0.64·(1/300 + 1/150)) = 0.048
Test statistic
z = (0.4 − 0.28)/0.048 = 2.5
Answer
z = 2.5
|z| > 1.96, so H₀ is rejected at the 5% level (two-sided).
7.Linear regression & correlation
Answer: r = 0.9132
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̄ = 27/6 = 4.5
ȳ = 383/6 = 63.83
Sums of squares and products
Sxx = Σ(x − x̄)² = 17.5
Sxy = Σ(x − x̄)(y − ȳ) = 60.5
Syy = Σ(y − ȳ)² = 250.8
Correlation coefficient
r = 60.5/√(17.5·250.8) = 0.9132
Answer
r = 0.9132
8.Linear regression & correlation
Answer: e = −5.25
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̄ = 30/5 = 6
ȳ = 276/5 = 55.2
Sums of squares and products
Sxx = Σ(x − x̄)² = 40
Sxy = Σ(x − x̄)(y − ȳ) = 146
Regression line
b = 146/40 = 3.65
a = 55.2 − 3.65·6 = 33.3
ŷ = 33.3 + 3.65·x
Predicted value
ŷ = 33.3 + 3.65·3 = 44.25
Residual
e = 39 − 44.25 = −5.25
Answer
e = −5.25
The point lies below the line.
9.Chi-square tests
Answer: E = 37.43
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 = 108·70/202 = 37.43
Answer
E = 37.43
10.Chi-square tests
Answer: χ²crit = 18.48
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 α.
Degrees of freedom
df = 8 − 1 = 7
Table
χ²crit(df = 7, α = 0.01) = 18.475
Answer
χ²crit = 18.475
Reject H₀ if the computed χ² is larger than this value.