अर्थशास्त्र · किताब 3 · स्नातक वर्ष 1

University Economics — Year 1

यह किताब अभी हिन्दी में उपलब्ध नहीं है। संस्करण: English।

University Economics — Year 1 · स्नातक वर्ष 1

32Simple Regression

Among the 2,204 men of the PSID sample with positive earnings in 1978, each extra year of schooling goes with log earnings higher by 0.08850.0885: about 9%9\% more earnings. Does a year of school raise earnings by 9%9\%? The line through the data does not say. This chapter builds the line — least squares — and shows how to read it, how precise it is, when it estimates what we want, and two reasons, regression toward the mean and omitted variables, why it often does not.

Mean log earnings in 1978 by years of schooling, PSID comparison sample, men with positive earnings and 8 to 17 years of schooling (counts above the points), and the least-squares line fitted on all 2,204 men.
Mean log earnings in 1978 by years of schooling, PSID comparison sample, men with positive earnings and 8 to 17 years of schooling (counts above the points), and the least-squares line fitted on all 2,204 men. Source: National Supported Work comparison sample (PSID), as assembled by LaLonde (1986) and Dehejia and Wahba (1999)

The means rise with schooling and lie close to the line; the line explains 13%13\% of the variance of log earnings across men, and the rest is everything else.

You already know

Covariance, correlation and conditional means are Chapter 29; conditional expectation and its best-predictor property, Chapter 30; standard errors and tests, Chapter 31. That a correlation is not a cause was met at school.

How it is measured — Earnings in the PSID and CPS samples

The two samples are comparison groups drawn from two large US surveys and assembled to evaluate a job-training experiment (LaLonde 1986; Dehejia and Wahba 1999): men’s earnings in 1974, 1975 and 1978, in dollars of 1982, with age, schooling and a few other traits.

The CPS sample’s earnings are capped (Chapter 29); the PSID sample’s are not.

32.1 The conditional expectation function and its best line

Definition 32.1 (Population regression line)

The population regression line, or best linear predictor, of YY given XX is the line β0+β1X\beta_0 + \beta_1 X that minimises E[(Y−b0−b1X)2]\E[(Y - b_0 - b_1X)^2] over b0b_0 and b1b_1.

Proposition 32.2 (Its coefficients)

β1=Cov⁡(X,Y)/Var⁡(X)\beta_1 = \Cov(X, Y)/\Var(X) and β0=E[Y]−β1E[X]\beta_0 = \E[Y] - \beta_1\E[X].

Proof. Setting the derivatives with respect to b0b_0 and b1b_1 to zero gives E[Y−b0−b1X]=0\E[Y - b_0 - b_1X] = 0 and E[X(Y−b0−b1X)]=0\E[X(Y - b_0 - b_1X)] = 0. The first gives β0\beta_0. Substituting it into the second, E[X(Y−EY)]−b1E[X(X−EX)]=0\E[X(Y - \E Y)] - b_1\E[X(X - \E X)] = 0, that is Cov⁡(X,Y)=b1Var⁡(X)\Cov(X, Y) = b_1\Var(X). The function is convex in (b0,b1)(b_0, b_1), so this is the minimum. ∎

The conditional expectation function is the best predictor of all (Proposition 30.5); the regression line is the best straight line. When the conditional expectation function is a line, the two coincide; otherwise the line is the best linear approximation to it, as in the opening chart.

32.2 Least squares

Definition 32.3 (Ordinary least squares estimator)

The ordinary least squares (OLS) estimator of the line in a sample (xi,yi)(x_i, y_i) minimises ∑i(yi−b0−b1xi)2\sum_i (y_i - b_0 - b_1x_i)^2; it is

β^1=∑i(xi−xˉ)(yi−yˉ)∑i(xi−xˉ)2,β^0=yˉ−β^1xˉ,\hat\beta_1 = \frac{\sum_i (x_i - \bar x)(y_i - \bar y)}{\sum_i (x_i - \bar x)^2}, \qquad \hat\beta_0 = \bar y - \hat\beta_1\bar x,

the sample analogue of Proposition 32.2.

Definition 32.4 (Fitted value, residual)

The fitted value of observation ii is y^i=β^0+β^1xi\hat y_i = \hat\beta_0 + \hat\beta_1x_i; its residual is u^i=yi−y^i\hat u_i = y_i - \hat y_i.

