Worked Problems for Unit 3: Statistics, Inference and Regression

Unit 3 rewards the candidate who can calculate under time pressure. This chapter works five complete problems from the unit with numbers recomputed by script: descriptive statistics by hand, Bayes' theorem with the binomial and normal distributions, the standard error with confidence intervals and tests, ordinary least squares from first principles, and price index numbers.
Overview

1. Descriptive statistics by hand: mean, median, mode, variance and coefficient of variation

1 min read · 2 parts

Take ten observations of monthly output (in units): 12, 15, 11, 18, 14, 15, 20, 15, 9, 16. The mean is the sum 145 divided by 10, which is 14.5. Sorted, the data read 9, 11, 12, 14, 15, 15, 15, 16, 18, 20, so the median is the average of the fifth and sixth values, (15 + 15)/2 = 15, and the mode is 15, which appears three times. The deviations from the mean square to 6.25, 0.25, 12.25, 12.25, 0.25, 0.25, 30.25, 0.25, 30.25 and 2.25; their sum is 94.5.

Dividing 94.5 by n = 10 gives the population variance 9.45 and standard deviation 3.07; dividing by n − 1 = 9 gives the sample variance 10.5 and standard deviation 3.24. Economics papers almost always mean the sample version when the data are a sample, because dividing by n − 1 makes the estimator unbiased. The coefficient of variation is 3.24/14.5 × 100 = 22.3%, a unit-free measure that lets you compare spread across series measured in different units. Pearson's measure of skewness, 3(mean − median)/SD = 3(14.5 − 15)/3.24 = −0.46, shows a mild left skew: the mean sits below the median.

Summary of the ten-observation data set
MeasureValue
Mean14.5
Median15
Mode15
Sum of squared deviations94.5
Sample variance (n − 1)10.5
Sample standard deviation3.24
Coefficient of variation22.3%
⚠️ The trap: n against n − 1
A question that says 'the whole population' wants 9.45; one that says 'a sample of ten' wants 10.5. If the question does not say, read the setting: survey data are samples. Dividing by the wrong denominator shifts every later answer, including the standard error and the t-statistic.

Take ten observations of monthly output (in units): 12, 15, 11, 18, 14, 15, 20, 15, 9, 16. The mean is the sum 145 divided by 10, which is 14.5. Sorted, the data read 9, 11, 12, 14, 15, 15…

2. Probability: Bayes' theorem, the binomial and the normal distribution

1 min read · 3 parts

Bayes. A disease affects 1% of a population. A test detects it in 95% of the sick (sensitivity) and wrongly flags 5% of the healthy. A person tests positive. The probability of being sick given a positive is P(D|+) = P(+|D)P(D) / [P(+|D)P(D) + P(+|not D)P(not D)] = (0.95 × 0.01) / (0.95 × 0.01 + 0.05 × 0.99) = 0.0095 / 0.0590 = 0.161. Only about one positive in six is truly sick, because the healthy are so numerous that their 5% false alarms outnumber the true cases: 495 false positives against 95 true positives in every 10,000 people.

Binomial. With n = 5 independent trials and success probability 0.3, P(X = 2) = C(5, 2) × 0.3² × 0.7³ = 10 × 0.09 × 0.343 = 0.3087; the mean is np = 1.5 and the variance npq = 5 × 0.3 × 0.7 = 1.05. Normal. If X is normal with mean 50 and standard deviation 10, then P(40 < X < 65) = Φ(1.5) − Φ(−1) = 0.9332 − 0.1587 = 0.7745, because 65 is 1.5 standard deviations above the mean and 40 is one below. A useful anchor: about 68% of a normal distribution lies within one standard deviation of the mean, 95% within 1.96, and 99.7% within three.

