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 735.2 g. Round z to two decimals.
μX = 250, σX = 4μY = 500, σY = 9X + Y > 735.2 g
P =
2.Normal distributionHard
The heights of adult men are normally distributed with mean 178 cm and standard deviation 7 cm. Find the value x below which 20% of them lie (the 20th percentile).
μ = 178σ = 7P = 20%
x = cm
3.Confidence intervalsMedium
A sample of 20 items has mean 33.5 and standard deviation s = 15. The population is roughly normal. Find the upper limit of the 90% confidence interval for the mean.
n = 20x̄ = 33.5s = 1590%t(19) = 1.729
upper limit =
4.Confidence intervalsHard
The population standard deviation is 28. How large a sample n do you need so that a 99% confidence interval for the mean has a margin of error of at most 1.5?
σ = 28E = 1.599%
n =
5.Hypothesis tests & confidence intervalsMedium
The mean of a population is claimed to be 250; the population standard deviation is known to be 24. A random sample of 64 observations has a mean of 253.72. Test H₀: μ = 250 against H₁: μ > 250. Find the p-value p.
μ₀ = 250σ = 24n = 64x̄ = 253.72H₁: μ > μ₀
p =
6.Hypothesis tests & confidence intervalsHard
A one-sided z test of H₀: μ = 200 against H₁: μ < 200 is done at α = 0.05 with a sample of 36; the standard deviation is known to be 3. In reality the mean is 199.5. Find the power 1 − β of the test in percent.
μ₀ = 200μ = 199.5σ = 3n = 36α = 0.05
1 − β = %
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.
The table gives 5 paired observations of x = load in kN and y = extension in mm. Use the least-squares line ŷ = a + b·x. A new observation (5, 25) is made. Find its residual e = y − ŷ.
n = 5(5, 25)
e =
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 = 1402 × 3
χ² =
10.Chi-square testsHard
A chi-square goodness-of-fit test checks whether counts in 8 categories follow a Poisson distribution whose mean is estimated from the same data. How many degrees of freedom df does the test have?
k = 8
df =
3Solutions
1.Normal distribution
Answer: P = 0.9332
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 = (735.2 − 750)/9.849 = −1.5
Upper tail
P = 1 − Φ(−1.5) = 1 − 0.06681 = 0.9332
Answer
P = 0.9332
2.Normal distribution
Answer: x = 172.1 cm
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.2 → z = −0.8416
Back to x
x = 178 + −0.8416·7 = 172.11 cm
Answer
x = 172.11 cm
3.Confidence intervals
Answer: upper limit = 39.3
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 = 19, t = 1.729
Margin of error
E = 1.729·15/√20 = 5.799
Interval
33.5 ± 5.799 → [27.7, 39.3]
Answer
upper limit = 39.3
4.Confidence intervals
Answer: n = 2313
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 = (2.576·28/1.5)² = 2312
Round up
A sample size is a whole number, and rounding down would make the margin too large.
n = 2313
Answer
n = 2313
5.Hypothesis tests & confidence intervals
Answer: p = 0.1075
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 ≤ α.
Test statistic
SE = σ/√n = 24/√64 = 3
z = (253.72 − 250)/3 = 1.24
Tail area
Φ(1.24) = 0.8925
1 − Φ(1.24) = 0.1075
p-value
p = 0.1075
Answer
p = 0.1075
p > 0.05, so H₀ is not rejected at the 5% level.
6.Hypothesis tests & confidence intervals
Answer: 1 − β = 25.95 %
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 = 3/√36 = 0.5
x̄c = 200 − 1.645·0.5 = 199.2
z under the true mean
z = (199.2 − 199.5)/0.5 = −0.645
Power
power = P(Z < −0.645) = 25.95%
1 − β = 25.95%
Answer
1 − β = 25.95%
7.Linear regression & correlation
Answer: r = 0.8132
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 = 1629 − 25·319/5 = 34
Sxx = 135 − 25²/5 = 10
Syy = 20527 − 319²/5 = 174.8
Correlation coefficient
r = 34/√(10·174.8) = 0.8132
Answer
r = 0.8132
8.Linear regression & correlation
Answer: e = 4.4
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
ȳ = 122/5 = 24.4
Sums of squares and products
Sxx = Σ(x − x̄)² = 40
Sxy = Σ(x − x̄)(y − ȳ) = 152
Regression line
b = 152/40 = 3.8
a = 24.4 − 3.8·6 = 1.6
ŷ = 1.6 + 3.8·x
Predicted value
ŷ = 1.6 + 3.8·5 = 20.6
Residual
e = 25 − 20.6 = 4.4
Answer
e = 4.4
The point lies above the line.
9.Chi-square tests
Answer: χ² = 8.815
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: df = 6
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 α.