Proposition 32.5 (Residuals)

∑iu^i=0\sum_i \hat u_i = 0 and ∑ixiu^i=0\sum_i x_i\hat u_i = 0: the residuals have mean zero and are uncorrelated with xx in the sample.

Proof. These are the two first-order conditions of the minimisation, ∑i(yi−β^0−β^1xi)=0\sum_i (y_i - \hat\beta_0 - \hat\beta_1x_i) = 0 and ∑ixi(yi−β^0−β^1xi)=0\sum_i x_i(y_i - \hat\beta_0 - \hat\beta_1x_i) = 0. Since the residuals sum to zero, their sample covariance with xx is 1n−1∑ixiu^i=0\frac1{n-1}\sum_i x_i\hat u_i = 0. ∎

Least squares chooses the line that makes the sum of the squared vertical distances (the residuals, dashed) as small as possible.
Least squares chooses the line that makes the sum of the squared vertical distances (the residuals, dashed) as small as possible.
"""Least squares by hand: log earnings on years of schooling, PSID sample."""

import numpy as np
from econdata import nsw

d = nsw("psid_controls").query("re78 > 0")  # the log needs positive earnings
x, y = d.education.to_numpy(float), np.log(d.re78.to_numpy())
b1 = ((x - x.mean()) * (y - y.mean())).sum() / ((x - x.mean()) ** 2).sum()
b0 = y.mean() - b1 * x.mean()
resid = y - (b0 + b1 * x)
print(f"n {len(y)}; slope {b1:.4f}; intercept {b0:.4f}")
print(f"sum of residuals {resid.sum():.2e}")
print(f"sum of x times residuals {(x * resid).sum():.2e}")
Listing 32.1. Least squares from sums. code/bachelor-1/32-simple-regression/listings/ols_by_hand.py
$ python ols_by_hand.py
n 2204; slope 0.0885; intercept 8.8172
sum of residuals -1.65e-12
sum of x times residuals -1.96e-11
Output 32.1. The slope, and the two properties of the residuals up to rounding error.
"""The same regression with statsmodels."""

import numpy as np  # noqa: F401 -- np.log is used inside the formula strings
import statsmodels.formula.api as smf
from econdata import nsw

d = nsw("psid_controls").query("re78 > 0")
fit = smf.ols("np.log(re78) ~ education", data=d).fit()
print(fit.summary().tables[1])
print(f"R-squared {fit.rsquared:.4f}; observations {int(fit.nobs)}")
Listing 32.2. The same regression with statsmodels. code/bachelor-1/32-simple-regression/listings/ols_statsmodels.py
$ python ols_statsmodels.py
==============================================================================
                 coef    std err          t      P>|t|      [0.025      0.975]
------------------------------------------------------------------------------
Intercept      8.8172      0.061    143.914      0.000       8.697       8.937
education      0.0885      0.005     18.172      0.000       0.079       0.098
==============================================================================
R-squared 0.1304; observations 2204
Output 32.2. Coefficients, standard errors, tt statistics, pp-values and 95%95\% intervals.

32.3 Reading a slope

The slope’s meaning depends on whether each variable enters in levels or in logarithms. With log⁡y\log y and xx in levels, one more unit of xx goes with 100β1100\beta_1 per cent more yy (approximately, for small β1\beta_1; exactly 100(eβ1−1)100(e^{\beta_1} - 1)). With yy and log⁡x\log x, 1%1\% more xx goes with β1/100\beta_1/100 more units of yy. With both in logs, β1\beta_1 is an elasticity: 1%1\% more xx goes with β1\beta_1 per cent more yy.

"""Four functional forms on one pair of variables, and how to read each slope."""

import numpy as np  # noqa: F401 -- np.log is used inside the formula strings
import statsmodels.formula.api as smf
from econdata import nsw

d = nsw("psid_controls").query("re78 > 0 and education > 0")
forms = {
    "re78 ~ education": "dollars per year of schooling",
    "np.log(re78) ~ education": "x 100: per cent per year of schooling",
    "re78 ~ np.log(education)": "/ 100: dollars per 1% more schooling",
    "np.log(re78) ~ np.log(education)": "elasticity: % per 1% more schooling",
}
for formula, reading in forms.items():
    slope = smf.ols(formula, data=d).fit().params.iloc[1]
    print(f"{formula:34s} {slope:10.4f}  {reading}")
