অর্থনীতি · বই 3 · স্নাতক প্রথম বর্ষ

University Economics — Year 1

এই বইটি এখনো বাংলা ভাষায় পাওয়া যায় না। সংস্করণ: English।

University Economics — Year 1 · স্নাতক প্রথম বর্ষ

31Sampling and Inference

The US unemployment rate is estimated each month from a survey of about 60,000 households. At a rate of around 6%6\%, the statistical office gives a 90%90\% confidence interval of about ±0.3\pm 0.3 point for the change from one month to the next. A rise of 0.10.1 point, reported as news, cannot be told apart from the noise of drawing a different sample. This chapter is about what one sample can say about a population: estimators and their errors, confidence intervals, tests, and how surveys are designed and weighted.

Unemployment rate, ages 15–74, per cent of the labour force, quarterly, 2010–2026: seasonally adjusted (thin) and trend-cycle (thick), Germany (left) and Estonia (right).
Unemployment rate, ages 15–74, per cent of the labour force, quarterly, 2010–2026: seasonally adjusted (thin) and trend-cycle (thick), Germany (left) and Estonia (right). Source: Eurostat, une_rt_q

Both series are survey estimates. Germany’s seasonally adjusted rate stays within a standard deviation of 0.070.07 point of its trend; Estonia’s jumps around it with a standard deviation of 0.510.51 point, and moves by 0.720.72 point from one quarter to the next on average, against 0.130.13 in Germany. Part of the gap is that Estonia’s labour market moves more; part is that the survey of a small country samples far fewer people, and its estimates are noisier.

You already know

Sampling distributions, the normal and Student’s tt laws and the central limit theorem are Chapter 30; conditional means are Chapter 29. The unemployment survey and its definitions were met at school.

31.1 Population and sample

Definition 31.1 (Population parameter)

A population, in statistics, is the set of units about which a question is asked; a population parameter is a number that describes it, such as its mean μ\mu or its unemployment rate. It is fixed and unknown. (A model’s parameters, Chapter 1, are a different use of the word.)

Definition 31.2 (Estimator, unbiased, consistent)

An estimator is a rule that turns a sample into a guess of a parameter θ\theta; the number it gives in one sample is an estimate. An estimator θ^n\hat\theta_n is unbiased when E[θ^n]=θ\E[\hat\theta_n] = \theta, and consistent when, for every ε>0\varepsilon > 0, P(∣θ^n−θ∣>ε)→0P(|\hat\theta_n - \theta| > \varepsilon) \to 0 as the sample size nn grows.

31.2 Estimators: bias, variance, consistency

Proposition 31.3 (The sample mean)

For independent draws with mean μ\mu and variance σ2\sigma^2, the sample mean Xˉn\bar X_n is unbiased and consistent for μ\mu.

Proof. E[Xˉn]=1n∑iE[Xi]=μ\E[\bar X_n] = \frac1n\sum_i \E[X_i] = \mu. Its variance is σ2/n\sigma^2/n (Chapter 30), so by Chebyshev’s inequality P(∣Xˉn−μ∣>ε)≤σ2/(nε2)→0P(|\bar X_n - \mu| > \varepsilon) \le \sigma^2/(n\varepsilon^2) \to 0. ∎

Proposition 31.4 (Dividing by n−1n - 1)

s2=1n−1∑i(Xi−Xˉ)2s^2 = \frac1{n-1}\sum_i (X_i - \bar X)^2 is an unbiased estimator of σ2\sigma^2.

Proof. ∑i(Xi−Xˉ)2=∑i(Xi−μ)2−n(Xˉ−μ)2\sum_i (X_i - \bar X)^2 = \sum_i (X_i - \mu)^2 - n(\bar X - \mu)^2. Taking expectations, nσ2−n⋅σ2/n=(n−1)σ2n\sigma^2 - n \cdot \sigma^2/n = (n - 1)\sigma^2. ∎

"""Dividing by n or by n - 1: the average of the sample variance, n = 5."""

import numpy as np
from econdata import nsw

y = nsw("psid_controls").re78.to_numpy()
rng = np.random.default_rng(2026)
samples = rng.choice(y, size=(200_000, 5))
print(f"population variance       {y.var() / 1e6:7.1f} million")
for ddof in (0, 1):
    v = samples.var(axis=1, ddof=ddof).mean()
    print(f"average, divided by n - {ddof} {v / 1e6:7.1f} million")
