You are on page 1of 24

A short introduction to applied econometrics Part D: Panel Data Analysis

presented by Dipl. Volkswirt Gerhard Kling

Advantages of panel analysis


More observations Pooling of cross sectional and time series data More degrees of freedom Stems from more observations Reduced multicollinearity Especially a problem in distributed lag model

Improved efficiency (unbiased estimator with smallest variance for all possible true parameter values)

Advantages of panel analysis


Wider range of problems Dynamics of change e.g. labor market participation Causality discussion Time structure facilitates discussion

you can test new hypothesis on individual behavior or policy changes that affect several entities

The importance of the data structure


Example: 11 countries over 10 years General note: cross-sectional dimension should be larger than time dimension But: many new models currently developed Very fertile field for research! I prefer the following data structure

The importance of the data structure


name Albania Albania Albania Albania Albania Albania Albania Albania Albania Albania Algeria Algeria Algeria Algeria Algeria Algeria Algeria Algeria Algeria Algeria

First crosssectional unit

Time dimension

code ALB ALB ALB ALB ALB ALB ALB ALB ALB ALB DZA DZA DZA DZA DZA DZA DZA DZA DZA DZA

year 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999

gdp 6,75179343 -11,4142038 -27,5896031 -5,69153612 11,1974627 9,1941036 7,55757392 7,73893405 -8,06352119

missing
2,29575915 -3,72084675 -3,55414336 -0,79384221 -4,35723136 -3,31007521 1,59040861 1,58921549 -1,03429441 1,44857954

sav pop 20,9783993 -13,0284996 -75,4131012 -33,6716003 -9,88263035 -3,94799995 -11,8118 -9,25912952 -6,69585991 -1,66910005 27,4666996 36,6562004 32,3755989 27,8384991 27,0359993 28,4333992 31,4230003 32,1985016 27,0669003 31,6912003

1,6 -0,2 -1,6 -1,4 0,2 1,2 1,3 1,2 1,1 1,1 2,5 2,4 2,4 2,3 2,2 2,2 2,2 2,2 2,1 2,1

Pooled regression
Combine both dimensions in one data set Neglect time and cross-sectional structure Run following regression with POLS/SOLS
gdpit ! E  Fsavit  Kpopit  eit

Thereby, i...countries, t...years

Pooled regression

. reg gdp pop sav variables pop sav Adjusted R2 F-test Observations coefficients -1.73028 0.1766935 0.10 6.20 (0.003) 95 t-values -1.95 3.51 p-values 0.055 0.001