Listing 32.3. Four functional forms, one pair of variables. code/bachelor-1/32-simple-regression/listings/reading_slopes.py
$ python reading_slopes.py
re78 ~ education                    1849.0325  dollars per year of schooling
np.log(re78) ~ education               0.0875  x 100: per cent per year of schooling
re78 ~ np.log(education)           16832.1165  / 100: dollars per 1% more schooling
np.log(re78) ~ np.log(education)       0.8315  elasticity: % per 1% more schooling
Output 32.3. 1,849 dollars a year of schooling; 8.75%8.75\%; 168 dollars per 1%1\%; an elasticity of 0.830.83 (men with at least one year of schooling).

32.4 Fit

Definition 32.6 (Coefficient of determination)

The coefficient of determination is R2=∑i(y^i−yˉ)2/∑i(yi−yˉ)2=1−∑iu^i2/∑i(yi−yˉ)2R^2 = \sum_i (\hat y_i - \bar y)^2 / \sum_i (y_i - \bar y)^2 = 1 - \sum_i \hat u_i^2/\sum_i (y_i - \bar y)^2: the share of the sample variance of yy that the fitted values reproduce. In a simple regression it equals the squared correlation of xx and yy.

"""R-squared three ways."""

import numpy as np
import statsmodels.formula.api as smf
from econdata import nsw

d = nsw("psid_controls").query("re78 > 0")
y = np.log(d.re78)
fit = smf.ols("np.log(re78) ~ education", data=d).fit()
tss = ((y - y.mean()) ** 2).sum()
print(f"squared correlation      {np.corrcoef(d.education, y)[0, 1] ** 2:.6f}")
print(
    f"explained / total        {((fit.fittedvalues - y.mean()) ** 2).sum() / tss:.6f}"
)
print(f"1 - residual / total     {1 - (fit.resid**2).sum() / tss:.6f}")
Listing 32.4. R2R^2 three ways. code/bachelor-1/32-simple-regression/listings/r_squared.py
$ python r_squared.py
squared correlation      0.130406
explained / total        0.130406
1 - residual / total     0.130406
Output 32.4. The same number three times.

A low R2R^2 says that xx leaves much of the variation in yy unexplained; it does not say that the slope is small, badly estimated or unimportant. Schooling explains 13%13\% of the variance of log earnings, and the slope is still measured with a tt statistic of 18.

32.5 When is the slope unbiased?

Definition 32.7 (Error term)

In the model Y=β0+β1X+uY = \beta_0 + \beta_1X + u, the error term uu collects everything other than XX that affects YY. For observation ii it is uiu_i, unobserved; the residual u^i\hat u_i is its estimate.

Definition 32.8 (Zero conditional mean assumption)

The zero conditional mean assumption is E[u∣X]=0\E[u \mid X] = 0: whatever the value of XX, the other influences on YY average to zero.

Model — The simple linear regression model

Assumes. Y=β0+β1X+uY = \beta_0 + \beta_1X + u with E[u∣X]=0\E[u \mid X] = 0; a random sample (xi,yi)(x_i, y_i); some variation in xx.

Predicts. β^1\hat\beta_1 is unbiased for β1\beta_1, with the standard error of Proposition 32.10 when the variance of uu does not depend on XX.

Tested. Consistent with the published estimates: the log-earnings slope of 0.08850.0885 is close to those of studies that do not rest on the zero-conditional-mean assumption (the record Returns to schooling below).

Breaks. When ability or family background are in uu and also move schooling (the third university year returns to schooling with instruments), or when XX is measured with error (second university year).

Proposition 32.9 (Unbiasedness)

Under the model’s assumptions, E[β^1∣x1,…,xn]=β1\E[\hat\beta_1 \mid x_1, \dots, x_n] = \beta_1.

Proof. Substituting yi−yˉ=β1(xi−xˉ)+(ui−uˉ)y_i - \bar y = \beta_1(x_i - \bar x) + (u_i - \bar u) into β^1\hat\beta_1 gives β^1=β1+∑i(xi−xˉ)ui/∑i(xi−xˉ)2\hat\beta_1 = \beta_1 + \sum_i (x_i - \bar x)u_i / \sum_i (x_i - \bar x)^2, since ∑i(xi−xˉ)uˉ=0\sum_i (x_i - \bar x)\bar u = 0. Given the xix_i, the weights are numbers and E[ui∣x1,…,xn]=0\E[u_i \mid x_1, \dots, x_n] = 0 by random sampling and the zero conditional mean assumption, so the second term has expectation zero. ∎