Listing 31.1. Dividing by nn or by n−1n - 1, with samples of 5. code/bachelor-1/31-sampling-and-inference/listings/sample_variance.py
$ python sample_variance.py
population variance         241.9 million
average, divided by n - 0   194.4 million
average, divided by n - 1   243.0 million
Output 31.1. Dividing by nn underestimates by the factor 4/54/5.

Definition 31.5 (Mean squared error)

The mean squared error of an estimator is E[(θ^−θ)2]=bias2+Var⁡(θ^)\E[(\hat\theta - \theta)^2] = \text{bias}^2 + \Var(\hat\theta).

"""Two estimators of mean earnings from samples of 10: bias, variance, MSE."""

import numpy as np
from econdata import nsw

y = nsw("psid_controls").re78.to_numpy()
mu = y.mean()
rng = np.random.default_rng(2026)
samples = rng.choice(y, size=(20_000, 10))
estimators = {
    "sample mean": samples.mean(axis=1),
    "0.8 x mean": 0.8 * samples.mean(axis=1),
}
print(f"population mean {mu:,.0f}")
for name, est in estimators.items():
    bias, var = est.mean() - mu, est.var()
    print(
        f"{name:12s} bias {bias:7,.0f}  sd {np.sqrt(var):6,.0f}"
        f"  root MSE {np.sqrt(bias**2 + var):6,.0f}"
    )
Listing 31.2. An unbiased estimator and a shrunk one. code/bachelor-1/31-sampling-and-inference/listings/bias_variance.py
$ python bias_variance.py
population mean 21,554
sample mean  bias      18  sd  4,917  root MSE  4,917
0.8 x mean   bias  -4,297  sd  3,934  root MSE  5,825
Output 31.2. Shrinking cuts the spread by a fifth but adds a bias of 4,297 dollars (of 1982, the unit of all the earnings in this chapter).

Shrinking the mean towards zero trades bias for variance. Here the trade is bad — the root mean squared error rises from 4,917 to 5,825 dollars — because the mean is far from zero; for a parameter close to the point of shrinkage, it can be good. Several estimators of the later volumes make this trade on purpose.

31.3 The standard error and confidence intervals

Definition 31.6 (Standard error)

The standard error of an estimator is the standard deviation of its sampling distribution; for the sample mean it is σ/n\sigma/\sqrt n, estimated by se^=s/n\widehat{\mathrm{se}} = s/\sqrt n.

Definition 31.7 (Confidence interval)

A confidence interval at level 1−α1 - \alpha is an interval computed from the sample that contains the parameter in a share 1−α1 - \alpha of repeated samples. For a mean, xˉ±tn−1, 1−α/2 se^\bar x \pm t_{n-1,\,1-\alpha/2}\,\widehat{\mathrm{se}}, with tn−1, 1−α/2t_{n-1,\,1-\alpha/2} close to 1.961.96 for α=0.05\alpha = 0.05 and large nn.

The level describes the procedure, not one interval: once computed, an interval contains the parameter or it does not.

"""Mean 1978 earnings of the experiment's control group, with a 95% interval."""

import numpy as np
from econdata import nsw
from scipy import stats

y = nsw("nsw_dw").query("treat == 0").re78
n, mean, s = len(y), y.mean(), y.std()  # pandas divides by n - 1
se = s / np.sqrt(n)
c = stats.t.ppf(0.975, n - 1)
print(f"n {n}, mean {mean:,.0f}, s {s:,.0f}, standard error {se:,.0f}")
print(
    f"95% interval: {mean - c * se:,.0f} to {mean + c * se:,.0f} (t quantile {c:.3f})"
)
Listing 31.3. Mean earnings of the control group, with a 95% interval. code/bachelor-1/31-sampling-and-inference/listings/interval.py
$ python interval.py
n 260, mean 4,555, s 5,484, standard error 340
95% interval: 3,885 to 5,224 (t quantile 1.969)
Output 31.3. From 3,885 to 5,224 dollars.
"""100 samples of 30 men, a 95% interval from each: how many miss the truth?"""

import numpy as np
from econdata import nsw
from scipy import stats