Probability results at a glance
ProblemAnswer
P(sick0.161
Binomial P(X = 2), n = 5, p = 0.30.3087
Binomial mean and variance1.5 and 1.05
Normal P(40 < X < 65), N(50, 10²)0.7745

Bayes. A disease affects 1% of a population. A test detects it in 95% of the sick (sensitivity) and wrongly flags 5% of the healthy. A person tests positive. The probability of being sick…

3. The central limit theorem at work: standard error, confidence interval and test

2 min read · 2 parts

A sample of n = 64 has mean 52, and the population standard deviation is σ = 16. The standard error of the mean is σ/√n = 16/8 = 2. By the central limit theorem the sample mean is approximately normal whatever the shape of the population, so a 95% confidence interval is 52 ± 1.96 × 2 = (48.08, 55.92). To test H0: μ = 50 against H1: μ ≠ 50, the statistic is z = (52 − 50)/2 = 1.0, the two-sided p-value is 0.317, and since |z| < 1.96 the null is not rejected at 5%. The interval agrees: 50 lies inside it. Confidence interval and two-sided test are the same information read two ways.

Now suppose σ is unknown and n = 16 with sample standard deviation s = 8 and the same mean 52. The standard error is 8/4 = 2 again, but the reference distribution is Student's t with 15 degrees of freedom, whose 5% two-sided critical value is 2.131, wider than 1.96 because estimating σ adds uncertainty. The interval is 52 ± 2.131 × 2 = (47.74, 56.26) and t = 1.0 gives a p-value of 0.333. Finally, the sample size needed for a margin of error of 2 at 95% confidence with σ = 16 is n = (1.96 × 16/2)² = 245.9, which is rounded up to 246: rounding down would leave the margin above 2.

The z case against the t case (mean 52, null value 50)
Itemz, n = 64, σ = 16 knownt, n = 16, s = 8
Standard error22
Critical value (5%, two-sided)1.962.131 (15 d.f.)
95% interval(48.08, 55.92)(47.74, 56.26)
Test statisticz = 1.0t = 1.0
p-value0.3170.333
DecisionDo not rejectDo not reject
From a sample mean to a decision
  1. Standard error σ/√n16/8 = 2
  2. 95% interval: mean ± 1.96 × SE(48.08, 55.92)
  3. Test statistic z(52 − 50)/2 = 1.0
  4. |z| < 1.96: do not reject50 lies inside the interval
With n = 64, mean 52 and σ = 16, testing μ = 50.

A sample of n = 64 has mean 52, and the population standard deviation is σ = 16. The standard error of the mean is σ/√n = 16/8 = 2. By the central limit theorem the sample mean is…

4. Ordinary least squares by hand: slope, intercept, R-squared and the t-test

2 min read · 2 parts

Five observations: X = 1, 2, 3, 4, 5 and Y = 3, 5, 4, 7, 8. The means are X̄ = 3 and Ȳ = 5.4. Then Sxx = Σ(X − X̄)² = 4 + 1 + 0 + 1 + 4 = 10, Sxy = Σ(X − X̄)(Y − Ȳ) = (−2)(−2.4) + (−1)(−0.4) + 0 + (1)(1.6) + (2)(2.6) = 4.8 + 0.4 + 1.6 + 5.2 = 12, and Syy = 17.2. The OLS slope is b = Sxy/Sxx = 1.2 and the intercept is a = Ȳ − bX̄ = 5.4 − 3.6 = 1.8, so the fitted line is Ŷ = 1.8 + 1.2X. The fitted values are 3.0, 4.2, 5.4, 6.6, 7.8 and the residuals are 0, 0.8, −1.4, 0.4, 0.2, which sum to zero as OLS residuals must when there is an intercept.

The residual sum of squares is 0 + 0.64 + 1.96 + 0.16 + 0.04 = 2.8, so R² = 1 − 2.8/17.2 = 0.837: the line explains about 84% of the variation in Y. The standard error of the slope is √[(RSS/(n − 2))/Sxx] = √[(2.8/3)/10] = √0.0933 = 0.3055, so t = 1.2/0.3055 = 3.93. With n − 2 = 3 degrees of freedom the 5% critical value is 3.182, and 3.93 exceeds it, so the slope is significant. A simple regression's R² equals the square of the correlation, 0.915² = 0.837. A forecast at X = 6 is 1.8 + 1.2 × 6 = 9.0, an extrapolation beyond the data and therefore less reliable than an interpolation.

OLS results for the five-point data set
QuantityValue
Slope b1.2
Intercept a1.8
Residual sum of squares2.8
R²0.837
Standard error of b0.3055
t-statistic for b3.93 (critical 3.182 at 3 d.f.)
Forecast at X = 69.0
⚠️ The trap: degrees of freedom and R-squared
The residual variance divides by n − k, here n − 2, because two parameters were estimated; dividing by n understates the standard error and inflates t. And a high R² says nothing about causation, about whether the slope is significant in a sample this small, or about whether the model is right.

Five observations: X = 1, 2, 3, 4, 5 and Y = 3, 5, 4, 7, 8. The means are X̄ = 3 and Ȳ = 5.4. Then Sxx = Σ(X − X̄)² = 4 + 1 + 0 + 1 + 4 = 10, Sxy = Σ(X − X̄)(Y − Ȳ) = (−2)(−2.4) +…

5. Index numbers: Laspeyres, Paasche and Fisher

1 min read · 1 part

Three goods have base-year prices 10, 20 and 5 with quantities 4, 2 and 10, and current-year prices 12, 25 and 6 with quantities 5, 3 and 6. The Laspeyres price index weights by base-year quantities: Σp1q0/Σp0q0 × 100 = (12 × 4 + 25 × 2 + 6 × 10)/(10 × 4 + 20 × 2 + 5 × 10) × 100 = 158/130 × 100 = 121.54. The Paasche index weights by current-year quantities: Σp1q1/Σp0q1 × 100 = (60 + 75 + 36)/(50 + 60 + 30) × 100 = 171/140 × 100 = 122.14. Fisher's ideal index is their geometric mean, √(121.54 × 122.14) = 121.84.

Here Paasche is above Laspeyres only because consumers moved toward the goods whose prices rose most in relative terms; ordinarily buyers substitute away from dearer goods, so Laspeyres tends to overstate the rise in the cost of living and Paasche to understate it, and the Fisher index lies between them. The Fisher index also passes the time-reversal test (swap the two years and the index becomes the reciprocal) and the factor-reversal test, which is why it is called ideal. Neither Laspeyres nor Paasche passes the time-reversal test.

The three price indices for the same data
IndexFormulaValue
LaspeyresΣp1q0 / Σp0q0 × 100121.54
PaascheΣp1q1 / Σp0q1 × 100122.14
Fisher√(Laspeyres × Paasche)121.84

Three goods have base-year prices 10, 20 and 5 with quantities 4, 2 and 10, and current-year prices 12, 25 and 6 with quantities 5, 3 and 6. The Laspeyres price index weights by base-year…

Key takeaways

  • Sample variance divides the sum of squared deviations by n − 1: for 12, 15, 11, 18, 14, 15, 20, 15, 9, 16 the mean is 14.5, the sum of squares 94.5, the sample variance 10.5 and the coefficient of variation 22.3%.
  • Bayes' theorem shows why a positive result from an accurate test for a rare condition is usually a false alarm: with 1% prevalence, 95% sensitivity and 5% false positives, P(sick | positive) = 0.161.
  • The standard error is σ/√n; with σ = 16 and n = 64 it is 2, the 95% interval for a mean of 52 is (48.08, 55.92), and replacing σ by an estimate means using t, whose critical value (2.131 at 15 d.f.) is larger than 1.96.
  • OLS slope is Sxy/Sxx and the intercept is Ȳ − bX̄; for the five-point data b = 1.2, a = 1.8, R² = 0.837, the slope's standard error is 0.3055 and t = 3.93, which exceeds the 3.182 critical value at 3 d.f.
  • Laspeyres uses base-year quantities and tends to overstate price rises, Paasche uses current-year quantities and tends to understate them, and the Fisher index, their geometric mean, passes the time-reversal test.

Practice questions (24)

Attempt each one before opening the answer. Every explanation names the tempting wrong option as well as the right one, because that is where marks are lost.

  1. For the data 12, 15, 11, 18, 14, 15, 20, 15, 9, 16, the median and the mode are:

    1. 14.5 and 15
    2. 15 and 15
    3. 15 and 14.5
    4. 14 and 15
    Show answer

    Answer: B — 15 and 15

    Sorted, the fifth and sixth values are both 15, so the median is 15; 15 appears three times, so it is also the mode. The mean, not the median, is 14.5.
  2. The sum of squared deviations for that data is 94.5. The sample standard deviation is approximately:

    1. 3.07
    2. 9.45
    3. 3.24
    4. 10.5
    Show answer

    Answer: C — 3.24

    The sample variance is 94.5/9 = 10.5 and its square root is 3.24. The value 3.07 divides by n = 10 (population version), and 10.5 is the variance, not the standard deviation.
  3. A disease has 1% prevalence; a test has 95% sensitivity and a 5% false-positive rate. The probability that a person who tests positive is sick is about:

    1. 95%
    2. 50%
    3. 5%
    4. 16%
    Show answer

    Answer: D — 16%

    Bayes' theorem gives 0.0095/(0.0095 + 0.0495) = 0.161. The 95% is the reverse conditional probability, P(positive | sick), which is the common confusion.
Show the other 21 questions
  1. For a binomial with n = 5 and p = 0.3, P(X = 2) equals:

    1. 0.3087
    2. 0.09
    3. 0.3
    4. 0.5
    Show answer

    Answer: A — 0.3087

    C(5, 2) × 0.3² × 0.7³ = 10 × 0.09 × 0.343 = 0.3087. The value 0.09 forgets both the coefficient and the failures' probability.
  2. If X ~ N(50, 10²), P(40 < X < 65) is approximately:

    1. 0.6827
    2. 0.7745
    3. 0.9332
    4. 0.8413
    Show answer

    Answer: B — 0.7745

    The limits are z = −1 and z = 1.5, so the probability is 0.9332 − 0.1587 = 0.7745. The 0.6827 is the symmetric ±1 SD case.
  3. A sample of 64 has mean 52 and σ = 16 is known. The 95% confidence interval for the population mean is:

    1. (36.00, 68.00)
    2. (50.00, 54.00)
    3. (48.08, 55.92)
    4. (49.04, 54.96)
    Show answer

    Answer: C — (48.08, 55.92)

    SE = 16/8 = 2, and 1.96 × 2 = 3.92, so the interval is 52 ± 3.92. The wide (36, 68) uses σ itself in place of the standard error.
  4. In that sample, the test of H0: μ = 50 against H1: μ ≠ 50 at the 5% level:

    1. Rejects H0, since z = 2.0
    2. Rejects H0, since z = 1.0 exceeds 0.05
    3. Cannot be done without the sample median
    4. Does not reject H0, since z = 1.0
    Show answer

    Answer: D — Does not reject H0, since z = 1.0

    z = (52 − 50)/2 = 1.0, below 1.96. The z = 2.0 option forgets to divide by the standard error. Comparing z with 0.05 mixes up a test statistic with a significance level.
  5. For X = 1…5 and Y = 3, 5, 4, 7, 8 the OLS fitted line is:

    1. Y = 1.8 + 1.2X
    2. Y = 1.2 + 1.8X
    3. Y = 5.4 + 0.2X
    4. Y = 3 + 1.2X
    Show answer

    Answer: A — Y = 1.8 + 1.2X

    b = Sxy/Sxx = 12/10 = 1.2 and a = 5.4 − 1.2 × 3 = 1.8. The line Y = 1.2 + 1.8X swaps slope and intercept.
  6. The R² of that regression is approximately:

    1. 0.915
    2. 0.837
    3. 0.163
    4. 1.2
    Show answer

    Answer: B — 0.837

    R² = 1 − RSS/TSS = 1 − 2.8/17.2 = 0.837. The value 0.915 is the correlation coefficient r, the square root of R².
  7. With base-year prices 10, 20, 5 and quantities 4, 2, 10, and current prices 12, 25, 6, the Laspeyres price index is approximately:

    1. 158.0
    2. 130.0
    3. 121.5
    4. 114.3
    Show answer

    Answer: C — 121.5

    Σp1q0 = 48 + 50 + 60 = 158 and Σp0q0 = 40 + 40 + 50 = 130, so the index is 158/130 × 100 = 121.5. The numbers 158 and 130 are the numerator and denominator.
  8. The arithmetic mean of 4, 8, 10, 14 and 24 is:

    1. 10
    2. 14
    3. 12
    4. 60
    Show answer

    Answer: C — 12

    Mean = (4 + 8 + 10 + 14 + 24)/5 = 60/5 = 12. 10 is the median (the middle value), which candidates give when the series is skewed by one large value; 60 is the sum before dividing.
  9. A distribution has mean 50 and standard deviation 10. Its coefficient of variation is:

    1. 2 per cent
    2. 20 per cent
    3. 500 per cent
    4. 5 per cent
    Show answer

    Answer: B — 20 per cent

    CV = (σ/mean) × 100 = 10/50 × 100 = 20 per cent; it is unit-free, so it compares variability across series with different means. Inverting the ratio (mean/σ = 5) is the tempting slip.
  10. In a village, 40 per cent of households are landless. Of the landless households 60 per cent are below the poverty line, and of the landed households 20 per cent are. The probability that a randomly chosen household is below the poverty line is:

    1. 0.40
    2. 0.36
    3. 0.24
    4. 0.80
    Show answer

    Answer: B — 0.36

    Total probability: 0.4 × 0.6 + 0.6 × 0.2 = 0.24 + 0.12 = 0.36. Averaging 60 and 20 per cent (0.40) ignores the unequal group sizes, 0.24 counts only the landless poor, and 0.80 simply adds the two conditional rates.
  11. An export consignment is delayed at the port with probability 0.3 and at customs with probability 0.2, independently. The probability that it faces no delay at either point is:

    1. 0.56
    2. 0.50
    3. 0.06
    4. 0.44
    Show answer

    Answer: A — 0.56

    For independent events P(no delay at both) = (1 − 0.3)(1 − 0.2) = 0.7 × 0.8 = 0.56. Subtracting the sum of the two probabilities from one (0.50) wrongly treats the delays as mutually exclusive, 0.06 is the chance of delay at both, and 0.44 is the chance of at least one delay.
  12. Monthly household expenditure in a district has a standard deviation of ₹1,200. A random survey of 144 households estimates mean expenditure. The standard error of that estimate is:

    1. ₹1,200
    2. ₹10,000
    3. ₹8.33
    4. ₹100
    Show answer

    Answer: D — ₹100

    SE = σ/√n = 1,200/√144 = 1,200/12 = ₹100. Dividing by n instead of √n gives ₹8.33, ₹1,200 is the population standard deviation itself, and ₹10,000 is σ²/n — variance logic with standard-deviation units.
  13. In a simple linear regression of Y on X, the correlation coefficient between X and Y is 0.8. The coefficient of determination is:

    1. 0.8
    2. 0.64
    3. 0.36
    4. 0.89
    Show answer

    Answer: B — 0.64

    In simple regression R² = r² = 0.64, so X explains 64 per cent of the variation in Y. 0.8 is r itself, 0.89 is √0.8, and 0.36 = 1 − r² is the unexplained share.
  14. Base-year prices of three goods are 10, 20 and 5; current prices are 12, 25 and 6; current-year quantities are 2, 4 and 10. The Paasche price index is about:

    1. 122.7
    2. 118.4
    3. 81.5
    4. 184.0
    Show answer

    Answer: A — 122.7

    Paasche = Σp1q1/Σp0q1 × 100 = (24 + 100 + 60)/(20 + 80 + 50) × 100 = 184/150 × 100 ≈ 122.7, weighting by current quantities. 81.5 inverts the ratio, and 184 is the current-year expenditure, not an index. Laspeyres would use base-year quantities instead.
  15. An exporter finds that 10 per cent of consignments are rejected, independently of one another. For a lot of 50 consignments, the mean and variance of the number rejected are:

    1. 45 and 4.5
    2. 5 and 2.12
    3. 5 and 0.5
    4. 5 and 4.5
    Show answer

    Answer: D — 5 and 4.5

    The count is binomial: mean = np = 50 × 0.1 = 5 and variance = np(1 − p) = 5 × 0.9 = 4.5. 2.12 is the standard deviation (√4.5), not the variance; 0.5 multiplies by p again instead of (1 − p); 45 is the mean number accepted.
  16. For a sample, Cov(X, Y) = 12, Var(X) = 4, mean of X = 5 and mean of Y = 20. The OLS regression of Y on X is:

    1. Ŷ = 35 + 3X
    2. Ŷ = 18.33 + 0.33X
    3. Ŷ = 5 + 3X
    4. Ŷ = 20 + 3X
    Show answer

    Answer: C — Ŷ = 5 + 3X

    b = Cov(X, Y)/Var(X) = 12/4 = 3 and a = Ȳ − bX̄ = 20 − 15 = 5. Using the mean of Y as the intercept ignores the slope adjustment, and 0.33 is Var/Cov, the inverted slope; 35 adds bX̄ instead of subtracting it.
  17. Arrivals at a counter follow a Poisson distribution with a mean of 2 per minute. The probability of no arrival in a given minute is about:

    1. 0.135
    2. 0
    3. 0.271
    4. 0.5
    Show answer

    Answer: A — 0.135

    P(X = 0) = e^(−λ)λ⁰/0! = e^(−2) ≈ 0.135. 0.271 is P(X = 1) = 2e^(−2), the adjacent term candidates pick, and 0.5 = 1/λ confuses the Poisson with the mean waiting time.
  18. To estimate a population mean within ±3 at 95 per cent confidence when σ = 15, the minimum sample size is:

    1. 25
    2. 10
    3. 96
    4. 97
    Show answer

    Answer: D — 97

    n = (zσ/E)² = (1.96 × 15/3)² = 9.8² = 96.04, rounded up to 97 because a sample of 96 would leave the margin slightly above 3. Rounding down to 96 is the usual slip, 10 is zσ/E before squaring, and 25 uses (σ/E)² without z.
  19. Eight states are ranked by per-capita income and by literacy rate, and the sum of squared rank differences is Σd² = 21. Spearman's rank correlation coefficient is:

    1. 0.25
    2. 0.96
    3. 0.75
    4. −0.75
    Show answer

    Answer: C — 0.75

    rs = 1 − 6Σd²/[n(n² − 1)] = 1 − 126/(8 × 63) = 1 − 126/504 = 0.75. 0.25 stops at the fraction without subtracting it from one, 0.96 drops the 6 from the numerator (1 − 21/504), and a negative value would need the two rankings to run in opposite directions.
  20. A regression with 4 explanatory variables (plus an intercept) estimated on 25 observations has R² = 0.80. The adjusted R² is:

    1. 0.80
    2. 0.84
    3. 0.77
    4. 0.76
    Show answer

    Answer: D — 0.76

    Adjusted R² = 1 − (1 − R²)(n − 1)/(n − k − 1) = 1 − 0.2 × 24/20 = 1 − 0.24 = 0.76; it penalises extra regressors, so it is below R². 0.84 adds the penalty in the wrong direction, and 0.77 uses n − k = 21 in the denominator instead of n − k − 1 = 20.
  21. Given below are two statements. Statement I: With the sample size fixed, lowering the significance level α of a test raises the probability of a Type II error. Statement II: The power of a test equals 1 − α. In the light of the above statements, choose the correct answer:

    1. Statement I is false but Statement II is true
    2. Both Statement I and Statement II are false
    3. Both Statement I and Statement II are true
    4. Statement I is true but Statement II is false
    Show answer

    Answer: D — Statement I is true but Statement II is false

    A stricter α widens the acceptance region, so a false null is accepted more often: β rises. Power is 1 − β, the probability of rejecting a false null, not 1 − α (which is the probability of correctly accepting a true null). Confusing the two error probabilities produces the "both true" choice.