Proposition 32.10 (Standard error of the slope)

If moreover Var⁡(u∣X)=σ2\Var(u \mid X) = \sigma^2, then Var⁡(β^1∣x)=σ2/∑i(xi−xˉ)2\Var(\hat\beta_1 \mid x) = \sigma^2/\sum_i (x_i - \bar x)^2, and the standard error is estimated by σ^2/∑i(xi−xˉ)2\sqrt{\hat\sigma^2/\sum_i (x_i - \bar x)^2} with σ^2=∑iu^i2/(n−2)\hat\sigma^2 = \sum_i \hat u_i^2/(n - 2).

Proof. Admitted at this level. ∎

The variance follows from the expression for β^1\hat\beta_1 in the previous proof; the n−2n - 2 and the case of a variance that changes with XX are derived in the second university year.

"""The standard error of the slope by the formula, and a t test of the slope."""

import numpy as np
import statsmodels.formula.api as smf
from econdata import nsw

d = nsw("psid_controls").query("re78 > 0")
fit = smf.ols("np.log(re78) ~ education", data=d).fit()
x, n = d.education, len(d)
s2 = (fit.resid**2).sum() / (n - 2)  # the error variance, n - 2 degrees of freedom
se = np.sqrt(s2 / ((x - x.mean()) ** 2).sum())
print(f"formula {se:.6f}; statsmodels {fit.bse['education']:.6f}")
print(f"t for slope = 0: {fit.params['education'] / se:.1f}")
print(f"t for slope = 0.10: {(fit.params['education'] - 0.10) / se:.2f}")
Listing 32.5. The formula against statsmodels, and two tt tests. code/bachelor-1/32-simple-regression/listings/slope_se.py
$ python slope_se.py
formula 0.004870; statsmodels 0.004870
t for slope = 0: 18.2
t for slope = 0.10: -2.36
Output 32.5. The slope is far from zero, and also significantly below 0.100.10.

32.6 Regression toward the mean

Definition 32.11 (Regression toward the mean)

Regression toward the mean is the tendency of units with extreme values of a variable at one date to have values closer to the mean at another, whenever the two are imperfectly correlated: with equal variances, the slope of one on the other is r<1r < 1.

"""Earnings in 1978 on earnings in 1975, and the reverse regression."""

import statsmodels.formula.api as smf
from econdata import nsw

d = nsw("psid_controls")
forward = smf.ols("re78 ~ re75", data=d).fit().params["re75"]
backward = smf.ols("re75 ~ re78", data=d).fit().params["re78"]
r = d.re75.corr(d.re78)
print(f"1978 on 1975: slope {forward:.4f}")
print(f"1975 on 1978: slope {backward:.4f}")
print(f"product {forward * backward:.4f}; r squared {r**2:.4f}")
top = d.re75 >= d.re75.quantile(0.9)
print(
    f"top tenth in 1975: mean {d.re75[top].mean():,.0f} then {d.re78[top].mean():,.0f}"
)
Listing 32.6. Earnings in 1978 on 1975, and 1975 on 1978. code/bachelor-1/32-simple-regression/listings/toward_mean.py
$ python toward_mean.py
1978 on 1975: slope 0.8368
1975 on 1978: slope 0.6394
product 0.5350; r squared 0.5350
top tenth in 1975: mean 46,368 then 45,253
Output 32.6. Both slopes below one; their product is r2r^2.
Mean earnings in 1978 against mean earnings in 1975, by bins of 1975 earnings (5,000 dollars wide, bins of 20 men or more), PSID comparison sample, and the 45-degree line (dashed).
Mean earnings in 1978 against mean earnings in 1975, by bins of 1975 earnings (5,000 dollars wide, bins of 20 men or more), PSID comparison sample, and the 45-degree line (dashed). Source: National Supported Work comparison sample (PSID)

Average earnings rose between the two years, yet the gains were largest at the bottom, and in the highest bins they mostly turned into losses (three of the five bins above 30,000 dollars lost): the men of the lowest bin went from 946 to 6,525 dollars on average, those of the highest from 52,086 to 47,719. Nothing pulled them together. A man’s earnings in one year combine a lasting part and a transitory part; men selected for high 1975 earnings include many with a lucky year, which does not repeat. Reverse the regression and the same happens backwards: the slope of 1975 on 1978 is also below one.