def intervals(reps=100, n=30, seed=2026):
    y = nsw("psid_controls").re78.to_numpy()
    rng = np.random.default_rng(seed)
    s = rng.choice(y, size=(reps, n))
    half = stats.t.ppf(0.975, n - 1) * s.std(axis=1, ddof=1) / np.sqrt(n)
    lo, hi = s.mean(axis=1) - half, s.mean(axis=1) + half
    return lo, hi, y.mean()


if __name__ == "__main__":
    lo, hi, mu = intervals()
    miss = (lo > mu) | (hi < mu)
    print(f"true mean {mu:,.0f}; intervals that miss it: {miss.sum()} of 100")
    print(
        "first misses:",
        [f"{a:,.0f}-{b:,.0f}" for a, b in zip(lo[miss][:3], hi[miss][:3])],
    )
Listing 31.4. One hundred intervals from one hundred samples of 30 men. code/bachelor-1/31-sampling-and-inference/listings/coverage.py
$ python coverage.py
true mean 21,554; intervals that miss it: 10 of 100
first misses: ['11,767-20,207', '12,052-20,867', '22,399-34,092']
Output 31.4. Ten of the hundred miss.
One hundred 95\% intervals for mean earnings, each from 30 men drawn from the PSID sample; the population mean is dashed. The ten in red miss it.
One hundred 95%95\% intervals for mean earnings, each from 30 men drawn from the PSID sample; the population mean is dashed. The ten in red miss it.

Ten misses in a hundred is more than five, but one hundred intervals are a small sample of intervals: over 20,000 of them, 94.3%94.3\% contain the mean.

The shortfall from 95%95\% is real and comes from the skewness of earnings: with 30 draws, the tt interval is only approximately right.

31.4 Tests

Definition 31.8 (Null hypothesis, alternative, test statistic)

A test confronts a null hypothesis H0H_0 (say, μ1−μ0=0\mu_1 - \mu_0 = 0) with an alternative hypothesis H1H_1 (say, μ1−μ0≠0\mu_1 - \mu_0 \ne 0). A test statistic is a function of the sample whose distribution under H0H_0 is known, at least approximately, such as t=(xˉ1−xˉ0)/se^t = (\bar x_1 - \bar x_0)/\widehat{\mathrm{se}}.

Definition 31.9 (Significance level, pp-value)

A test rejects H0H_0 when the statistic falls in a rejection region. The significance level, or size, is the probability of rejecting H0H_0 when it is true. The pp-value is the probability, computed under H0H_0, of a statistic at least as extreme as the one observed; a test at level α\alpha rejects when p<αp < \alpha.

A two-sided test at 5\%: the rejection regions beyond ± 1.96 (shaded), and the job-training experiment’s statistic.
A two-sided test at 5%5\%: the rejection regions beyond ±1.96\pm 1.96 (shaded), and the job-training experiment’s statistic.

On the record — What a pp-value is not

In 2016 the American Statistical Association published six principles on pp-values (Wasserstein and Lazar 2016). Two of them: a pp-value does not measure the probability that the studied hypothesis is true, or the probability that the data were produced by random chance alone; and it does not measure the size of an effect or the importance of a result. A pp-value of 0.0080.008 says that data this far from H0H_0 would be rare if H0H_0 held — not that H0H_0 has a 0.8%0.8\% chance of being true.

Model — The randomised comparison

Assumes. People are assigned to a programme or to a control group at random, and one person’s assignment does not affect another’s outcome.

Predicts. The difference in mean outcomes estimates the programme’s average effect without bias, with the standard error of a difference of two means.

Tested. Two checks of the job-training experiment. Earnings before the programme, which assignment cannot have changed, are close in the two groups (p=0.98p = 0.98 in 1974 and 0.390.39 in 1975, Output 31.5), as random assignment predicts. And LaLonde (1986) used the experimental estimate as a benchmark that many non-experimental procedures failed to reproduce (record below).

Breaks. People who leave the study before the outcome is measured, in a way related to the treatment; samples so small that the interval is too wide to say anything; and effects that do not carry over to other people, places or scales, which the second university year takes up under causality and experiments.

"""The experiment's estimate: treated against controls, 1978 earnings."""

import numpy as np
from econdata import nsw
from scipy import stats

