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
750 g735.2 gX + Y?

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
μ = 178x = ?20%

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
n = 20, s = 15LU = ?x̄ = 33.5E90%

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

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
1.24p = ?

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
μ₀x̄c

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
xy354465561671768xy466070

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 = 25Σy = 319Σx² = 135Σy² = 20527Σxy = 1629
r =
8.Linear regression & correlationHard
xy2104156268311040xy51010203040x = 5

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
lowmediumhighTotalurban16244080rural5322360Total215663140

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

Expected counts

urban: 80·21/140 = 12, 80·56/140 = 32, 80·63/140 = 36
rural: 60·21/140 = 9, 60·56/140 = 24, 60·63/140 = 27

Chi-square statistic

χ² = (16 − 12)²/12 + (24 − 32)²/32 + (40 − 36)²/36 + (5 − 9)²/9 + (32 − 24)²/24 + (23 − 27)²/27
χ² = 8.815

Answer

χ² = 8.815

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

Degrees of freedom

df = 8 − 1 − 1 = 6

Answer

df = 6

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