Panel Data Stata
Panel Data Stata
Gunajit Kalita
Rio Tinto India
Content
• Panel data can better detect and measures effects that simply can not be
observed in pure cross section or time series data.
Unobservable • For example, the effect of minimum wage laws on employment and
earnings can be better studied if we include successive waves of
minimum wage increase in the federal and/or state minimum wages
Data requirement
• Basic panel methods require at least two
“waves” of measurement
Consider services share of GDP in a
country and its economic development
(GDP per capita) in the last three decades
• One way to construct your panel is to
create a single record for each combination
of unit (country, firm, individual) and time
period
• Data include:
• A time-invariant unique identifier for
each unit (country, firm, individual)
• A time-varying outcome (Services
share in GDP, GDP, Inflation)
• An indicator of time (Year, Quarter,
Month, day)
• The default standard errors erroneously assume errors are independent over i for
given t.
Individual-specific effects model
• We assume that there is unobserved heterogeneity across individuals captured by i
Example: unobserved ability of an individual that affects wages
• The main question is whether the individual-specific effects i are correlated with
the regressors.
• If they are correlated, we have the fixed effects (FE) model. If they are not
correlated we have the random effects (RE) model
7
ˆ ˆ '
H RE FE V ˆRE V ˆFE ˆRE ˆFE
9
80
nature of that association. Here we
identify two waves of service sector
Services (% of GDP)
growth…”
60
• They identify two waves of service
sector growth, a first wave in
40
countries with relatively low levels of
per capita GDP and a second wave
in countries with higher per capita 20
incomes
• There is evidence of the second
0
sigma_u 10.817956
sigma_e 5.8722998
rho .7724016 (fraction of variance due to u_i)
OLS or RE or Fe
Breusch and Pagan Lagrangian multiplier test for random effects
STATA Commands:
ser_sh[con_cod,t] = Xb + u[con_cod] + e[con_cod,t]
• Breusch-Pagan Lagrange Multiplier
Estimated results:
(LM) test: OLS vs RE Var sd = sqrt(Var)
Coefficients
hausman fe re
13
Prediction
STATA Commands:
• Prediction fitted value including
individual-specific effects
70
predict yhat, xbu
Services share of GDP (%)
1990 2000
•
60
Prediction standard error of the
fitted values
predict se, stdp
50
• Prediction standard error band
40
gen up_se=yhat+2*se
gen low_se=yhat-2*se
30
• Lowess Curve 4 6 8 10 12
Log Per Capita GDP at PPP
References
• Panel data analysis, Princeton University, http://dss.princeton.edu/training/
• Econometric Academy by Ani Katchova,
https://sites.google.com/site/econometricsacademy/econometrics-models
• Introduction to Regression Models for Panel Data Analysis, Indiana University by
Prof. Patricia A. McManus, http://www.indiana.edu/~wim/docs/10_7_2011_slides.pdf
• Econometric analysis using Panel Data by Ranjit Kumar Paul,
http://www.iasri.res.in/sscnars/socialsci/12-Panel%20data.pdf
• Robust Standard Errors for Panel Regressions with Cross-Sectional Dependence by
Daniel Hoechle, http://fmwww.bc.edu/repec/bocode/x/xtscc_paper.pdf
• Two Waves of Services Growth by Poonam Gupta and Barry Eichengreen, NBER
Working Paper no. 14968, http://www.nber.org/papers/w14968.pdf
16
Thank You
Gunajit Kalita
[email protected]
[email protected]
My Blog: http://macroscan.wordpress.com/