d = nsw("nsw_dw")
t1, t0 = d.re78[d.treat == 1], d.re78[d.treat == 0]
diff = t1.mean() - t0.mean()
se = np.sqrt(t1.var() / len(t1) + t0.var() / len(t0))
t = diff / se
p_normal = 2 * stats.norm.sf(abs(t))
print(f"treated {len(t1)}, mean {t1.mean():,.0f}", end="; ")
print(f"controls {len(t0)}, mean {t0.mean():,.0f}")
print(f"difference {diff:,.1f}, standard error {se:,.1f}, t {t:.3f}")
print(f"p-value (normal) {p_normal:.4f}")
r = stats.ttest_ind(t1, t0, equal_var=False)
print(f"scipy (Welch):   t {r.statistic:.3f}, p-value {r.pvalue:.4f}")
print(f"95% interval: {diff - 1.96 * se:,.0f} to {diff + 1.96 * se:,.0f}")
for v in ("re74", "re75"):  # a check of the random assignment: earnings before
    a1, a0 = d[v][d.treat == 1], d[v][d.treat == 0]
    b = stats.ttest_ind(a1, a0, equal_var=False)
    print(f"{v}: treated {a1.mean():,.0f}, controls {a0.mean():,.0f}, p {b.pvalue:.2f}")
Listing 31.5. The experiment’s estimate, its standard error, tt and pp-value, and the earnings of the two groups before the programme. code/bachelor-1/31-sampling-and-inference/listings/nsw_effect.py
$ python nsw_effect.py
treated 185, mean 6,349; controls 260, mean 4,555
difference 1,794.3, standard error 671.0, t 2.674
p-value (normal) 0.0075
scipy (Welch):   t 2.674, p-value 0.0079
95% interval: 479 to 3,109
re74: treated 2,096, controls 2,107, p 0.98
re75: treated 1,532, controls 1,267, p 0.39
Output 31.5. A difference of 1,794 dollars, t=2.67t = 2.67, p=0.008p = 0.008; before the programme, no difference.

The standard error of a difference of two independent means is s12/n1+s02/n0\sqrt{s_1^2/n_1 + s_0^2/n_0}, with s1s_1 and s0s_0 the standard deviations and n1n_1 and n0n_0 the sizes of the two groups. It lets each group keep its own variance, and the test built on it is Welch’s test. The pooled form, which assumes one common variance, would be wrong here: the treated men’s earnings in 1978 have a standard deviation of 7,867 dollars, the controls’ 5,484. The listing gives two pp-values for the same tt. The first uses the normal distribution, as the interval does with its 1.961.96; Welch’s uses a Student tt with a degrees-of-freedom correction. With groups of 185 and 260 they agree: 0.00750.0075 and 0.00790.0079.

On the record — The job-training experiment

A job-training programme in the United States assigned applicants at random to training or to a control group. The experiment gives an estimate that needs no model of who chooses to train. LaLonde (1986) replaced the experimental controls by comparison samples from two large surveys — the PSID and CPS samples of Chapter 29 — and found that many of the econometric procedures in use did not reproduce the experimental result. Dehejia and Wahba (1999) re-examined the samples with other methods.

The lesson: who is compared with whom matters more than the formula.

Definition 31.10 (Power of a test)

The power of a test against an alternative is the probability that it rejects H0H_0 when that alternative is true.

"""Power to detect a 1,000-dollar effect with the experiment's sample sizes."""

import numpy as np
from econdata import nsw
from scipy import stats

d = nsw("nsw_dw")
y0 = d.re78[d.treat == 0].to_numpy()
n1, n0, effect = 185, 260, 1_000
se = np.sqrt(y0.var(ddof=1) * (1 / n1 + 1 / n0))  # one sd for both groups
power = stats.norm.sf(1.96 - effect / se) + stats.norm.cdf(-1.96 - effect / se)
print(f"standard error {se:,.0f}; power by the formula {power:.3f}")
rng = np.random.default_rng(2026)
reject = 0
for _ in range(4_000):  # draws from the control earnings, shifted by the effect
    a, b = rng.choice(y0, n1) + effect, rng.choice(y0, n0)
    reject += stats.ttest_ind(a, b, equal_var=False).pvalue < 0.05
