---
title: "Random Variables for Econometrics"
book: "University Economics — Year 1"
subject: economics
language: en
chapter: 30
exercises: 12
source: https://one-course.com/books/economics/3/en/chapter/30-random-variables-for-econometrics
license: CC-BY-NC-SA-4.0
credit: "One Economics Book, One Course (one-course.com)"
---

# Chapter 30 — Random Variables for Econometrics

Draw five men at random from the 2,490 of the PSID sample and average their 1978 earnings; draw five more and average again. Repeated 10,000 times, the averages spread with a standard deviation of 6,979 dollars around the population mean of 21,554 (dollars of 1982, as everywhere in this chapter’s earnings). With thirty men the spread falls to 2,840; with two hundred, to 1,093.

Each figure is close to the population’s standard deviation divided by the square root of the sample size. This chapter gives the probability behind that rule — [conditional expectations](#def-b1-random-variables-for-econometrics-conditional-expectation), the distributions that tests use, the law of large numbers and the central limit theorem — and the cases in which it fails.

![Sample means of 1978 earnings, 10,000 samples of 5 (light), 30 (blue) and 200 (red) men drawn with replacement from the PSID sample, densities per 10,000 dollars; the population mean is dashed.](https://one-course.com/images/onecourse/chapters/economics-3/b1-random-variables-for-econometrics/fig-fe27786525ed.svg)

*Sample means of 1978 earnings, 10,000 samples of 5 (light), 30 (blue) and 200 (red) men drawn with replacement from the PSID sample, densities per 10,000 dollars; the population mean is dashed. Source: National Supported Work comparison sample (PSID); simulation with a fixed seed*

The earnings themselves are skewed to the right ([Chapter 29](https://one-course.com/books/economics/3/en/chapter/29-describing-data#ch-b1-describing-data)); the means of five are less skewed, and the means of two hundred look like a bell curve centred on the population mean.

**You already know.**

Random variables, expectation, variance, independence, the binomial and normal laws and the law of large numbers were met in the mathematics series at school; the central limit theorem is proved in its third university volume. Describing data is [Chapter 29](https://one-course.com/books/economics/3/en/chapter/29-describing-data#ch-b1-describing-data).

## 30.1 Expectation, variance, covariance

For random variables $X$, $Y$ and numbers $a$, $b$: $\E[aX + b] = a\E[X] + b$, $\E[X + Y] = \E[X] + \E[Y]$ and $\Var(aX + b) = a^2\Var(X)$.

**Notation 30.1.**

The covariance of two random variables is $\Cov(X, Y) = \E[(X - \E X)(Y - \E Y)]$, defined in the mathematics series (second university volume). Then $\Var(X + Y) = \Var(X) + \Var(Y) + 2\Cov(X, Y)$, and for independent $X_1, \dots, X_n$ with variance $\sigma^2$, $\Var(\bar X) = \sigma^2/n$.

## 30.2 Joint and conditional distributions

**Definition 30.2 (Joint and conditional distributions).**

The *joint distribution* of two discrete random variables gives $P(X = x, Y = y)$ for every pair; the marginal distributions are its row and column sums. The *conditional distribution* of $Y$ given $X = x$ is $P(Y = y \mid X = x) = P(X = x, Y = y)/P(X = x)$.

```python
"""A joint distribution: schooling and earnings bracket, PSID sample, 1978."""

import pandas as pd
from econdata import nsw

d = nsw("psid_controls")
school = pd.cut(d.education, [0, 11, 12, 20], labels=["<12", "12", ">12"])
bracket = pd.cut(d.re78, [-1, 10_000, 30_000, 1e9], labels=["<10k", "10-30k", ">30k"])
joint = pd.crosstab(school, bracket, normalize=True, margins=True).round(3)
print("joint distribution, with marginals:")
print(joint)
cond = pd.crosstab(school, bracket, normalize="index").round(3)  # rows sum to 1
print("earnings bracket given schooling:")
print(cond)
```

***Listing 30.1.** A [joint distribution](#def-b1-random-variables-for-econometrics-joint) from a sample, with its margins, and a [conditional distribution](#def-b1-random-variables-for-econometrics-joint). code/bachelor-1/30-random-variables-for-econometrics/listings/joint_table.py*

```
$ python joint_table.py
joint distribution, with marginals:
re78        <10k  10-30k   >30k    All
education                             
<12        0.112   0.161  0.031  0.304
12         0.058   0.223  0.062  0.343
>12        0.055   0.159  0.138  0.353
All        0.226   0.543  0.231  1.000
earnings bracket given schooling:
re78        <10k  10-30k   >30k
education                      
<12        0.367   0.530  0.103
12         0.170   0.651  0.179
>12        0.157   0.450  0.392
```

***Output 30.1.** Of men with more than 12 years of schooling, $39.2\%$ earned over 30,000 dollars; of men with fewer than 12, $10.3\%$.*

## 30.3 Conditional expectation

**Definition 30.3 (Conditional expectation).**

The *conditional expectation* of $Y$ given $X = x$ is $\E[Y \mid X = x] = \sum_y y\,P(Y = y \mid X = x)$. As a function of $x$ it is the conditional expectation function; $\E[Y \mid X]$ is that function applied to $X$, a random variable.

**Theorem 30.4 (Law of iterated expectations).**

$\E\big[\E[Y \mid X]\big] = \E[Y]$.

**Proof.** In the discrete case, $\sum_x P(X = x)\sum_y y\,P(Y = y \mid X = x) = \sum_x\sum_y y\,P(X = x, Y = y) = \sum_y y\,P(Y = y) = \E[Y]$. ∎

```python
"""The law of iterated expectations, checked on the PSID sample."""

from econdata import nsw

d = nsw("psid_controls")
cond = d.groupby("education").re78.mean()  # E[Y | X = x] for each x
weight = d.education.value_counts(normalize=True)  # P(X = x)
print(f"E[E[Y|X]] = {(cond * weight).sum():.6f}")
print(f"E[Y]      = {d.re78.mean():.6f}")
```

***Listing 30.2.** The law checked on a sample: the mean of the [conditional means](https://one-course.com/books/economics/3/en/chapter/29-describing-data#def-b1-describing-data-conditional-mean), weighted by group shares. code/bachelor-1/30-random-variables-for-econometrics/listings/iterated.py*

```
$ python iterated.py
E[E[Y|X]] = 21553.920778
E[Y]      = 21553.920778
```

***Output 30.2.** Equal to the last printed digit.*

**Proposition 30.5 (The best predictor).**

Among all functions $g$, $\E[(Y - g(X))^2]$ is smallest for $g(X) = \E[Y \mid X]$.

**Proof.** Write $m(X) = \E[Y \mid X]$. Then $\E[(Y - g)^2] = \E[(Y - m)^2] + \E[(m - g)^2] + 2\E[(Y - m)(m - g)]$. Conditionally on $X = x$, $m - g$ is a number and $\E[Y - m \mid X = x] = 0$, so the last term is zero by the law of iterated expectations. The middle term is at least zero, and zero for $g = m$. ∎

```python
"""Three predictors of earnings from schooling: mean squared errors."""

import numpy as np
from econdata import nsw

d = nsw("psid_controls")
x, y = d.education, d.re78
pred = {
    "overall mean": np.full(len(y), y.mean()),
    "a line": np.polyval(np.polyfit(x, y, 1), x),
    "conditional mean": d.groupby("education").re78.transform("mean"),
}
for name, p in pred.items():
    print(f"{name:17s} MSE {((y - p) ** 2).mean() / 1e6:8.2f} million")
```

***Listing 30.3.** Three predictors of earnings from schooling. code/bachelor-1/30-random-variables-for-econometrics/listings/best_predictor.py*

```
$ python best_predictor.py
overall mean      MSE   241.87 million
a line            MSE   211.61 million
conditional mean  MSE   208.73 million
```

***Output 30.3.** The [conditional mean](https://one-course.com/books/economics/3/en/chapter/29-describing-data#def-b1-describing-data-conditional-mean) predicts best in the sample; a line comes close.*

![The conditional means of earnings by schooling (dots) and the least-squares line (red): the line approximates the conditional expectation function, with a mean squared error only 1.4\% larger.](https://one-course.com/images/onecourse/chapters/economics-3/b1-random-variables-for-econometrics/fig-a3b8fdb0b0e1.svg)

*The [conditional means](https://one-course.com/books/economics/3/en/chapter/29-describing-data#def-b1-describing-data-conditional-mean) of earnings by schooling (dots) and the least-squares line (red): the line approximates the [conditional expectation](#def-b1-random-variables-for-econometrics-conditional-expectation) function, with a mean squared error only $1.4\%$ larger.*

**Definition 30.6 (Mean independence).**

$Y$ is *mean independent* of $X$ when $\E[Y \mid X = x]$ does not depend on $x$. Independence implies mean independence, which implies $\Cov(X, Y) = 0$; neither converse holds ([Exercise 30.11](#exo-b1-random-variables-for-econometrics-mean-indep)).

## 30.4 The tools

**Definition 30.7 (Chi-square, Student’s ttt and FFF distributions).**

Let $Z, Z_1, \dots, Z_k$ be independent standard normal variables. $V = Z_1^2 + \dots + Z_k^2$ has the *chi-square distribution* with $k$ degrees of freedom, $\chi^2_k$. If $V$ is independent of $Z$, $Z/\sqrt{V/k}$ has *Student’s $t$ distribution* with $k$ degrees of freedom. If $V_1 \sim \chi^2_k$ and $V_2 \sim \chi^2_m$ are independent, $(V_1/k)/(V_2/m)$ has the *$F$ distribution* with $k$ and $m$ degrees of freedom.

![Student’s t against the normal: with 2 degrees of freedom the tails are much heavier; with 30 the two curves are hard to tell apart.](https://one-course.com/images/onecourse/chapters/economics-3/b1-random-variables-for-econometrics/fig-48bbd17deb4d.svg)

*Student’s $t$ against the normal: with 2 degrees of freedom the tails are much heavier; with 30 the two curves are hard to tell apart.*

The constants are the exact normalising factors: $1/(2\sqrt2)$ for $t_2$, and $\Gamma(\frac{k+1}2)/(\sqrt{k\pi}\,\Gamma(\frac k2))$, which is $0.3796$ for $k = 5$ and $0.3956$ for $k = 30$.

```python
"""Critical values the next chapters use (upper tails)."""

from scipy import stats

print("            5%      2.5%")
print(f"N(0,1)  {stats.norm.ppf(0.95):7.3f}  {stats.norm.ppf(0.975):7.3f}")
for k in (1, 5, 30):
    print(
        f"chi2({k:2d}) {stats.chi2.ppf(0.95, k):6.3f}  {stats.chi2.ppf(0.975, k):7.3f}"
    )
for k in (5, 30, 100):
    print(f"t({k:3d})  {stats.t.ppf(0.95, k):7.3f}  {stats.t.ppf(0.975, k):7.3f}")
for k, m in ((2, 30), (5, 100)):
    print(
        f"F({k},{m:3d}) {stats.f.ppf(0.95, k, m):6.3f}  {stats.f.ppf(0.975, k, m):7.3f}"
    )
```

***Listing 30.4.** The critical values of the next two chapters. code/bachelor-1/30-random-variables-for-econometrics/listings/distributions.py*

```
$ python distributions.py
            5%      2.5%
N(0,1)    1.645    1.960
chi2( 1)  3.841    5.024
chi2( 5) 11.070   12.833
chi2(30) 43.773   46.979
t(  5)    2.015    2.571
t( 30)    1.697    2.042
t(100)    1.660    1.984
F(2, 30)  3.316    4.182
F(5,100)  2.305    2.696
```

***Output 30.4.** Upper-tail [quantiles](https://one-course.com/books/economics/3/en/chapter/29-describing-data#def-b1-describing-data-quantile) at $5\%$ and $2.5\%$.*

```python
"""Student's t built from normal variables, against scipy's."""

import numpy as np
from scipy import stats

rng = np.random.default_rng(2026)
k, draws = 5, 200_000
z = rng.standard_normal(draws)
v = (rng.standard_normal((draws, k)) ** 2).sum(axis=1)  # chi-square with k degrees
t = z / np.sqrt(v / k)
for p in (0.9, 0.95, 0.975, 0.99):
    print(
        f"{p:5.3f}  simulated {np.quantile(t, p):6.3f}  exact {stats.t.ppf(p, k):6.3f}"
    )
```

***Listing 30.5.** Student’s $t$ built from its definition. code/bachelor-1/30-random-variables-for-econometrics/listings/build_t.py*

```
$ python build_t.py
0.900  simulated  1.477  exact  1.476
0.950  simulated  2.018  exact  2.015
0.975  simulated  2.551  exact  2.571
0.990  simulated  3.339  exact  3.365
```

***Output 30.5.** The simulated [quantiles](https://one-course.com/books/economics/3/en/chapter/29-describing-data#def-b1-describing-data-quantile) match the exact ones to within $0.03$.*

**How it is measured — Drawing a sample in a computer.**

A computer draws “random” numbers from a deterministic sequence that starts from a *seed*. The same seed gives the same draws, so a simulation can be rerun and give the same digits, which is why every simulation in this book fixes its seed. A different seed gives different digits and, if the simulation is large enough, the same conclusions.

## 30.5 The law of large numbers and the central limit theorem

**Definition 30.8 (Sampling distribution).**

The *sampling distribution* of a statistic is its distribution over repeated samples of the same size from the same population.

By the law of large numbers, the mean of $n$ independent draws converges to the population mean as $n$ grows.

```python
"""The law of large numbers: a running mean of earnings drawn at random."""

import numpy as np
from econdata import nsw

y = nsw("psid_controls").re78.to_numpy()
rng = np.random.default_rng(2026)
draws = rng.choice(y, size=100_000)  # with replacement
running = draws.cumsum() / np.arange(1, len(draws) + 1)
for n in (10, 100, 1_000, 10_000, 100_000):
    print(f"n = {n:>7,}: mean {running[n - 1]:9,.0f}")
print(f"population mean {y.mean():9,.0f}")
```

***Listing 30.6.** A running mean of random draws. code/bachelor-1/30-random-variables-for-econometrics/listings/lln.py*

```
$ python lln.py
n =      10: mean    25,148
n =     100: mean    22,006
n =   1,000: mean    21,651
n =  10,000: mean    21,919
n = 100,000: mean    21,584
population mean    21,554
```

***Output 30.6.** After 100,000 draws the mean is within about 30 dollars of the population’s.*

**Theorem 30.9 (Central limit theorem).**

If $X_1, X_2, \dots$ are independent with the same distribution, mean $\mu$ and finite variance $\sigma^2$, then for every $z$, $P\big(\sqrt n(\bar X_n - \mu)/\sigma \le z\big) \to \Phi(z)$ as $n \to \infty$, where $\Phi$ is the standard normal distribution function.

**Proof.** *Admitted at this level.* ∎

Proved in the mathematics series, third university volume.

```python
"""Sample means of earnings for n = 5, 30, 200: spread and shape."""

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

y = nsw("psid_controls").re78.to_numpy()
sigma = y.std()  # the population is the sample of 2,490: divide by N
rng = np.random.default_rng(2026)
print(f"population: mean {y.mean():,.0f}  sd {sigma:,.0f}  skewness {skew(y):.2f}")
for n in (5, 30, 200):
    means = rng.choice(y, size=(10_000, n)).mean(axis=1)
    se = sigma / np.sqrt(n)
    print(
        f"n = {n:3d}: sd of means {means.std():6,.0f}  sigma/sqrt(n) {se:6,.0f}", end=""
    )
    print(f"  skewness {skew(means):.2f}")
```

***Listing 30.7.** The opening chart’s numbers: the spread and the [skewness](https://one-course.com/books/economics/3/en/chapter/29-describing-data#def-b1-describing-data-skewness) of the sample means. code/bachelor-1/30-random-variables-for-econometrics/listings/clt.py*

```
$ python clt.py
population: mean 21,554  sd 15,552  skewness 1.24
n =   5: sd of means  6,979  sigma/sqrt(n)  6,955  skewness 0.51
n =  30: sd of means  2,840  sigma/sqrt(n)  2,839  skewness 0.23
n = 200: sd of means  1,093  sigma/sqrt(n)  1,100  skewness 0.12
```

***Output 30.7.** The spread follows $\sigma/\sqrt n$; the [skewness](https://one-course.com/books/economics/3/en/chapter/29-describing-data#def-b1-describing-data-skewness) falls from $1.24$ to $0.12$.*

**Definition 30.10 (Random sample).**

A *random sample* of size $n$ is a set of $n$ observations drawn independently from one population, each with the population’s distribution; drawing one is *random sampling*.

**Model — Random sampling.**

**Assumes.** Observations drawn independently from one population with a finite variance.

**Predicts.** Sample means centred on the population mean, with standard deviation $\sigma/\sqrt n$, and approximately normal for large $n$.

**Tested.** Checked, not tested, by simulation from a real, skewed population (opening chart): the standard deviations of the means are within $1\%$ of $\sigma/\sqrt n$ for 5, 30 and 200 men, but the draws are independent by construction. Whether a real survey’s observations are independent is a property of how it was drawn; a test compares its estimates with a known total, or the spread of its estimates with the spread its design implies ([Chapter 31](https://one-course.com/books/economics/3/en/chapter/31-sampling-and-inference#ch-b1-sampling-and-inference)).

**Breaks.** Dependent draws — months of one [time series](https://one-course.com/books/economics/3/en/chapter/28-economic-data-with-python#def-b1-economic-data-python-shapes), members of one family, pupils of one class — make the spread larger than $\sigma/\sqrt n$ (the second university year treats them); populations so heavy-tailed that the variance does not exist make the means settle far more slowly.

```python
"""Means of a Pareto population with alpha = 1.5: the variance does not exist."""

import numpy as np

rng = np.random.default_rng(2026)
alpha = 1.5  # mean alpha / (alpha - 1) = 3, variance infinite
for n in (100, 10_000, 1_000_000):
    x = rng.pareto(alpha, size=(20, n)) + 1  # Pareto with minimum 1
    means = x.mean(axis=1)
    print(f"n = {n:>9,}: means from {means.min():.2f} to {means.max():.2f}")
```

***Listing 30.8.** Twenty sample means of a population without a variance. code/bachelor-1/30-random-variables-for-econometrics/listings/heavy_tails.py*

```
$ python heavy_tails.py
n =       100: means from 2.00 to 12.12
n =    10,000: means from 2.76 to 3.55
n = 1,000,000: means from 2.94 to 3.22
```

***Output 30.8.** Ten thousand times more data narrow the range of the means only by a factor of about 36.*

With a finite variance, ten thousand times more data would narrow the range a hundredfold. Here, from samples of 100 to samples of a million, the range shrinks from $10.12$ to $0.28$, a factor of 36.

## Exercises

**Exercise 30.1 ★.**

$\E[X] = 5$ and $\Var(X) = 2$. Find $\E[2X + 3]$ and $\Var(2X + 3)$.

**Solution of Exercise 30.1.**

$\E[2X + 3] = 2 \times 5 + 3 = 13$; $\Var(2X + 3) = 4 \times 2 = 8$.

**Exercise 30.2 ★.**

From the rounded joint table of [Output 30.1](#out-b1-random-variables-for-econometrics-joint), compute $P(\text{over } 30{,}000 \mid \text{more than 12 years})$.

**Solution of Exercise 30.2.**

$0.138/0.353 = 0.391$ with the rounded table ($0.392$ unrounded, as the conditional table prints).

**Exercise 30.3 ★.**

From [Output 30.7](#out-b1-random-variables-for-econometrics-clt), give the standard deviation of the means for $n = 30$ and compare it with $\sigma/\sqrt{30}$.

**Solution of Exercise 30.3.**

2,840 dollars, against $\sigma/\sqrt{30} = 2{,}839$: within one dollar.

**Exercise 30.4 ★.**

Predict the standard deviation of the means for $n = 120$.

**Solution of Exercise 30.4.**

$15{,}552/\sqrt{120} = 1{,}420$ dollars, half the value for $n = 30$, since 120 is four times 30.

**Exercise 30.5 ★★.**

$40\%$ of a population is in group A, with mean earnings 10, and $60\%$ in group B, with mean 20. Find mean earnings.

**Solution of Exercise 30.5.**

By the law of iterated expectations, $0.4 \times 10 + 0.6 \times 20 = 16$.

**Exercise 30.6 ★★.**

$\Var(X) = 4$, $\Var(Y) = 9$, $\Cov(X, Y) = 1.5$. Find $\Var(X + Y)$.

**Solution of Exercise 30.6.**

$4 + 9 + 2 \times 1.5 = 16$.

**Exercise 30.7 ★★.**

Using the central limit theorem and the population values of [Output 30.7](#out-b1-random-variables-for-econometrics-clt), give the interval that contains $95\%$ of the means of 200 men.

**Solution of Exercise 30.7.**

$\sigma/\sqrt{200} = 1{,}100$, so $95\%$ of the means lie within $1.96 \times 1{,}100 = 2{,}156$ dollars of $21{,}554$ (2,155 unrounded): from about 19,400 to 23,710 dollars.

**Exercise 30.8 ★★.**

Find the mean and the variance of $\chi^2_k$, using $\E[Z^2] = 1$ and $\E[Z^4] = 3$.

**Solution of Exercise 30.8.**

$\E[V] = \sum_i \E[Z_i^2] = k$. $\Var(Z_i^2) = \E[Z_i^4] - (\E[Z_i^2])^2 = 3 - 1 = 2$, and the terms are independent, so $\Var(V) = 2k$.

**Exercise 30.9 ★★.**

A survey of $n$ men samples $n/2$ pairs of brothers, whose earnings have a correlation $\rho > 0$ within each pair. Predict the variance of the mean.

**Solution of Exercise 30.9.**

With variance $\sigma^2$ for each man, the sum of a pair has variance $2\sigma^2 + 2\rho\sigma^2$. The mean of $n/2$ independent pairs, divided by $n$, has variance $\frac{n}{2}\cdot 2\sigma^2(1 + \rho)/n^2 = \sigma^2(1 + \rho)/n$: larger than $\sigma^2/n$ by the factor $1 + \rho$.

**Exercise 30.10 ★★★.**

Prove [Proposition 30.5](#prop-b1-random-variables-for-econometrics-best) by writing $\E[(Y - c)^2 \mid X = x]$ as a function of the number $c$, for each $x$.

**Solution of Exercise 30.10.**

For a given $x$, $\E[(Y - c)^2 \mid X = x] = \Var(Y \mid X = x) + (\E[Y \mid X = x] - c)^2$, smallest at $c = \E[Y \mid X = x]$. Choosing $g(x)$ this way for every $x$ minimises each term of $\E[(Y - g(X))^2] = \sum_x P(X = x)\,\E[(Y - g(x))^2 \mid X = x]$, hence the sum.

**Exercise 30.11 ★★★.**

Show that [mean independence](#def-b1-random-variables-for-econometrics-mean-independence) implies zero covariance, and give an example of zero covariance without [mean independence](#def-b1-random-variables-for-econometrics-mean-independence).

**Solution of Exercise 30.11.**

If $\E[Y \mid X] = \E[Y]$, then $\E[XY] = \E[X\,\E[Y \mid X]] = \E[X]\E[Y]$ by the law of iterated expectations, so $\Cov(X, Y) = 0$. Counterexample to the converse: $X$ equal to $-1$, 0 or 1 with probability $1/3$ each and $Y = X^2$. Then $\Cov(X, Y) = \E[X^3] = 0$, but $\E[Y \mid X = 0] = 0$ and $\E[Y \mid X = 1] = 1$.

**Exercise 30.12 ★★★.**

What simulation result would show that the normal approximation fails for means of 30 draws from a given population?

**Solution of Exercise 30.12.**

Many simulated samples of 30 from that population, with the share of means outside $\mu \pm 1.96\sigma/\sqrt{30}$ far from $5\%$, or a [histogram](https://one-course.com/books/economics/3/en/chapter/29-describing-data#def-b1-describing-data-histogram) of the means that is clearly skewed, or simulated [quantiles](https://one-course.com/books/economics/3/en/chapter/29-describing-data#def-b1-describing-data-quantile) of the standardised mean far from the normal ones. A population with a very heavy tail, such as the Pareto one of the chapter, would show it.

## 30.6 Problem: The Brenland Lottery of Surveys

**Problem 30.1.**

Weekend problem — a population, and 10,000 surveys of it

Treat the 2,000 households of Brenland’s survey (invented) as the whole population. Survey firms draw 100 households with replacement; a script simulates 10,000 such surveys with a fixed seed.

**Part I — A joint distribution.** Classify households by size (1 to 5) and by [disposable income](https://one-course.com/books/economics/3/en/chapter/18-national-accounts-in-depth#def-b1-national-accounts-in-depth-gni) (under 20,000, 20,000 to 30,000, 30,000 or more dalens).

1. Give the marginal distribution of size.
2. Give $P(\text{size } 1, \text{ income } 30{,}000 \text{ or more})$ .
3. Give $P(\text{income } 30{,}000 \text{ or more} \mid \text{size } 1)$ and $\mid \text{size } 4$ .
4. Are size and income independent?
5. Why might larger households have higher income?

**Part II — Conditional expectations.**

6. Give mean income by household size.
7. Check the law of iterated expectations.
8. Is income mean independent of size?
9. Which predictor of income from size has the smallest mean squared error?
10. Would mean income per person behave the same way?

**Part III — The sampling distribution.**

11. Give the population mean and standard deviation.
12. Predict the standard deviation of the survey means.
13. Give the simulated standard deviation.
14. Within what distance of the true mean do $95\%$ of survey means fall, by simulation?
15. And by the central limit theorem?
16. How would the distance change with 400 households?
17. Why draw with replacement?

**Part IV — A $t$ statistic.** In each survey, compute $t = (\bar y - \mu)/(s/\sqrt{100})$ with $s$ the survey’s standard deviation.

18. What distribution would $t$ have if incomes were normal?
19. Give the $2.5\%$ upper [quantile](https://one-course.com/books/economics/3/en/chapter/29-describing-data#def-b1-describing-data-quantile) of $t_{99}$ .
20. What share of the surveys has $|t|$ above it?
21. Give the standard deviation of the 10,000 values of $t$ .
22. Why is the share close to $5\%$ although incomes are skewed?
23. What would make it far from $5\%$ ?
24. What does a survey firm learn from one survey’s $t$ , when $\mu$ is unknown?
25. State the result: within what distance of the truth is the mean income of 100 households in $95\%$ of surveys?

**Solution of Problem 30.1.**

**1.** Sizes 1 to 5: $0.275$, $0.311$, $0.176$, $0.166$, $0.072$.

**2.** $0.056$.

**3.** $0.056/0.275 = 0.204$ for size 1; for size 4, $0.044/0.166 = 0.265$ with the rounded table ($0.267$ unrounded).

**4.** No: the [conditional distribution](#def-b1-random-variables-for-econometrics-joint) of income changes with size.

**5.** Larger households more often have two earners.

**6.** 23,326; 24,004; 26,678; 26,834; 26,249 dalens for sizes 1 to 5.

**7.** The weighted mean of the [conditional means](https://one-course.com/books/economics/3/en/chapter/29-describing-data#def-b1-describing-data-conditional-mean) is 24,919.72, equal to the population mean.

**8.** No: mean income changes with size, from 23,326 to 26,834.

**9.** The [conditional mean](https://one-course.com/books/economics/3/en/chapter/29-describing-data#def-b1-describing-data-conditional-mean) by size ([Proposition 30.5](#prop-b1-random-variables-for-econometrics-best)).

**10.** No: income per person falls with size, from 23,326 for one person to about 5,250 for five.

**11.** $\mu = 24{,}919.7$ and $\sigma = 10{,}601.3$ dalens (dividing by 2,000, the population).

**12.** $10{,}601.3/\sqrt{100} = 1{,}060.1$.

**13.** 1,061.2.

**14.** 2,061 dalens.

**15.** $1.96 \times 1{,}060.1 = 2{,}078$.

**16.** It would halve, to about 1,040.

**17.** Draws with replacement are independent and from the same population, so $\Var(\bar y) = \sigma^2/n$ exactly.

**18.** Student’s $t$ with 99 degrees of freedom.

**19.** $1.984$.

**20.** $5.13\%$.

**21.** $1.025$.

**22.** With 100 households the mean is close to normal by the central limit theorem, and $s$ is close to $\sigma$.

**23.** Small samples from very skewed or heavy-tailed populations, or dependent draws.

**24.** Alone, nothing; but the share of item 20 means that the interval $\bar y \pm 1.984\,s/10$ contains $\mu$ in about $95\%$ of surveys ([Chapter 31](https://one-course.com/books/economics/3/en/chapter/31-sampling-and-inference#ch-b1-sampling-and-inference)).

**25.** With 100 households, the mean income is within 2,061 dalens of the truth in $95\%$ of surveys, close to the 2,078 that the central limit theorem predicts.