Autocorrelation
Now time dimension; hence, correlation among successive residuals possible This affects t and p-values violates assumption E(eiteit-j)=0 for all j{0 How can we test for this problem? What can we do if we detect autocorrelation?

Autocorrelation
Stata should know that the data set is a panel Command: tsset (i) year note: i=cross-section Normal test commands for autocorrelation do not work; hence, develop own test (several procedures!)

Test for Autocorrelation


Run the following regression and estimate residuals

gdpit ! E  Fsavit  Kpopit  eit


Insert lagged residuals in regression

gdpit ! E  Fsavit  Kpopit  Veit 1  eit


Run t-test for autocorrelation coefficient H0: V=0 if rejected autocorrelation Note: AR(1) and assumption of strict exogenity!

Hint: Construction of Lags with Panel Data After regress command predict r, resid Then construct lagged residual gen r1=r[_n-1] Problem: Panel structure; thus, replace lagged values for first year (1990 in our case) replace r1=. if year==1990 Note: t-value reaches 4.62!

Robust Estimation Procedure


We estimate a so called long-run variance using the Newey-West (1987) procedure Estimation of variance-covariance matrix is now robust against heteroscedasticity and autocorrelation Command: newey2 gdp pop sav, lag(5) Number of lags = truncation (can be determined!)

Robust Estimation Procedure


Note: point estimates are the same!
. newey2 gdp pop sav, lag(5) variables constant pop sav Adjusted R2 F-test Observations coefficients -0.7222 -1.7303 0.1767 0.10 6.20 (0.003) 95 t-values -0.41 -2.28 2.62 p-values 0.679 0.025 0.010

GLS Estimation Procedure


Make assumptions regarding heteroscedasticity and autocorrelation Note: often called FGLS feasible! Command: xtgls then different specifications possible Can also be used to test for specific heteroscedasticity using log-likelihood ratio tests Note: If structure too complicated loss of degrees of freedom!

GLS Estimation Procedure

. xtgls gdp sav pop, corr(ar1) panels(hetero) force variables constant pop sav Wald chi2 Observations coefficients -0.2978 -0.3767 0.1012 3.41 (0.182) 95 z-values -0.22 -0.76 1.82 p-values 0.825 0.450 0.068

Pitfalls of GLS
Specification of form of autocorrelation and heteroscedasticity important If specification bad estimates are biased General: I would prefer this procedure for larger samples because more parameters need to be estimated Can be used to test for instance panel-level heteroscedasticity!

Fixed Effects Regression


Assumption: partial impact (slope) stays constant over time and across countries Different methods
Insert time dummies into regression Insert dummies for cross-sectional units Insert both types of dummies

Note: Sometimes dummies are not reported if too many!

Fixed Effects Regression


Useful command: areg you do not need to construct dummies by hand! areg gdp sav pop, absorb(i) areg gdp sav pop, absorb(year) both is not possible but use xi: reg gdp sav pop i.year i.i variables constant pop sav Adjusted R2 F-test Observations Year dummies -0.8954 (0.525) -1.5334 (0.099) 0.1705 (0.002) 0.07 5.27 (0.007) 95 Country dummies -3.8602 (0.106) -0.7835 (0.654) 0.2878 (0.005) 0.13 4.60 (0.013) 95 Both 2.2578 (0.582) -0.6431 (0.728) 0.2710 (0.017) 0.10 1.51 (0.102) 95

Fixed Effects Regression:


Joint F-tests indicate that neither time nor country dummies are relevant But: For a few countries dummies might be used General: You have to estimate lots of additional coefficients But: Widely applied and easy to interpret Note: Time dummies do not eliminate problems that may arise from stochastic trends!

Random Effects Regression


We assume the following regression
gdpit ! E  Fsavit  Kpopit  ui  eit

Individual effects are random Estimation with GLS or maximum likelihood procedure After estimation: Breusch-Pagan (1980) test or likelihood ratio test whether random effects should be assumed

Random Effects Regression


xtreg gdp pop sav, re random effects with group variable i (countries) Postestimation command: xttest0 carries out a LM test (H0: Var(ui)=0) xtreg gdp pop sav, mle maximum likelihood estimation Note: Likelihood ratio test is reported variables constant pop sav Wald chi2 LR test Observations GLS -0.9731 (0.518) -1.7037 (0.076) 0.1860 (0.001) 11.54 (0.003) 95 ML -0.7222 (0.590) -1.7303 (0.048) 0.1767 (0.000) 12.01 (0.003) 95

Test whether random effects should be used LM test 0.11 (0.736) LR test 0.00 (1.000)

Which Procedure should we use?


Neither fixed nor random effects are superior Little evidence that individual effects matter Hence: stick to POLS/SOLS pooled regression Maybe: use dummies for extreme countries Check stability of coefficients over time (goes beyond the scope of the course!)

The Causality Issue


Note: We assume that current saving rate and population growth rate affect GDP growth rate But: Possible that causality goes the other way round! Solution: VAR model test for Granger causality Result: Savings and population growth rate Granger cause GDP growth rate and not vice versa!

Additional Issues
Stochastic trends in panel data
Spurious regressions Unit-root tests panel based; thus, more observations First differencing or deviation from common trends

Long-term equilibriums and cointegration

You might also like