On the record — The regression fallacy

In 1933 a book claimed that business enterprises were converging towards the average: groups of firms ranked by their first-year value moved towards the average. A review answered that ranked by their last-year value the lines would diverge, and that the real test of convergence is a consistent decline in the variance among individual enterprises. Friedman (1992) quotes the review and finds the same fallacy in comparisons of countries’ growth sixty years later.

32.7 A regression is not a cause

Definition 32.12 (Omitted variable, confounder)

An omitted variable, or confounder, is a variable left out of the regression that affects YY and is correlated with XX. It sits in uu and breaks the zero conditional mean assumption.

"""An omitted variable: ability raises both schooling and earnings (simulated)."""

import numpy as np

rng = np.random.default_rng(2026)
slopes_short, slopes_long = [], []
for _ in range(1_000):
    ability = rng.standard_normal(500)
    school = 12 + 1.5 * ability + rng.normal(0, 2, 500)
    log_y = 9 + 0.06 * school + 0.10 * ability + rng.normal(0, 0.5, 500)
    slopes_short.append(np.polyfit(school, log_y, 1)[0])  # ability left out
    X = np.column_stack([np.ones(500), school, ability])
    slopes_long.append(np.linalg.lstsq(X, log_y, rcond=None)[0][1])
print("true effect of a year of school: 0.060")
print(f"slope, ability left out: mean {np.mean(slopes_short):.4f}")
print(f"slope, ability included: mean {np.mean(slopes_long):.4f}")
print(f"predicted bias 0.10 * 1.5 / (1.5**2 + 2**2) = {0.10 * 1.5 / 6.25:.4f}")
Listing 32.7. Ability left out: a simulation with a known answer. code/bachelor-1/32-simple-regression/listings/omitted.py
$ python omitted.py
true effect of a year of school: 0.060
slope, ability left out: mean 0.0839
slope, ability included: mean 0.0601
predicted bias 0.10 * 1.5 / (1.5**2 + 2**2) = 0.0240
Output 32.7. A true effect of 0.0600.060 estimated as 0.0840.084 on average.
Slopes from 1,000 simulated samples of 500 people: with ability in the regression they centre on the true 0.060 (dashed); left out, on 0.084.
Slopes from 1,000 simulated samples of 500 people: with ability in the regression they centre on the true 0.0600.060 (dashed); left out, on 0.0840.084.

The bias is the omitted variable’s effect on YY times the slope of the omitted variable on XX: 0.10×1.5/(1.52+22)=0.0240.10 \times 1.5/(1.5^2 + 2^2) = 0.024. The second university year derives this formula in general.

Definition 32.13 (Reverse causation)

There is reverse causation when YY affects XX, so that a slope of YY on XX mixes the effect of XX on YY with the effect of YY on XX.

"""Supply and demand shocks: the price-quantity slope is neither curve's (simulated)."""

import numpy as np

rng = np.random.default_rng(2026)
n = 10_000
u_d, u_s = rng.normal(0, 1, n), rng.normal(0, 2, n)  # demand and supply shocks
# demand q = 10 - p + u_d and supply q = 2 + p + u_s, solved for the market
p = (8 + u_d - u_s) / 2
q = (12 + u_d + u_s) / 2
print("demand slope -1, supply slope +1")
print(f"regression of quantity on price: slope {np.polyfit(p, q, 1)[0]:.3f}")
Listing 32.8. Prices and quantities moved by both curves. code/bachelor-1/32-simple-regression/listings/reverse.py
$ python reverse.py
demand slope -1, supply slope +1
regression of quantity on price: slope -0.599
Output 32.8. A slope of −0.6-0.6: neither the demand curve’s −1-1 nor the supply curve’s +1+1.

Price and quantity are set together by supply and demand. Regressing one on the other gives a mixture of the two curves, weighted by which one the shocks moved more. In this market the supply shocks have twice the standard deviation of the demand shocks, so the points trace out mainly the demand curve, and the slope is (1−4)/(1+4)=−0.6(1 - 4)/(1 + 4) = -0.6.

"""The same regression on the top-coded CPS sample."""

import numpy as np  # noqa: F401 -- np.log is used inside the formula strings
import statsmodels.formula.api as smf
from econdata import nsw

