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
150 kg148.2 kgT = X₁ + … + X₆?

The masses of bags of cement are independent and normal with mean 25 kg and standard deviation 0.5 kg. Find the probability P that the total mass of 6 of them exceeds 148.2 kg. Round z to two decimals.

μ = 25 kgσ = 0.5 kgn = 6> 148.2 kg
P =
2.Normal distributionHard
μ = 100x = ?10%

The IQ scores are normally distributed with mean 100 points and standard deviation 15 points. Find the value x below which 10% of them lie (the 10th percentile).

μ = 100σ = 15P = 10%
x = points
3.Confidence intervalsMedium
n = 10, s = 4LU = ?x̄ = 73.5E90%

A sample of 10 items has mean 73.5 and standard deviation s = 4. The population is roughly normal. Find the upper limit of the 90% confidence interval for the mean.

n = 10x̄ = 73.5s = 490%t(9) = 1.833
upper limit =
4.Confidence intervalsHard
σ = 26, n = ?x̄ − Ex̄ + Ex̄E = 299%

The population standard deviation is 26. 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 2?

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

Two teaching methods are compared. Group 1: 20 students, mean score 25, standard deviation 8. Group 2: 6 students, mean score 20.9, standard deviation 8. 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̄₁ = 25s₁ = 8n₂ = 6x̄₂ = 20.9s₂ = 8
t =
6.Hypothesis tests & confidence intervalsHard
μ₀x̄c

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

μ₀ = 100μ = 107.5σ = 15n = 36α = 0.05
β = %
7.Linear regression & correlationMedium
xy129332535734941xy5303540

The table gives 5 paired observations of x = advertising spend in k€ and y = sales in k€. Find the coefficient of determination r² of the least-squares line.

n = 5
r² =
8.Linear regression & correlationHard
xy128224321419513612xy246152025x = 4.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 (4.5, 12) is made. Find its residual e = y − ŷ.

n = 6(4.5, 12)
e =
9.Chi-square testsMedium
busbikecarTotalstudents20233780staff8193360Total284270140

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
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 compares observed counts in 4 categories with fully specified expected proportions (no parameters are estimated from the data). Using the table, find the critical value χ²crit at significance level α = 0.01.

α = 0.01
χ²crit =

3Solutions

1.Normal distribution

Answer: P = 0.9292

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 total

μT = 150 kg, σT = 0.5·√6 = 1.225 kg

Standardise

z = (148.2 − 150)/1.225 = −1.47

Probability

P = 1 − Φ(−1.47) = 0.9292

Answer

P = 0.9292
2.Normal distribution

Answer: x = 80.78 points

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.1 → z = −1.282

Back to x

x = 100 + −1.282·15 = 80.78 points

Answer

x = 80.78 points
3.Confidence intervals

Answer: upper limit = 75.82

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 = 9, t = 1.833

Margin of error

E = 1.833·4/√10 = 2.319

Interval

73.5 ± 2.319 → [71.18, 75.82]

Answer

upper limit = 75.82
4.Confidence intervals

Answer: n = 1122

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·26/2)² = 1121

Round up

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

n = 1122

Answer

n = 1122
5.Hypothesis tests & confidence intervals

Answer: t = 1.101

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·8²)/24 = 64
sp = 8

Standard error

SE = 8·√(1/20 + 1/6) = 3.724

Test statistic

t = (25 − 20.9)/3.724 = 1.101

Answer

t = 1.101

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

6.Hypothesis tests & confidence intervals

Answer: β = 8.771 %

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 = 15/√36 = 2.5
x̄c = 100 + 1.645·2.5 = 104.1

z under the true mean

z = (104.1 − 107.5)/2.5 = −1.355

Type II error

power = P(Z > −1.355) = 91.23%
β = 100% − 91.23% = 8.771%

Answer

β = 8.771%
7.Linear regression & correlation

Answer: r² = 0.8579

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̄ = 25/5 = 5
ȳ = 171/5 = 34.2

Sums of squares and products

Sxx = Σ(x − x̄)² = 40
Sxy = Σ(x − x̄)(y − ȳ) = 52
Syy = Σ(y − ȳ)² = 78.8

Coefficient of determination

r² = 52²/(40·78.8) = 0.8579

Answer

r² = 0.8579

About 85.79% of the variation in y is explained by the line.

8.Linear regression & correlation

Answer: e = −4.214

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
ȳ = 117/6 = 19.5

Sums of squares and products

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

Regression line

b = −57.5/17.5 = −3.286
a = 19.5 − (−3.286)·3.5 = 31
ŷ = 31 − 3.286·x

Predicted value

ŷ = 31 + (−3.286)·4.5 = 16.21

Residual

e = 12 − 16.21 = −4.214

Answer

e = −4.214

The point lies below the line.

9.Chi-square tests

Answer: χ² = 2.956

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: 80·28/140 = 16, 80·42/140 = 24, 80·70/140 = 40
staff: 60·28/140 = 12, 60·42/140 = 18, 60·70/140 = 30

Chi-square statistic

χ² = (20 − 16)²/16 + (23 − 24)²/24 + (37 − 40)²/40 + (8 − 12)²/12 + (19 − 18)²/18 + (33 − 30)²/30
χ² = 2.956

Answer

χ² = 2.956

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

10.Chi-square tests

Answer: χ²crit = 11.35

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 = 4 − 1 = 3

Table

χ²crit(df = 3, α = 0.01) = 11.345

Answer

χ²crit = 11.345

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

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