本书暂未推出简体中文版。现有版本:English。
University Economics — Year 3 · 本科三年级
2Panel Data
Richer countries emit more carbon dioxide per person. Across 200 countries, a country whose income per person is one log point higher emits, on average, 2.7 more tonnes per person. Follow each country over time instead, and the slope shrinks to about one tonne. Both numbers come from the same 6,419 observations. The first compares countries with each other; the second compares each country with itself in other years. They differ because countries differ in many fixed ways — coal under the ground, a cold winter, a car-built city — that go with both their income and their emissions. A data set that follows the same units over time can take those fixed differences out, without measuring them. This chapter is about how, at what price, and what the method cannot remove.
The left panel is the familiar cross-section. The rich oil producers sit high above the line, and several rich countries with nuclear or hydroelectric power sit below it. The right panel removes every country’s average income and average emissions, so that a country only ever meets itself: a year in which it was ten per cent richer than its own average is compared with its own average emissions. That slope, 1.0, is less than half of the slope across countries, 2.7. Note the horizontal scale of the right panel. Almost all the variation in income is between countries. What is left inside them is a band of a few tenths of a log point, and the within slope is estimated from that narrow band alone.
You already know
The Year 1 volume introduced panel data as a data shape: the same units observed at several dates. The Year 2 volume proved the Frisch–Waugh–Lovell theorem (the coefficient on in a regression on and is the slope of on the part of that does not predict), derived omitted-variable bias, and defined cluster-robust standard errors and the Moulton factor. Chapter 1 met an endogenous regressor and one cure, the instrument.
Notation 2.1 (Symbols of this chapter)
A unit (a country, a firm) is and a period ; here is the length of the panel, not taxes. The unit effect is and a period effect . A bar over a variable is its mean over the periods of one unit, , and a double dot the deviation from it, .
2.1 The same units over time
The model of this chapter is
The unit effect collects everything about unit that does not change over the panel and affects . It is not observed. It may be correlated with , and in most applications it is: the reason to use a panel is that it is. The condition on , called strict exogeneity, says that the remaining error is unrelated to the regressor in every period, past and future.
Definition 2.2 (Pooled regression)
The pooled regression is the OLS regression of on (and a constant) over all observations, ignoring which unit each comes from.
The pooled regression leaves in its error. By the omitted-variable formula, its slope converges to . The figure below shows the pattern with three units: within each unit the relation has slope , but the units with high also have high , and the pooled line, steeper than any of them, joins the clouds.
2.2 Fixed effects
Definition 2.3 (Unit fixed effect, within estimator)
In model (2.1), treating as a parameter to be estimated for each unit makes it a unit fixed effect. The within estimator (or fixed-effects estimator) of is the OLS slope of the deviations on the deviations :
Averaging model (2.1) over gives ; subtracting it from the model removes : . Under strict exogeneity, , which contains and hence the errors of every period, is uncorrelated with , and the within estimator is consistent as grows. Whatever is, and however it is related to , it is gone.
Proposition 2.4 (Within estimator and unit dummies)
The within estimator equals the coefficient on in the OLS regression of on and unit dummies , where if .
Proof. By the Frisch–Waugh–Lovell theorem, the coefficient on is the slope of on the residual of after a regression of on the dummies. Regressing on the dummies fits one constant per unit, and the least-squares constant for unit is the unit’s mean, . The residual is . The theorem also allows to be replaced by its own residual, , so the coefficient is . ∎
The dummies give the same slope with more parameters; the within transform gives it without them. Either way, the degrees of freedom of the residual variance are , a point that software using the transform must handle.
Definition 2.5 (First-difference estimator)
The first-difference estimator of is the OLS slope of on , for .
Differencing also removes . With two periods the two estimators are identical (Exercise 2.10). With more, they weight the data differently and are both consistent under strict exogeneity; they differ when the errors are serially correlated, when is measured with error, and when the model is wrong. A gap between them is a warning worth reading.
Definition 2.6 (Two-way fixed effects)
The two-way fixed effects model adds a period effect to model (2.1): . It is estimated with unit and period dummies, or, in a balanced panel, by the slope of on the same transform of .
Listing 2.1 computes the slopes behind the opening chart.
"""Carbon dioxide and income: pooled, between, within and two-way slopes."""
import numpy as np
import statsmodels.formula.api as smf
from econdata import wdi
co2 = wdi("EN.GHG.CO2.PC.CE.AR5", since=1990, until=2022, countries_only=True)
gdp = wdi("NY.GDP.PCAP.KD", since=1990, until=2022, countries_only=True)
d = co2.merge(gdp, on=["iso3", "year"], suffixes=("_co2", "_gdp"))
d = d.rename(columns={"value_co2": "co2"}).dropna(subset=["co2", "value_gdp"])
d["ly"] = np.log(d.value_gdp)
print(f"countries {d.iso3.nunique()}, country-years {len(d)}")
pooled = smf.ols("co2 ~ ly", d).fit().params["ly"]
means = d.groupby("iso3")[["co2", "ly"]].mean()
between = smf.ols("co2 ~ ly", means).fit().params["ly"]
w = d[["co2", "ly"]] - d.groupby("iso3")[["co2", "ly"]].transform("mean")
within = (w.ly @ w.co2) / (w.ly @ w.ly)
dummies = smf.ols("co2 ~ ly + C(iso3)", d).fit().params["ly"]
twoway = smf.ols("co2 ~ ly + C(iso3) + C(year)", d).fit().params["ly"]
for name, b in [("pooled", pooled), ("between", between), ("within", within),
("country dummies", dummies), ("country and year", twoway)]:
print(f"{name:18s}{b:8.3f}")
share = (w.ly @ w.ly) / ((d.ly - d.ly.mean()) @ (d.ly - d.ly.mean()))
$ python pooled_vs_within.py
countries 200, country-years 6419
pooled 2.756
between 2.716
within 0.999
country dummies 0.999
country and year 2.068
share of the variance of log income that is within: 0.036
The pooled and between slopes are close, 2.756 and 2.716, because most of the variation is between countries; only 3.6 % of the variance of log income is within. The within slope and the slope with 200 country dummies agree to every printed digit, 0.999, as Proposition 2.4 requires. Adding year effects doubles it, to 2.068. The year effects take out what all countries share in a year: world income rose over the period while some large rich emitters cut their emissions per person, so a common time path pulled the one-way within slope down. Which slope answers which question is the subject of Section 2.4.
Model — The fixed-effects model
Assumes. Each unit has a constant unobserved level , possibly correlated with ; the slope is the same for all units; the remaining error is unrelated to the regressor in every period (strict exogeneity).
Predicts. The within and first-difference estimators agree, up to sampling error; adding variables that are fixed for each unit changes nothing; regressing on future values of gives nothing once current is in.
Tested. Not once for all: its predictions are checked in each application, by comparing within, first-difference and two-way estimates and by the lead test of Exercise 2.12. One of its working assumptions has been tested on real data and failed: errors independent over time. In state panels of female wages, placebo laws came out significant far more often than 5 % (Section 2.5; Bertrand, Duflo and Mullainathan 2004).
Breaks. When the confounder changes over time (a new manager, a policy that moves with the business cycle); when today’s responds to yesterday’s (feedback, as in a dynamic panel, Section 2.6); when the slope differs across units, in which case the within estimator is a weighted average of unit slopes, weighted by each unit’s variance of .
2.3 Random effects
The fixed-effects estimator throws away the between variation, which is most of the data. If were known to be uncorrelated with , nothing would need throwing away: the pooled regression would be consistent, but its errors would be correlated within each unit, and a better estimator would use that structure.
Definition 2.7 (Random-effects estimator)
In model (2.1), suppose has variance , has variance , and both are uncorrelated with each other and with . The random-effects estimator is the OLS slope after quasi-demeaning, on (with a constant), where , the variances being replaced by estimates.
The weight runs from 0, when there is no unit effect and random effects is the pooled regression, to 1, when the unit effect dominates and random effects is the within estimator. It is the generalised least squares estimator for this error structure.
Proof. Admitted at this level. ∎
The proof that quasi-demeaning makes the composite errors uncorrelated with equal variances is a computation with the covariance matrix , found in graduate texts on panel econometrics.
Proposition 2.8 (When random effects is consistent)
Under strict exogeneity of , and with , the random-effects estimator is consistent if and in general inconsistent otherwise.
Proof. After quasi-demeaning, the error of the transformed model is . The terms in are uncorrelated with the transformed regressor by strict exogeneity. The term is uncorrelated with it if and only if , which holds when is uncorrelated with in every period. When it is not, the transformed error is correlated with the transformed regressor and the omitted-variable formula gives a bias proportional to . ∎
"""Random effects against fixed effects, when the unit effect is and is not
correlated with the regressor (a simulated panel, true slope 1)."""
import numpy as np
rng = np.random.default_rng(3)
n, t = 500, 6
def estimates(link):
a = rng.normal(0, 1, n) # unit effect
x = link * a[:, None] + rng.normal(0, 1, (n, t))
y = 1.0 * x + a[:, None] + rng.normal(0, 1, (n, t))
xw = x - x.mean(1, keepdims=True) # within transform
yw = y - y.mean(1, keepdims=True)
fe = (xw * yw).sum() / (xw * xw).sum()
e = yw - fe * xw
s2_u = (e * e).sum() / (n * (t - 1) - 1) # variance of u
xb, yb = x.mean(1), y.mean(1)
bb = np.cov(xb, yb)[0, 1] / np.var(xb, ddof=1)
s2_bar = np.var(yb - bb * xb, ddof=2) # variance of a + mean u
theta = 1 - np.sqrt(s2_u / (t * s2_bar))
xq = x - theta * x.mean(1, keepdims=True) # quasi-demeaning
yq = y - theta * y.mean(1, keepdims=True)
xq, yq = xq - xq.mean(), yq - yq.mean()
re = (xq * yq).sum() / (xq * xq).sum()
return fe, re, theta
print("corr(a, x) FE RE theta")
for link in (0.0, 0.5):
fe, re, theta = estimates(link)
corr = link / np.sqrt(link**2 + 1)
print(f"{corr:8.2f} {fe:.3f} {re:.3f} {theta:.3f}")
$ python random_effects.py
corr(a, x) FE RE theta
0.00 0.996 0.999 0.610
0.45 1.003 1.149 0.467
With the unit effect unrelated to , both estimators find the truth, 0.996 and 0.999. When the correlation is 0.45, the fixed-effects estimate stays at 1.003 and random effects moves to 1.149. The comparison is the logic of the Hausman test: under the null that is unrelated to the two estimates converge to the same value, and a large gap rejects random effects. In observational economics the null rarely survives. A useful compromise, due to Mundlak (1978), adds the unit means to a random-effects regression; the coefficient on is then exactly the within estimate, and the coefficient on measures how far between and within disagree.
2.4 What variation identifies the coefficient
Definition 2.9 (Identifying variation)
The identifying variation of an estimator is the part of the variation of the regressor that the estimator uses: the variation left in after the fixed effects and controls are removed, which by the Frisch–Waugh–Lovell theorem is all the slope depends on.
The definition turns a statistical fact into a question about the world. The within slope of the opening chart uses only the 3.6 % of income variation that happens inside countries over three decades: booms, recessions, and three decades of growth. Its comparison is between a country in a good year and the same country in a bad one, and a bad year’s emissions fall for reasons that have to do with the energy used in a recession, not with the slow change in technology that the between slope reflects. The two slopes answer different questions, and neither is the long-run effect of becoming richer on emissions.
How it is measured — What a fixed effect absorbs
A unit fixed effect absorbs every variable that is constant within the unit over the panel: geography, climate, legal origin, the energy endowment, a firm’s founding year. Their coefficients cannot be estimated with unit effects, and a regression that reports one is reporting noise or a collinearity the software resolved silently. A period effect absorbs everything common to all units in a period: world prices, global recessions, a change in a survey’s method. What is left — the identifying variation — is often small: 3.6 % of the variance of log income in the opening chart. Two consequences follow. Measurement error, which is mostly within-unit noise, becomes a larger share of what is left, so attenuation bias is worse in the within estimate than in the pooled one. And the standard errors of a fixed-effects estimate are larger, honestly, because there is less information.
2.5 Errors that move together: clustering in panels
In a panel, a unit’s errors are rarely independent from one year to the next. A firm that has a good year tends to have a good next year, and a state’s wage level drifts slowly. When the regressor is also persistent — a law that switches on and stays on — the observations of one unit carry much less information than their number suggests. Classical and heteroskedasticity-robust standard errors both assume independent observations; cluster-robust standard errors, clustered by unit, allow any correlation within a unit and none across units.
On the record — Placebo laws
Bertrand, Duflo and Mullainathan (2004) took state-level data on women’s wages from the Current Population Survey, about twenty years of it, and assigned laws at random to states and dates. The laws were fictitious and could have no effect. Estimated with state and year effects and conventional standard errors, up to 45 % of these placebo laws had an “effect” significant at 5 %. Clustering the standard errors by state, or collapsing each state’s data into a before and an after period, brought the rejection rate close to the nominal 5 % when the number of states was large. The paper changed the default: in a panel, cluster at the level at which the treatment is assigned.
Listing 2.3 repeats the experiment on simulated data with 50 states, 20 years and errors whose persistence is 0.8.
"""Placebo laws: 50 states, 20 years, errors that persist within a state.
How often does a law with no effect look significant at 5 %?"""
import numpy as np
from paneltools import ols_cluster
rng = np.random.default_rng(8)
states, years, reps, rho = 50, 20, 500, 0.8
unit = np.repeat(np.arange(states), years)
reject = {"se_iid": 0, "se_hc1": 0, "se_cluster": 0}
def two_way(m):
"""Remove state and year means (exact for a balanced panel)."""
return m - m.mean(1, keepdims=True) - m.mean(0) + m.mean()
for _ in range(reps):
e = np.zeros((states, years))
e[:, 0] = rng.normal(size=states)
for s in range(1, years): # AR(1) inside each state
e[:, s] = rho * e[:, s - 1] + np.sqrt(1 - rho**2) * rng.normal(size=states)
treated = rng.permutation(states) < states // 2
start = rng.integers(5, 16)
law = (treated[:, None] & (np.arange(years) >= start)).astype(float)
y, x = two_way(e).ravel(), two_way(law).ravel()
r = ols_cluster(y, x, unit)
for k in reject:
reject[k] += abs(r["beta"][0] / r[k][0]) > 1.96
for k, v in reject.items():
print(f"{k:11s} rejects the true zero in {v / reps:.3f} of the samples")
ols_cluster returns the three kinds of standard error. code/bachelor-3/02-panel-data/listings/cluster_sim.py$ python cluster_sim.py
se_iid rejects the true zero in 0.396 of the samples
se_hc1 rejects the true zero in 0.392 of the samples
se_cluster rejects the true zero in 0.066 of the samples
Conventional and robust standard errors reject the true zero in about 40 % of the samples; clustered errors in 6.6 %. (The listing divides by rather than by the degrees of freedom left after the state and year means are removed, which makes the conventional and robust errors about 3.5 % too small and flatters their rejection rates a little; the clustered rate is barely affected.) Clustering is not free: it needs many clusters, since its justification is asymptotic in the number of clusters. With fewer than about thirty or forty, clustered standard errors are themselves too small, and methods that resample whole clusters are used instead.
2.6 Dynamic panels
Many economic variables depend on their own past: this year’s employment on last year’s, this year’s income on last year’s. The natural model is
Here strict exogeneity cannot hold: the regressor depends on , which sits inside , which sits inside the demeaned error.
Definition 2.10 (Dynamic panel bias)
The dynamic panel bias (Nickell bias) is the inconsistency, as grows with fixed, of the within estimator of in a model with a lagged dependent variable and unit effects.
For large the bias is approximately (Nickell 1981).
Proof. Admitted at this level. ∎
The exact expression is a ratio of two sums of geometric series; its derivation, and the approximation, are in Nickell’s paper. The chart shows a simulation.
With five periods the estimate is 0.168 instead of 0.5; with thirty, 0.448.
In a panel of countries over decades the bias is small; in a panel of firms over five years it is most of the estimate. The cure is the tool of Chapter 1. In first differences, is correlated with through , but , dated before that error, is not: under no serial correlation in , the level two periods back is a valid instrument for the lagged difference. Estimators built on this idea, using every earlier level as an instrument, are standard in dynamic panels, and so are their weak-instrument problems when is close to one.
2.7 Exercises
Exercise 2.1 ★
Read the opening chart.
- State the between and within slopes in tonnes per person per log point, and say which comparison each one makes.
- Give two characteristics of a country that are roughly fixed over three decades and raise both its income and its emissions.
- The right panel’s horizontal axis runs from to . Why is it so much narrower than the left panel’s range of log incomes?
Solution
Solution of Exercise 2.1.
- Between: 2.7 tonnes per log point, comparing countries’ averages with each other. Within: 1.0, comparing each country’s years with its own average.
- An endowment of coal, oil or gas, which makes energy cheap and exports valuable; a cold climate, which raises both heating and, through the industries it favours, income. A large car-based territory also fits.
- Most of the variation in income is between countries: incomes differ by a factor of a hundred across countries, but one country’s income moves by a few tenths of a log point around its own average over three decades.
Exercise 2.2 ★
Unit A has in three years, and unit B has .
- Compute the pooled slope.
- Compute the deviations from each unit’s means and the within slope.
- Draw the six points and explain the difference.
Solution
Solution of Exercise 2.2.
- and . The cross-products sum to and the squares of to : the pooled slope is .
- Unit A: , ; deviations , . Unit B: , ; , . Then and : the within slope is .
- The two clouds each rise by about 1.5 per unit of , but B’s lies higher and further right, so a single line through all six points (2.057) is steeper than either.
Exercise 2.3 ★
For the data of Exercise 2.2, compute the first differences and the first-difference slope, without a constant. Why can the slope not be estimated with a constant in these data?
Solution
Solution of Exercise 2.3.
Unit A: , ; unit B: , . The slope without a constant is . Every equals 1, so is collinear with a constant: a regression with a constant cannot separate the slope from the intercept.
Exercise 2.4 ★
The fixed-effects model assumes that the unit effect is constant over the panel. Describe two results, from data you could compute with the opening chart’s panel, that would show it is not.
Solution
Solution of Exercise 2.4.
First, split the panel into 1990–2005 and 2006–2022 and estimate the within slope in each; with constant unit effects and a constant slope, the two agree up to sampling error. Second, compare the within and first-difference estimates: if a slowly changing unit effect (a drift in each country’s energy mix) were left in the error, the two would weight it differently and disagree. A third check: the residuals of the within regression should show no trend inside countries.
Exercise 2.5 ★★
Using the panel of Listing 2.1 and the helpers twoway_demean and ols_cluster, estimate the within slope with country effects only and with country and year effects, each with conventional and country-clustered standard errors.
- Report the four standard errors and the ratio of clustered to conventional.
- By how much did the cross-country mean of log income rise between 1990 and 2022? Use it to explain why the year effects change the slope.
Solution
Solution of Exercise 2.5.
The tested solution is ex05_year_effects.py, in the chapter’s exercises/ folder.
- Country effects: slope 0.999, conventional s.e. 0.122, clustered 0.265, ratio 2.17. Country and year effects: 2.068, 0.164 and 0.450, ratio 2.74.
- The cross-country mean of log income rose by 0.576. A common rise in income, with emissions per person in several large rich countries falling over the same years, makes the year-to-year co-movement shared by all countries negative or weak; the year effects remove it, and what remains, each country’s movement relative to the world’s that year, has a steeper slope.
Exercise 2.6 ★★
Suppose that, among countries, the richer ones have cleaner technologies for reasons that do not change over the panel, so in a regression of emissions on log income.
- In which direction is the between slope biased?
- The opening chart’s between slope exceeds its within slope. Is that consistent with this story alone? What else must be at work?
Solution
Solution of Exercise 2.6.
- Downward: the omitted unit effect is negatively correlated with income, so the between slope is below the true slope.
- No. On this story alone, the between slope would be smaller than an unbiased within slope, yet the chart shows it larger. Some fixed characteristics that raise income must also raise emissions (fossil endowments, climate) and outweigh the clean-technology effect; or the within slope is itself small for other reasons, such as measurement error or the short-run nature of within variation.
Exercise 2.7 ★★
In Exercise 2.5, the within slope has a conventional standard error of 0.122 and a clustered one of 0.265.
- Compute the ratio of the two variances (the design effect).
- Dividing the 6,419 country-years by the design effect gives an “effective” number of independent observations. Compute it.
- Give a 95 % confidence interval for the within slope with each standard error.
Solution
Solution of Exercise 2.7.
- .
- effective observations.
- Conventional: , from 0.760 to 1.238. Clustered: , from 0.480 to 1.518.
Exercise 2.8 ★★
In Output 2.2, the gap between random and fixed effects is 0.003 in the first panel and 0.146 in the second.
- Which estimate moves when the unit effect becomes correlated with , and why does the other not?
- The weight is 0.610 in the first panel. Compute and compare it with the true value when and .
Solution
Solution of Exercise 2.8.
- Random effects moves; fixed effects does not. The within transform removes entirely, so its correlation with cannot reach the estimate. Random effects removes only the share of each unit’s mean and leaves in the error (Proposition 2.8).
- . The true value is , so the true is ; the estimate, 0.610, is close.
Exercise 2.9 ★★
Repeat Listing 2.1 with the total fertility rate (SP.DYN.TFRT.IN) in place of emissions, for 1990–2022.
- Report the between and within slopes.
- Unlike emissions, the two slopes are close. What does that suggest about the fixed differences between countries, for this variable?
Solution
Solution of Exercise 2.9.
The tested solution is ex09_fertility.py, in the chapter’s exercises/ folder.
- Over 213 countries: between , within births per woman per log point of income.
- The fixed differences between countries are not strongly correlated with income in a way that also moves fertility; whatever the fixed effects absorb does not change the slope much. The two slopes can still both be far from a causal effect: income and fertility move together inside countries for reasons, such as women’s schooling, that change over time.
Exercise 2.10 ★★★
Prove that with the within estimator and the first-difference estimator (without a constant) are equal.
Solution
Solution of Exercise 2.10.
With , , so and , with ; the same holds for . Then
and the ratio is , the first-difference estimator without a constant.
Exercise 2.11 ★★★
Simulate the dynamic panel of Section 2.6 with and 500 units, for , 10 and 20.
- Report the mean within estimate over 200 panels and its bias.
- Compare the bias with . For which is the approximation good?
Solution
Solution of Exercise 2.11.
The tested solution is ex11_nickell.py, in the chapter’s exercises/ folder.
- Mean estimates 0.168, 0.337 and 0.421 for , 10 and 20; biases , and .
- The approximation gives , and . It is good from on and overstates the bias at , as an approximation for large may.
Exercise 2.12 ★★★
Strict exogeneity can fail through feedback: a shock to this year changes next year.
- Show that under feedback, is correlated with even when is uncorrelated with .
- Propose a test: add the lead to the within regression. Under strict exogeneity, what should its coefficient be? Under feedback, what sign do you expect if raises future ?
Solution
Solution of Exercise 2.12.
- contains for every , including . Under feedback, depends on , so and hence , even if .
- Under strict exogeneity, is unrelated to and its coefficient is zero. If a positive shock this year raises next year, the lead is positively correlated with : its coefficient is positive.
2.8 Problem: Fifteen Years of Brenland’s Firms
Problem 2.1
Weekend problem — fifteen years of Brenland’s firms
Brenland (invented) keeps a register of 300 manufacturing firms, observed every year from 2011 to 2025: 4,500 firm-years. For each firm-year it records the logarithm of output and of capital . The quality of a firm’s management, , is not recorded; it raises output with a coefficient of 0.5 per standard deviation and is the same in every year. In 2018 a training subsidy was given to 100 firms, chosen by a panel that judged, among other things, how well they were run; for those firms from 2018 on. The table gives the estimates of a statistician, with standard errors computed twice: as if all firm-years were independent, and clustered by firm. In the register, the variance of is 0.8675 and its covariance with is 0.9512.
Here “within” uses firm effects, “two-way” firm and year effects, and “first difference” regresses on .
Part I — the pooled regression.
- Interpret the pooled coefficient on in words, as an elasticity.
- Use the omitted-variable formula and the register’s variance and covariance to predict the probability limit of the pooled slope, if the true elasticity is 0.30.
- Compare your prediction with the pooled estimate.
- Why can the statistician not simply add management quality to the regression?
- If better-run firms used less capital, in which direction would the pooled estimate be biased?
- Compute the ratio of the clustered to the iid standard error of the pooled slope. Is a precise standard error a reason to trust the estimate?
Part II — within and first differences.
- Interpret the within estimate, and say which comparisons it makes.
- The within and first-difference estimates differ by about 0.05. Give two reasons why they may differ.
- The two-way estimate is closer to 0.30 than the within estimate. What does the year effect remove?
- Give a 95 % confidence interval for the two-way coefficient on with the clustered standard error.
- What part of the variation in capital identifies the two-way estimate?
- A consultant advised some firms from 2015 and, she says, raised both their capital and their output. Would the two-way estimate still be consistent? Explain.
Part III — the training subsidy.
- Why is the pooled estimate of the subsidy’s effect likely to be biased upward?
- Compare the pooled and two-way estimates of the subsidy’s effect.
- Convert the two-way estimate into a percentage change in output.
- With firm and year effects, which comparison identifies the subsidy’s effect?
- What must be true of the treated and untreated firms’ output paths for that comparison to give the effect of the subsidy?
- How would you use the years 2011–2017 to check that assumption?
- Suppose the panel had picked firms whose output had just fallen. In which direction would the two-way estimate be biased?
Part IV — the standard errors.
- Compute the ratio of the clustered to the iid standard error of the two-way subsidy estimate, and its square.
- Give 95 % confidence intervals for the subsidy’s effect with each standard error.
- Why is the iid standard error too small here? Name the two features of the data that combine.
- If the design effect (your square from Question 20) is with , what correlation does it imply?
- How many independent firm-years is the panel worth for this coefficient?
- State the two results of this problem, each with its clustered 95 % interval.
Solution
Solution of Problem 2.1.
1. Across firm-years, 1 % more capital goes with 0.87 % more output.
2. .
3. The pooled estimate is 0.868, close to the prediction; the rest comes from the subsidy and the year shocks, also left in the pooled error.
4. It is not recorded. Any measure of it — a survey score, a manager’s degree — would be partial and noisy, and the omitted part would remain.
5. Downward: the covariance of capital with management would be negative.
6. . No: the standard error measures sampling noise around the wrong number. A biased estimate can be very precise.
7. Within a firm, a year in which capital is 1 % above the firm’s own average has output 0.35 % above its average. The comparisons are between years of the same firm.
8. The errors are serially correlated, and the two estimators weight the years differently; and the year shocks common to all firms enter both differently, because capital trends upward and the within transform compares each year with the firm’s whole-period average, while differences compare adjacent years. Measurement error in capital would also hit them differently.
9. Shocks common to all firms in a year (demand, prices). Capital rises on average over time, so any common year shock that happens to line up with that trend is attributed to capital by the one-way within estimate.
10. , from 0.289 to 0.347.
11. The movements of each firm’s capital around its own average, net of the movement common to all firms in that year.
12. No. The advice changes over time (it starts in 2015) and moves both capital and output; it is a time-varying confounder, which neither firm nor year effects remove.
13. The panel picked better-run firms, and management raises output. Capital in the regression captures only part of management, so the subsidy dummy picks up the rest.
14. Pooled 0.122, two-way 0.110. The pooled estimate is larger, as Question 13 predicts, but here by little, because capital already absorbs much of the management difference.
15. : output 11.6 % higher.
16. The change in output of subsidised firms from before 2018 to after, compared with the change of unsubsidised firms over the same years.
17. Without the subsidy, the output of treated and untreated firms would have moved in parallel after 2018: their gap could be anything, but not its change.
18. Estimate the gap between treated and untreated firms year by year for 2011–2017; it should be flat. A trend in it before 2018 would undermine the assumption.
19. Upward: output that has just fallen tends to recover by itself, and the recovery would be counted as the subsidy’s effect.
20. ; its square is .
21. iid: , from 0.0885 to 0.1317. Clustered: , from 0.0746 to 0.1456.
22. The errors persist within a firm from year to year, and the regressor persists too: the subsidy is on for eight years in a row for the same firms. Together they make the firm-years of one firm far from independent.
23. , so .
24. firm-years.
25. Inside firms, net of year shocks, the elasticity of output with respect to capital is 0.318, with a clustered 95 % interval of 0.289 to 0.347. The training subsidy raised output by 0.110 log points (11.6 %), with a clustered 95 % interval of 0.075 to 0.146, if treated and untreated firms would otherwise have moved in parallel.