print(f"power by simulation {reject / 4_000:.3f}")
Listing 31.6. Power to detect an effect of 1,000 dollars with the experiment’s group sizes. code/bachelor-1/31-sampling-and-inference/listings/power.py
$ python power.py
standard error 527; power by the formula 0.474
power by simulation 0.482
Output 31.6. Less than one chance in two.
Power of a two-sided 5\% test of a difference in mean earnings, with the control group’s standard deviation and two equal groups, for 100, 445 (the experiment’s size) and 2,000 people: an effect of 1,000 dollars is detected with probability 0.15, 0.49 and 0.98.
Power of a two-sided 5%5\% test of a difference in mean earnings, with the control group’s standard deviation and two equal groups, for 100, 445 (the experiment’s size) and 2,000 people: an effect of 1,000 dollars is detected with probability 0.150.15, 0.490.49 and 0.980.98.

31.5 Many tests at once

Definition 31.11 (Family-wise error rate)

The family-wise error rate of a set of tests is the probability that at least one of them rejects a true null hypothesis. Testing each of mm hypotheses at level α/m\alpha/m (the Bonferroni correction) keeps it at most α\alpha.

The bound follows from P(A1∪⋯∪Am)≤∑jP(Aj)=m⋅α/mP(A_1 \cup \dots \cup A_m) \le \sum_j P(A_j) = m \cdot \alpha/m. With 20 independent tests at 5%5\% and every null true, the chance of at least one rejection is 1−0.9520=64%1 - 0.95^{20} = 64\%.

"""Twenty placebo tests: random halves of the PSID sample compared."""

import numpy as np
from econdata import nsw
from scipy import stats

y = nsw("psid_controls").re78.to_numpy()
rng = np.random.default_rng(7)
p = []
for _ in range(20):
    mask = rng.permutation(len(y)) < len(y) // 2  # a random half, no treatment at all
    p.append(stats.ttest_ind(y[mask], y[~mask], equal_var=False).pvalue)
p = np.array(p)
print("smallest p-values:", np.round(np.sort(p)[:3], 4))
print(f"rejections at 5%: {(p < 0.05).sum()} of 20; expected 1")
print(f"Bonferroni threshold 0.05/20 = {0.05 / 20}; rejections: {(p < 0.0025).sum()}")
Listing 31.7. Twenty tests where nothing is there. code/bachelor-1/31-sampling-and-inference/listings/many_tests.py
$ python many_tests.py
smallest p-values: [0.0397 0.0581 0.0795]
rejections at 5%: 1 of 20; expected 1
Bonferroni threshold 0.05/20 = 0.0025; rejections: 0
Output 31.7. One “significant” difference between two random halves of the same men.

The seed, 7, was chosen to show a typical draw, with the one rejection that twenty tests at 5%5\% give on average; of the seeds 0 to 99, 40 give no rejection, 38 one and 22 two or more. A study that runs twenty comparisons and reports the one with p=0.04p = 0.04 has shown nothing. The third university year returns to the search for specifications and how credible work guards against it.

31.6 Survey design and weights

Definition 31.12 (Stratified sample, sampling weight, design effect)

A stratified sample divides the population into groups (strata) and draws a separate random sample in each. A unit’s sampling weight is the inverse of its probability of being drawn: the number of population units it stands for. The design effect is the variance of an estimate under the design divided by its variance under a simple random sample of the same size.

"""A stratified sample of Brenland households: owners over-sampled."""

import numpy as np
import pandas as pd
from country import load

h = load("households")
rng = np.random.default_rng(2026)
take = {1: 150, 0: 150}  # 150 owners and 150 renters
parts = [h[h.owner == k].sample(m, random_state=rng) for k, m in take.items()]
sample = pd.concat(parts)
N = h.owner.value_counts()  # households in each stratum
sample["weight"] = sample.owner.map(N) / sample.owner.map(take)  # 1 / P(drawn)
y, w = sample.disposable, sample.weight
print(f"true mean {h.disposable.mean():,.0f}")
print(f"unweighted {y.mean():,.0f}; weighted {(w * y).sum() / w.sum():,.0f}")
print("weights:", sample.groupby("owner").weight.first().round(2).to_dict())
deff = 1 + (w.std(ddof=0) / w.mean()) ** 2  # Kish's design effect of weighting
print(f"design effect {deff:.3f}; effective sample size {len(sample) / deff:.0f}")
Listing 31.8. Owners over-sampled, then weighted back. code/bachelor-1/31-sampling-and-inference/listings/weights.py
$ python weights.py
true mean 24,920
unweighted 26,475; weighted 24,822
weights: {0: 9.12, 1: 4.21}
design effect 1.135; effective sample size 264
Output 31.8. Unweighted, the sample overstates income by 1,555 dalens; weighted, it is 98 dalens off.

