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
−3−2−10123zshaded area between −z and z = 0.6265

Drag z so that the shaded area between −z and z under the standard normal curve is 0.6265. Find z to two decimals.

A = 0.6265
z =
2.Normal distributionHard
0.05 mm0D − d?

Hole diameters D are normal with mean 25.05 mm and standard deviation 0.01 mm. Shaft diameters d are independent and normal with mean 25 mm and standard deviation 0.02 mm. A randomly chosen shaft fits when D − d > 0. Find the probability P that it fits. Round z to two decimals.

hole: μ = 25.05 mm, σ = 0.01 mmshaft: μ = 25 mm, σ = 0.02 mm
P =
3.Confidence intervalsMedium
n = 25, s = 13.5L = ?Ux̄ = 88.5E90%

A sample of 25 items has mean 88.5 and standard deviation s = 13.5. The population is roughly normal. Find the lower limit of the 90% confidence interval for the mean.

n = 25x̄ = 88.5s = 13.590%t(24) = 1.711
lower limit =
4.Confidence intervalsHard
σ = 14, n = ?x̄ − Ex̄ + Ex̄E = 190%

The population standard deviation is 14. 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 1?

σ = 14E = 190%
n =
5.Hypothesis tests & confidence intervalsMedium
−2.48p = ?

The mean of a population is claimed to be 250; the population standard deviation is known to be 12. A random sample of 144 observations has a mean of 247.52. Test H₀: μ = 250 against H₁: μ < 250. Find the p-value p.

μ₀ = 250σ = 12n = 144x̄ = 247.52H₁: μ < μ₀
p =
6.Hypothesis tests & confidence intervalsHard
μ₀x̄c

A one-sided z test of H₀: μ = 200 against H₁: μ < 200 is done at α = 0.05 with a sample of 100; the standard deviation is known to be 10. In reality the mean is 197.8. Find the power 1 − β of the test in percent.

μ₀ = 200μ = 197.8σ = 10n = 100α = 0.05
1 − β = %
7.Linear regression & correlationMedium
xy132342559765978xy5406080

The table gives 5 paired observations of x = advertising spend in k€ and y = sales in k€. Their sums are given. Find Pearson's correlation coefficient r from these sums.

n = 5Σx = 25Σy = 276Σx² = 165Σy² = 16578Σxy = 1610
r =
8.Linear regression & correlationHard
xy127225320416517614xy246152025x = 2.5

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. A new observation (2.5, 18) is made. Find its residual e = y − ŷ.

n = 6(2.5, 18)
e =
9.Chi-square testsMedium
busbikecarTotalstudents1082240staff20221860Total303040100

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
passfailTotalline 1103040line 24060100line 343640Total54126180dfα = 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: z = 0.89

From an area back to z: Φ(z) is the area to the left of z. For a left-tail area A, find z with Φ(z) = A in the table. A right-tail area A means Φ(z) = 1 − A. A central area A between −z and z leaves (1 − A)/2 in each tail, so Φ(z) = (1 + A)/2. For a value x, use x = μ + zσ.

Area to the left of z

Φ(z) = (1 + 0.6265)/2 = 0.8133

Read the z-table backwards

Find 0.8133 inside the table and read off z.

z = 0.89

Answer

z = 0.89
2.Normal distribution

Answer: P = 0.9875

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

μ = 25.05 − 25 = 0.05 mm, σ = 0.02236 mm

Standardise

z = (0 − 0.05)/0.02236 = −2.24

Probability

P = 1 − Φ(−2.24) = 0.9875

Answer

P = 0.9875
3.Confidence intervals

Answer: lower limit = 83.88

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 = 24, t = 1.711

Margin of error

E = 1.711·13.5/√25 = 4.62

Interval

88.5 ± 4.62 → [83.88, 93.12]

Answer

lower limit = 83.88
4.Confidence intervals

Answer: n = 531

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·14/1)² = 530.4

Round up

A sample size is a whole number, and rounding down would make the margin too large.

n = 531

Answer

n = 531
5.Hypothesis tests & confidence intervals

Answer: p = 0.006569

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 = 12/√144 = 1
z = (247.52 − 250)/1 = −2.48

Tail area

Φ(2.48) = 0.9934
1 − Φ(2.48) = 0.0066

p-value

p = 0.006569

Answer

p = 0.006569

p ≤ 0.05, so H₀ is rejected at the 5% level.

6.Hypothesis tests & confidence intervals

Answer: 1 − β = 71.06 %

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 = 10/√100 = 1
x̄c = 200 − 1.645·1 = 198.4

z under the true mean

z = (198.4 − 197.8)/1 = 0.555

Power

power = P(Z < 0.555) = 71.06%
1 − β = 71.06%

Answer

1 − β = 71.06%
7.Linear regression & correlation

Answer: r = 0.9924

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 = 1610 − 25·276/5 = 230
Sxx = 165 − 25²/5 = 40
Syy = 16578 − 276²/5 = 1343

Correlation coefficient

r = 230/√(40·1343) = 0.9924

Answer

r = 0.9924
8.Linear regression & correlation

Answer: e = −4.49

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
ȳ = 119/6 = 19.83

Sums of squares and products

Sxx = Σ(x − x̄)² = 17.5
Sxy = Σ(x − x̄)(y − ȳ) = −46.5

Regression line

b = −46.5/17.5 = −2.657
a = 19.83 − (−2.657)·3.5 = 29.13
ŷ = 29.13 − 2.657·x

Predicted value

ŷ = 29.13 + (−2.657)·2.5 = 22.49

Residual

e = 18 − 22.49 = −4.49

Answer

e = −4.49

The point lies below the line.

9.Chi-square tests

Answer: χ² = 6.528

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

students: 40·30/100 = 12, 40·30/100 = 12, 40·40/100 = 16
staff: 60·30/100 = 18, 60·30/100 = 18, 60·40/100 = 24

Chi-square statistic

χ² = (10 − 12)²/12 + (8 − 12)²/12 + (22 − 16)²/16 + (20 − 18)²/18 + (22 − 18)²/18 + (18 − 24)²/24
χ² = 6.528

Answer

χ² = 6.528

df = 2. At α = 0.05 the critical value is 5.991, so H₀ (independence) is rejected.

10.Chi-square tests

Answer: χ² = 12.86

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: 12, 28
line 2: 30, 70
line 3: 12, 28

Chi-square statistic

χ² = (10 − 12)²/12 + (30 − 28)²/28 + (40 − 30)²/30 + (60 − 70)²/70 + (4 − 12)²/12 + (36 − 28)²/28
χ² = 12.86

Decision

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

Answer

χ² = 12.86

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

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