for name in ("psid_controls", "cps_controls"):
    d = nsw(name).query("re78 > 0")
    b = smf.ols("np.log(re78) ~ education", data=d).fit().params["education"]
    at_cap = (d.re78 == d.re78.max()).mean()
    print(f"{name:14s} n {len(d):6d}  slope {b:.4f}  share at the maximum {at_cap:.3f}")

# The cap alone, in one sample: cap the PSID men at the CPS maximum.
cap = nsw("cps_controls").re78.max()
p = (
    nsw("psid_controls")
    .query("re78 > 0")
    .assign(capped=lambda x: x.re78.clip(upper=cap))
)
b = smf.ols("np.log(capped) ~ education", data=p).fit().params["education"]
share = (p.re78 > cap).mean()
print(f"PSID capped at {cap:,.2f}: slope {b:.4f}, share capped {share:.3f}")
Listing 32.9. The same regression on the capped sample, and the PSID sample capped at the same level. code/bachelor-1/32-simple-regression/listings/cps_cap.py
$ python cps_cap.py
psid_controls  n   2204  slope 0.0885  share at the maximum 0.000
cps_controls   n  13820  slope 0.0433  share at the maximum 0.300
PSID capped at 25,564.70: slope 0.0621, share capped 0.407
Output 32.9. Capping flattens the line: the PSID slope falls from 0.08850.0885 to 0.06210.0621 when its earnings are capped at the CPS maximum.

Data problems bias slopes too. In the CPS sample 30%30\% of the men with earnings sit at the maximum the survey records, and its slope, 0.04330.0433, is half the PSID’s. But the two samples are different populations, so that comparison mixes the cap with everything else that differs between them. The cap’s own effect is measured within one sample: capping the PSID men at the CPS maximum, which binds for 40.7%40.7\% of them, lowers the slope from 0.08850.0885 to 0.06210.0621. Capping the highest earnings, which are those of the most schooled, flattens the line.

On the record — Returns to schooling

A regression of log earnings on schooling across people gives slopes like the opening chart’s. Card (1999) reviews the attempts to estimate the causal return: studies that use changes in the schooling system as natural experiments find returns 2020–40%40\% above the corresponding OLS estimates, and studies of twins suggest an upward ability bias of about 10%10\%. The cross-sectional slope is not the causal effect, but for the standard samples of these studies it is not far from it. The next volumes treat experiments, instruments and panels, the tools behind those estimates.

Exercises

Exercise 32.1 ★

Find the OLS slope and intercept for the points (8,9.4)(8, 9.4), (10,9.6)(10, 9.6), (12,9.9)(12, 9.9), (14,10.0)(14, 10.0), (16,10.3)(16, 10.3).

Solution

Solution of Exercise 32.1.

xˉ=12\bar x = 12, yˉ=9.84\bar y = 9.84; ∑(xi−xˉ)(yi−yˉ)=4.4\sum (x_i - \bar x)(y_i - \bar y) = 4.4 and ∑(xi−xˉ)2=40\sum (x_i - \bar x)^2 = 40, so β^1=0.11\hat\beta_1 = 0.11 and β^0=9.84−0.11×12=8.52\hat\beta_0 = 9.84 - 0.11 \times 12 = 8.52.

Exercise 32.2 ★

From Output 32.2, give the slope, its standard error and R2R^2.

Solution

Solution of Exercise 32.2.

Slope 0.08850.0885, standard error 0.0050.005 (0.004870.00487 unrounded), R2=0.1304R^2 = 0.1304.

Exercise 32.3 ★

A regression of log wages on years of experience has a slope of 0.060.06. Interpret it.

Solution

Solution of Exercise 32.3.

One more year of experience goes with wages about 6%6\% higher (100(e0.06−1)=6.18%100(e^{0.06} - 1) = 6.18\% exactly), on average across workers; it is a description, not yet an effect.

Exercise 32.4 ★

Predict the fitted log earnings of a PSID man with 16 years of schooling, and the earnings it corresponds to.

Solution

Solution of Exercise 32.4.

8.8172+16×0.0885=10.2338.8172 + 16 \times 0.0885 = 10.233, which corresponds to e10.233≈27,800e^{10.233} \approx 27{,}800 dollars — a typical (geometric-mean) value, below the mean earnings of such men.

Exercise 32.5 ★★