Owners are a third of households but half the sample, and they have higher incomes, so the unweighted mean is too high. Unequal weights cost precision: the design effect of 1.1351.135 makes 300 households worth 264 drawn at random. (The formula 1+CV21 + \mathrm{CV}^2 of the weights is Kish’s approximation for weighting alone; stratification itself usually lowers the variance.)

How it is measured — The monthly unemployment survey

A labour-force survey asks a sample of households about each member’s work and job search in a reference week, and classifies each person as employed, unemployed or out of the labour force. The rate is the weighted number of unemployed divided by the weighted labour force. A 90%90\% interval spans about 1.61.6 standard errors on each side; for the US monthly change, it is about ±0.3\pm 0.3 point at a rate around 6%6\%. Households stay in the sample for several months, so successive samples overlap, which makes the standard error of a change smaller than that of two independent samples.

"""A monthly survey of 100,000 people in the labour force, true rate 6.0%."""

import numpy as np

rng = np.random.default_rng(2026)
n, rate = 100_000, 0.060
months = rng.binomial(n, rate, size=2) / n  # two independent monthly samples
se = np.sqrt(rate * (1 - rate) / n)
print(
    f"estimates {100 * months[0]:.2f}% and {100 * months[1]:.2f}%; standard error"
    f" {100 * se:.3f} points"
)
change = months[1] - months[0]
se_change = np.sqrt(2) * se  # independent samples; overlapping samples do better
print(
    f"change {100 * change:+.2f} points; its standard error {100 * se_change:.3f};"
    f" 90% margin {100 * 1.645 * se_change:.2f}"
)
Listing 31.9. A simulated monthly survey and the change between two months. code/bachelor-1/31-sampling-and-inference/listings/unemployment_survey.py
$ python unemployment_survey.py
estimates 5.94% and 6.04%; standard error 0.075 points
change +0.10 points; its standard error 0.106; 90% margin 0.17
Output 31.9. A change of 0.100.10 point when nothing changed.

Exercises

Exercise 31.1 ★

A sample of 400 has a standard deviation of 9,000. Find the standard error of its mean.

Solution

Solution of Exercise 31.1.

9,000/400=4509{,}000/\sqrt{400} = 450.

Exercise 31.2 ★

From Output 31.5, give the estimated effect, its standard error and the pp-value of Welch’s test.

Solution

Solution of Exercise 31.2.

1,794.3 dollars, with a standard error of 671.0; Welch’s test gives p=0.0079p = 0.0079.

Exercise 31.3 ★

A test gives p=0.03p = 0.03. Which statement is right? (a) H0H_0 has a 3%3\% chance of being true. (b) The effect is large. (c) If H0H_0 were true, a statistic at least this extreme would occur in 3%3\% of samples. (d) The result has a 97%97\% chance of being replicated.

Solution

Solution of Exercise 31.3.

(c). A pp-value is computed assuming H0H_0, so it is not the probability of H0H_0 (a); it does not measure the size of the effect (b); and it is not a probability of replication (d).

Exercise 31.4 ★

Predict the width of a 95%95\% interval when the sample size is multiplied by 4.

Solution

Solution of Exercise 31.4.

The standard error is divided by 4=2\sqrt4 = 2, so the width halves.

Exercise 31.5 ★★

Find the bias of μ~=1n+1∑i=1nXi\tilde\mu = \frac1{n+1}\sum_{i=1}^n X_i as an estimator of μ\mu. Is it consistent?

Solution

Solution of Exercise 31.5.

E[μ~]=nμ/(n+1)\E[\tilde\mu] = n\mu/(n+1), a bias of −μ/(n+1)-\mu/(n+1). It is consistent: μ~=nn+1Xˉn\tilde\mu = \frac{n}{n+1}\bar X_n, the factor tends to 1 and Xˉn\bar X_n is consistent.

Exercise 31.6 ★★

In two random samples of 400, 120 and 90 people say they are looking for another job. Test at 5%5\% whether the two population shares differ.

