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
169.95183.95P = ?

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
4 s0X − Y?

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
n = 13, sd​ = 6.10LUd̄ = 4.5E = ?95%

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
σ = 29, n = ?x̄ − Ex̄ + Ex̄E = 2.595%

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
−2.3652.365t = ?df = 7

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
z −1.9601.96

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
xy241344445552652xy2464550

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
xy126223324421517614xy246152025ŷ = 23

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
no defectminormajorTotalday shift12301860night shift3102740Total154045100

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
yesnoTotalline 12773100line 2172340line 3281240Total72108180dfα = 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.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 α.

Expected counts

day shift: 60·15/100 = 9, 60·40/100 = 24, 60·45/100 = 27
night shift: 40·15/100 = 6, 40·40/100 = 16, 40·45/100 = 18

Chi-square statistic

χ² = (12 − 9)²/9 + (30 − 24)²/24 + (18 − 27)²/27 + (3 − 6)²/6 + (10 − 16)²/16 + (27 − 18)²/18
χ² = 13.75

Answer

χ² = 13.75

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 α.

Expected counts

line 1: 40, 60
line 2: 16, 24
line 3: 16, 24

Chi-square statistic

χ² = (27 − 40)²/40 + (73 − 60)²/60 + (17 − 16)²/16 + (23 − 24)²/24 + (28 − 16)²/16 + (12 − 24)²/24
χ² = 22.15

Decision

df = 2, χ²crit = 5.991
22.15 > 5.991

Answer

χ² = 22.15

χ² is above the critical value, so H₀ is rejected: the variables appear to be related.

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