Prove that the residuals of an OLS regression with an intercept are uncorrelated with the fitted values.

Solution

Solution of Exercise 32.5.

∑iy^iu^i=β^0∑iu^i+β^1∑ixiu^i=0\sum_i \hat y_i\hat u_i = \hat\beta_0\sum_i \hat u_i + \hat\beta_1\sum_i x_i\hat u_i = 0 by Proposition 32.5, and the residuals have mean zero, so their sample covariance with y^\hat y is zero.

Exercise 32.6 ★★

Run the regression of log earnings on schooling for PSID men under 30 and for men over 40. Compare the slopes, with their standard errors.

Solution

Solution of Exercise 32.6.

Under 30: 953 men, slope 0.1170.117 (standard error 0.00970.0097). Over 40: 678 men, slope 0.09390.0939 (0.00740.0074). The difference, 0.0230.023, has a standard error of about 0.00972+0.00742=0.012\sqrt{0.0097^2 + 0.0074^2} = 0.012: about two standard errors, suggestive but not conclusive.

Exercise 32.7 ★★

Estimate the income elasticity of energy use in 2019 by a log–log regression on the countries of Chapter 3, with its standard error.

Solution

Solution of Exercise 32.7.

183 countries; slope 1.2471.247, standard error 0.0330.033: 1%1\% more income per person goes with 1.25%1.25\% more energy use per person, as Chapter 3 found.

Exercise 32.8 ★★

Family wealth raises both children’s schooling and their later earnings, through contacts. Predict the direction of the bias in the slope of earnings on schooling.

Solution

Solution of Exercise 32.8.

Upward: wealth raises earnings and is positively correlated with schooling, so the slope of earnings on schooling picks up part of wealth’s effect.

Exercise 32.9 ★★

Test at 5%5\% whether the PSID slope equals 0.100.10.

Solution

Solution of Exercise 32.9.

t=(0.0885−0.10)/0.00487=−2.36t = (0.0885 - 0.10)/0.00487 = -2.36, beyond −1.96-1.96: the slope is significantly below 0.100.10 at 5%5\%.

Exercise 32.10 ★★★

Derive the OLS estimator by minimising the sum of squared residuals, and prove Proposition 32.9 in your own steps.

Solution

Solution of Exercise 32.10.

Setting the derivatives of ∑i(yi−b0−b1xi)2\sum_i (y_i - b_0 - b_1x_i)^2 to zero gives ∑iu^i=0\sum_i \hat u_i = 0 and ∑ixiu^i=0\sum_i x_i\hat u_i = 0. The first gives β^0=yˉ−β^1xˉ\hat\beta_0 = \bar y - \hat\beta_1\bar x; substituting into the second and subtracting xˉ∑iu^i=0\bar x\sum_i \hat u_i = 0 gives ∑i(xi−xˉ)(yi−yˉ−β^1(xi−xˉ))=0\sum_i (x_i - \bar x)(y_i - \bar y - \hat\beta_1(x_i - \bar x)) = 0, hence β^1\hat\beta_1. Unbiasedness: write yi=β0+β1xi+uiy_i = \beta_0 + \beta_1x_i + u_i, so β^1=β1+∑i(xi−xˉ)ui/∑i(xi−xˉ)2\hat\beta_1 = \beta_1 + \sum_i (x_i - \bar x)u_i/\sum_i (x_i - \bar x)^2; given the xx’s, each E[ui∣x]=0\E[u_i \mid x] = 0, so the expectation is β1\beta_1.

Exercise 32.11 ★★★

Show that the slope of yy on xx times the slope of xx on yy equals r2r^2, and use it to explain why both slopes in Output 32.6 are below one.

Solution

Solution of Exercise 32.11.

The two slopes are sxy/sx2s_{xy}/s_x^2 and sxy/sy2s_{xy}/s_y^2; their product is sxy2/(sx2sy2)=r2s_{xy}^2/(s_x^2s_y^2) = r^2. With r2<1r^2 < 1 the two cannot both be at least one when the variances are similar; here 0.8368×0.6394=0.5350=0.731520.8368 \times 0.6394 = 0.5350 = 0.7315^2. Earnings in each year are partly transitory, so each year’s earnings predict the other’s with a slope below one.

Exercise 32.12 ★★★

What evidence would refute reading the 0.08850.0885 slope as the effect of a year of school?

Solution