Solution

Solution of Exercise 31.6.

p^1=0.300\hat p_1 = 0.300, p^2=0.225\hat p_2 = 0.225, pooled p^=210/800=0.2625\hat p = 210/800 = 0.2625. The standard error under H0H_0 is 0.2625×0.7375×2/400=0.0311\sqrt{0.2625 \times 0.7375 \times 2/400} = 0.0311, so z=0.075/0.0311=2.411z = 0.075/0.0311 = 2.411 and p=0.0159p = 0.0159: the shares differ at 5%5\%.

Exercise 31.7 ★★

With the standard deviations of the experiment’s two groups (7,867 and 5,484 dollars), how many people per group give a power of 80%80\% to detect an effect of 1,000 dollars at 5%5\%, two-sided?

Solution

Solution of Exercise 31.7.

Power 80%80\% at 5%5\% two-sided needs a standard error of 1,000/(1.960+0.842)=1,000/2.8016=3571{,}000/(1.960 + 0.842) = 1{,}000/2.8016 = 357 dollars. With mm people per group, (7,8672+5,4842)/m=357\sqrt{(7{,}867^2 + 5{,}484^2)/m} = 357 gives m=722m = 722: 1,444 people in all, more than three times the experiment’s 445.

Exercise 31.8 ★★

Fifty true null hypotheses are tested at 5%5\%. How many rejections do you expect? What is the Bonferroni threshold?

Solution

Solution of Exercise 31.8.

50×0.05=2.550 \times 0.05 = 2.5 rejections on average; the Bonferroni threshold is 0.05/50=0.0010.05/50 = 0.001.

Exercise 31.9 ★★

A survey over-samples young households, whose income is lower than average. Predict which of the weighted and unweighted mean incomes is closer to the population’s, and why.

Solution

Solution of Exercise 31.9.

The weighted mean: young households are over-represented in the sample, so the unweighted mean is pulled down; the weights give each household the share of the population it stands for.

Exercise 31.10 ★★★

Write out the proof of Proposition 31.4, justifying the decomposition of ∑i(Xi−Xˉ)2\sum_i (X_i - \bar X)^2 and each expectation.

Solution

Solution of Exercise 31.10.

Write Xi−Xˉ=(Xi−μ)−(Xˉ−μ)X_i - \bar X = (X_i - \mu) - (\bar X - \mu). Squaring and summing, the cross term is −2(Xˉ−μ)∑i(Xi−μ)=−2n(Xˉ−μ)2-2(\bar X - \mu)\sum_i (X_i - \mu) = -2n(\bar X - \mu)^2, so ∑i(Xi−Xˉ)2=∑i(Xi−μ)2−n(Xˉ−μ)2\sum_i (X_i - \bar X)^2 = \sum_i (X_i - \mu)^2 - n(\bar X - \mu)^2. Each E[(Xi−μ)2]=σ2\E[(X_i - \mu)^2] = \sigma^2, and E[(Xˉ−μ)2]=Var⁡(Xˉ)=σ2/n\E[(\bar X - \mu)^2] = \Var(\bar X) = \sigma^2/n by independence. The expectation is nσ2−σ2=(n−1)σ2n\sigma^2 - \sigma^2 = (n - 1)\sigma^2; dividing by n−1n - 1 gives σ2\sigma^2.

Exercise 31.11 ★★★

Show that an estimator can be biased and consistent, with an example from this chapter.

Solution

Solution of Exercise 31.11.

The variance divided by nn, σ^2=n−1ns2\hat\sigma^2 = \frac{n-1}{n}s^2, has expectation n−1nσ2\frac{n-1}{n}\sigma^2: biased, as Output 31.1 shows for n=5n = 5. Its bias −σ2/n-\sigma^2/n tends to zero and its variance too (when the fourth moment is finite), so it is consistent. The estimator μ~\tilde\mu of Exercise 31.5 is another example.

31.7 Problem: The Brenland Labour-Force Survey

Problem 31.1

Weekend problem — how big must the survey be?

Brenland (invented) has three regions: the Capital (2.0 million in the labour force, true unemployment rate 5.0%5.0\%), the North (1.5 million, 6.5%6.5\%) and the South (1.0 million, 7.25%7.25\%). Each month the statistical office samples 4,000 people in the labour force of each region, independently from month to month. In month 2 every regional rate rises by 0.20.2 point. A script simulates the two months; its seed, 2028, was chosen to show a typical draw, one whose measured change is within half a standard error of the true one.

