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

The bag weights are normally distributed with mean 250 g and standard deviation 5 g. What fraction lies between 248.5 and 259.25 g? Give P as a decimal.

μ = 250σ = 5x1 = 248.5x2 = 259.25
P =
2.Normal distributionHard
10 g0X − Y?

The mass X of a product from line 1 and Y from line 2 are independent and normal: X has mean 500 g and standard deviation 8 g, Y has mean 490 g and standard deviation 6 g. Find the probability P that X is greater than Y. Round z to two decimals.

μX = 500 g, σX = 8 gμY = 490 g, σY = 6 g
P =
3.Confidence intervalsMedium
n = 6, s = 12LU = ?x̄ = 67.5E99%

A sample of 6 items has mean 67.5 and standard deviation s = 12. The population is roughly normal. Find the upper limit of the 99% confidence interval for the mean.

n = 6x̄ = 67.5s = 1299%t(5) = 4.032
upper limit =
4.Confidence intervalsHard
σ = 14, n = ?x̄ − Ex̄ + Ex̄E = 290%

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 2?

σ = 14E = 290%
n =
5.Hypothesis tests & confidence intervalsMedium
−2.0642.064t = ?df = 24

Two teaching methods are compared. Group 1: 20 students, mean score 102.5, standard deviation 8. Group 2: 6 students, mean score 93.2, standard deviation 9.5. Assume equal population variances and use the pooled two-sample t test. Find the test statistic t for H₀: μ₁ = μ₂, taking the difference as x̄₁ − x̄₂ (group 1 minus group 2).

n₁ = 20x̄₁ = 102.5s₁ = 8n₂ = 6x̄₂ = 93.2s₂ = 9.5
t =
6.Hypothesis tests & confidence intervalsHard
μ₀x̄c

A one-sided z test of H₀: μ = 100 against H₁: μ > 100 is done at α = 0.01 with a sample of 64; the standard deviation is known to be 16. In reality the mean is 105.4. Find the probability of a Type II error β in percent.

μ₀ = 100μ = 105.4σ = 16n = 64α = 0.01
β = %
7.Linear regression & correlationMedium
xy3435547639731174xy510506070

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 = 35Σy = 307Σx² = 285Σy² = 19539Σxy = 2311
r =
8.Linear regression & correlationHard
xy294206268331040xy51010203040x = 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. Predict ŷ for x = 5.

n = 5x = 5
ŷ =
9.Chi-square testsMedium
busbikecarTotalstudents15222360staff9321960Total245442120

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 = 1202 × 3
χ² =
10.Chi-square testsHard
dfα = 0.05α = 0.0113.8416.63525.9919.21037.81511.34549.48813.277511.07015.086612.59216.812714.06718.475815.50720.090916.91921.6661018.30723.209

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. Using the table, find the critical value χ²crit at significance level α = 0.01.

α = 0.01
χ²crit =

3Solutions

1.Normal distribution

Answer: P = 0.5858

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₁ = (248.5 − 250)/5 = −0.3
z₂ = (259.25 − 250)/5 = 1.85

Area between

P = Φ(1.85) − Φ(−0.3) = 0.9678 − 0.3821 = 0.5858

Answer

P = 0.5858
2.Normal distribution

Answer: P = 0.8413

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

μ = 500 − 490 = 10 g, σ = 10 g

Standardise

z = (0 − 10)/10 = −1

Probability

P = 1 − Φ(−1) = 0.8413

Answer

P = 0.8413
3.Confidence intervals

Answer: upper limit = 87.25

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 = 5, t = 4.032

Margin of error

E = 4.032·12/√6 = 19.75

Interval

67.5 ± 19.75 → [47.75, 87.25]

Answer

upper limit = 87.25
4.Confidence intervals

Answer: n = 133

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/2)² = 132.6

Round up

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

n = 133

Answer

n = 133
5.Hypothesis tests & confidence intervals

Answer: t = 2.397

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

Pooled variance

sp² = (19·8² + 5·9.5²)/24 = 69.47
sp = 8.335

Standard error

SE = 8.335·√(1/20 + 1/6) = 3.88

Test statistic

t = (102.5 − 93.2)/3.88 = 2.397

Answer

t = 2.397

With df = 24, the two-sided 5% critical value is 2.064; |t| is larger, so H₀ is rejected.

6.Hypothesis tests & confidence intervals

Answer: β = 35.42 %

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 = 16/√64 = 2
x̄c = 100 + 2.326·2 = 104.7

z under the true mean

z = (104.7 − 105.4)/2 = −0.374

Type II error

power = P(Z > −0.374) = 64.58%
β = 100% − 64.58% = 35.42%

Answer

β = 35.42%
7.Linear regression & correlation

Answer: r = 0.9757

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 = 2311 − 35·307/5 = 162
Sxx = 285 − 35²/5 = 40
Syy = 19539 − 307²/5 = 689.2

Correlation coefficient

r = 162/√(40·689.2) = 0.9757

Answer

r = 0.9757
8.Linear regression & correlation

Answer: ŷ = 21.85

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
ȳ = 128/5 = 25.6

Sums of squares and products

Sxx = Σ(x − x̄)² = 40
Sxy = Σ(x − x̄)(y − ȳ) = 150

Regression line

b = 150/40 = 3.75
a = 25.6 − 3.75·6 = 3.1
ŷ = 3.1 + 3.75·x

Prediction

ŷ = 3.1 + 3.75·5 = 21.85

Answer

ŷ = 21.85
9.Chi-square tests

Answer: χ² = 3.733

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: 60·24/120 = 12, 60·54/120 = 27, 60·42/120 = 21
staff: 60·24/120 = 12, 60·54/120 = 27, 60·42/120 = 21

Chi-square statistic

χ² = (15 − 12)²/12 + (22 − 27)²/27 + (23 − 21)²/21 + (9 − 12)²/12 + (32 − 27)²/27 + (19 − 21)²/21
χ² = 3.733

Answer

χ² = 3.733

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

10.Chi-square tests

Answer: χ²crit = 16.81

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

Table

χ²crit(df = 6, α = 0.01) = 16.812

Answer

χ²crit = 16.812

Reject H₀ if the computed χ² is larger than this value.

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