Solution of Exercise 32.12.

Twins or siblings with different schooling but the same earnings; or a natural experiment — a change in school-leaving rules that raised schooling for some cohorts — with no matching rise in their earnings; or a slope that falls to near zero once measures of ability and family background enter.

32.8 Problem: Schooling and Earnings in Brenland

Problem 32.1

Weekend problem — the Brenland return to a year of school

Brenland’s household survey (invented) records the head’s years of schooling and the household’s gross income. Use the households with positive gross income. Part III uses a simulated cohort with an ability score, written by the same script with a fixed seed: true return 0.050.05, ability effect 0.080.08.

Part I — The regression.

  1. How many households have positive gross income?
  2. Give the mean and standard deviation of schooling.
  3. Regress log gross income on schooling: give the slope and intercept.
  4. Check that the residuals sum to zero.
  5. Give the fitted log income at 12 and at 16 years.
  6. By what factor does fitted income rise from 12 to 16 years?
  7. Give the slope of income in dalens on schooling.

Part II — Reading, fit and precision.

  1. Interpret the slope of item 3.
  2. Give the exact percentage it implies.
  3. Give R2R^2.
  4. Does a low R2R^2 mean that schooling matters little for income?
  5. Give the standard error and the tt statistic of the slope.
  6. Give a 95%95\% interval.
  7. Test whether the slope equals 0.100.10.

Part III — Hidden ability (simulated cohort).

  1. Give the slope of ability on schooling.
  2. Give the slope of log income on schooling alone.
  3. Give the slopes of schooling and ability when both enter.
  4. Check that the short slope minus the long one equals the ability coefficient times the slope of item 15.
  5. By how much does the short slope overstate the true 0.050.05?
  6. Why is the bias upward?
  7. Could the survey’s slope of item 3 be biased in the same way?

Part IV — A second variable (reported, not solved).

  1. Add the head’s age to the regression: give the new schooling slope.
  2. Give the age coefficient.
  3. Give the correlation of schooling and age, and say why the slope barely moves.
  4. When would adding a variable change the slope a lot?
  5. State the result.
Solution

Solution of Problem 32.1.

1. 1,922.

2. Mean 12.6312.63 years, standard deviation 2.592.59.

3. Slope 0.05800.0580, intercept 9.39569.3956.

4. The sum is 1.3×10−111.3 \times 10^{-11}: zero up to rounding error.

5. 10.09110.091 and 10.32310.323.

6. e4×0.058=1.261e^{4 \times 0.058} = 1.261: 26%26\% higher.

7. 1,841 dalens per year of schooling.

8. A year more of the head’s schooling goes with about 5.8%5.8\% more household income.

9. 100(e0.058−1)=5.97%100(e^{0.058} - 1) = 5.97\%.

10. 0.1080.108.

11. No: it means schooling leaves most of the variation unexplained; the slope is precisely estimated (item 12).

12. 0.00380.0038; t=15.3t = 15.3.

13. 0.05050.0505 to 0.06540.0654.

14. t=(0.058−0.10)/0.0038=−11.1t = (0.058 - 0.10)/0.0038 = -11.1: rejected.

15. 0.18880.1888.

16. 0.06280.0628.

17. Schooling 0.04530.0453, ability 0.09270.0927.

18. 0.0628−0.0453=0.0175=0.0927×0.18880.0628 - 0.0453 = 0.0175 = 0.0927 \times 0.1888.

19. By 0.01280.0128 (from 0.050.05 to 0.06280.0628).

20. Ability raises income and goes with more schooling, so the short regression credits schooling with part of ability’s effect.

21. Yes, if anything that raises income is also correlated with schooling; the survey has no ability measure to check.

22. 0.05910.0591.

23. −0.0034-0.0034: 0.34%0.34\% less income per year of age, schooling held fixed.

24. 0.0490.049: age is almost uncorrelated with schooling, so leaving it out biases the slope very little.

25. When the variable both affects income and is correlated with schooling, like ability in Part III; this is what multiple regression in the second university year handles.

26. The Brenland return to a year of the head’s schooling is 5.8%5.8\% (standard error 0.40.4 point) in the survey; if it carried an ability bias of the size simulated in Part III (1.3 points), the causal return would be about 4.5%4.5\%.

इस अध्याय में परिभाषित शब्द

शब्दावली के सभी 1086 शब्द देखें