Part I — Design.

  1. Give each region’s share of the labour force and the true national rate.
  2. Give each region’s probability of selection.
  3. Give the sampling weights.
  4. Why sample the same number in each region?
  5. Which way would an unweighted rate be biased?
  6. Give the design effect of the weights by Kish’s formula.

Part II — The estimate.

  1. Give the unemployed counted in each region’s sample in month 1.
  2. Give the regional rates and their standard errors.
  3. Give the unweighted national rate.
  4. Give the weighted national rate.
  5. Give its standard error, ∑hWh2 p^h(1−p^h)/nh\sqrt{\sum_h W_h^2\,\hat p_h(1 - \hat p_h)/n_h}, with WhW_h the regions’ shares.
  6. Compare with the standard error of a simple random sample of 12,000.
  7. Give a 95%95\% interval.

Part III — The change.

  1. Give the weighted rate in month 2.
  2. Give the change.
  3. Give the standard error of the change.
  4. Give the tt statistic and the pp-value.
  5. Does the survey detect the rise at 5%5\%?
  6. Is the drawn change far from the true one?
  7. How would keeping the same people in the sample from one month to the next change the standard error of the change?

Part IV — The sample size.

  1. What standard error of the change gives a power of 80%80\% to detect a 0.20.2-point rise at 5%5\%, two-sided?
  2. Give the standard error of the change with 12,000 people, from the true rates.
  3. How many people a month, with the same design, give the power of item 21?
  4. And with a simple random sample?
  5. How many with overlapping samples whose estimates have a correlation of 0.50.5 between months?
  6. State the result.
Solution

Solution of Problem 31.1.

1. Shares 0.4440.444, 0.3330.333, 0.2220.222; true rate 0.444×5.0+0.333×6.5+0.222×7.25=6.0%0.444 \times 5.0 + 0.333 \times 6.5 + 0.222 \times 7.25 = 6.0\%.

2. 4,000/2,000,000=0.00204{,}000/2{,}000{,}000 = 0.0020; 0.002670.00267; 0.00400.0040.

3. 500, 375 and 250 people each.

4. To estimate each region’s rate with the same precision, the small regions included.

5. Upwards: the South, with the highest rate, is over-represented.

6. 1.0741.074.

7. 201, 272 and 298.

8. 5.03%5.03\%, 6.80%6.80\% and 7.45%7.45\%, with standard errors 0.3450.345, 0.3980.398 and 0.4150.415 point.

9. 771/12,000=6.425%771/12{,}000 = 6.425\%.

10. 6.156%6.156\%.

11. 0.2230.223 point.

12. 0.2190.219 point: the design is slightly less precise for the national rate, as the design effect predicts.

13. 5.72%5.72\% to 6.59%6.59\%.

14. 6.456%6.456\%.

15. +0.300+0.300 point.

16. 0.22292+0.22832=0.319\sqrt{0.2229^2 + 0.2283^2} = 0.319 point.

17. t=0.941t = 0.941, p=0.347p = 0.347.

18. No.

19. No: 0.10.1 point from the true 0.20.2, a third of a standard error.

20. With a correlation ρ\rho between the two months’ estimates, the variance of the change is multiplied by 1−ρ1 - \rho: overlap makes changes more precise.

21. 0.2/(1.960+0.842)=0.07140.2/(1.960 + 0.842) = 0.0714 point.

22. 0.3120.312 point.

23. 12,000×(0.3119/0.0714)2≈229,00012{,}000 \times (0.3119/0.0714)^2 \approx 229{,}000 people a month.

24. 2×0.06×0.94/0.0007142≈221,0002 \times 0.06 \times 0.94/0.000714^2 \approx 221{,}000.

25. Half as many: about 115,000.

26. To detect a 0.20.2-point monthly change with 80%80\% power, Brenland’s survey needs about 229,000 people a month, not 12,000 — about 115,000 if the samples overlap enough for a correlation of 0.50.5.

এই অধ্যায়ে সংজ্ঞায়িত পরিভাষা-শব্দ

পরিভাষায় সব 1086 টি শব্দ দেখো