
Regression with panel data: an Introduction Professor Bernard Fingleton What does panel (or longitudinal) data look like? • Each of N individual’s data is measured on T occasions • Individuals may be people, firms, countries etc • Some variables change over time for t = 1,…,T • Some variables may be fixed over the time period, such as gender, the geographic location of a firm or a person’s ethnic group • When there are no missing data, so that there are NT observations, then we have a balanced panel (less than NT is called an unbalanced panel) • Typically N is large relative to T, but not always • Example of a simple panel GDP pc Log % no school Log av. Yrs school year countriesx4 lnGDP_per_ lnno_sch_% lnav_yrs_sch fed[2] fed[3] fed[4] 1970 Argentina 2.226235129 2.174751721 1.771556762 0 0 0 1970 Australia 2.696003468 0.336472237 2.311544834 1 0 0 1970 Austria 2.413729352 1.458615023 1.947337701 0 1 0 1970 Bangladesh 0.099447534 4.453183829 -0.162518929 0 0 1 2000 Argentina 2.398482048 1.840549633 2.138889 0 0 0 2000 Australia 3.240990085 0.993251773 2.3580198 1 0 0 2000 Austria 3.164481031 0.587786665 2.174751721 0 1 0 2000 Bangladesh 0.521101364 4.028916757 0.896088025 0 0 1 • T = 2, t = 1…T time periods Fixed effect dummies • N = 4, n = 1,…,N individuals • K = 5, k = 1,…,K independent variables Notation Yit = dependent variable value for individual i at time t X 1it = independent variable 1 value for individual i at time t X 2it = independent variable 2 value for individual i at time t etc X Kit = independent variable K value for individual i at time t Why are panel data useful? • With observations that span both time and individuals in a cross-section, more information is available, giving more efficient estimates. • The use of panel data allows empirical tests of a wide range of hypotheses. • With panel data we can control for : – Unobserved or unmeasurable sources of individual heterogeneity that vary across individuals but do not vary over time – omitted variable bias Key Reading • Stock and Watson (2007), Chapter 10: Regression with panel data • Baltagi(2002) Econometrics 3rd Edition • Baltagi(2005) Econometric Analysis of Panel Data Yit = log GDP per capita X 1it = log average number of years with schooling YXuit=+ββ011 it + i iNt==1,..., , 1 (1970) Estimates of parameters ----------------------- Parameter estimate s.e. t(75) Constant 0.571 0.109 5.24 lnav_yrs_sch_1970 0.6925 0.0746 9.28 Yit = log GDP per capita X 1it = log average number of years with schooling YXuit=+ββ011 it + i iNt==1,..., , 1,2 (1970,2000) Estimates of parameters ----------------------- Parameter estimate s.e. t(75) Constant 0.571 0.109 5.24 lnav_yrs_sch_1970 0.6925 0.0746 9.28 Estimates of parameters ----------------------- Parameter estimate s.e. t(75) Constant -0.946 0.223 -4.23 lnav_yrs_sch_2000 1.589 0.123 12.87 YXWetttt=++β12β () True YXtt=+ββ12() We tt + YXvttt=+β1 (We estimate) If Corr( X , W ) ≠≠0 then Cov( X , v ) 0 Yit = log GDP per capita X 1it = log average number of years with schooling Wi is omitted, so the estimate of β1 is not consistent Consider the model for time 1 and time 2, giving 2 equations YXWeiii201122=+ββ +() β +i 2 YXWeiii101112=+ββ +() β +i 1 YYii211121121−=β ()() X i − X i + ee ii − Wi is constant across time, but varies across countries eeii21−− is independent of XX1211i i so the estimate β1 is consistent Estimates of parameters ----------------------- Parameter estimate s.e. t(76) d_lnav_yrs_sch 0.3548 0.0772 4.59 Look what we are assuming here, that the slope of the line is constant And does not vary over time We also assume that differencing eliminates any correlation between The explanatory variable and the residuals. But for this to be the case the omitted variables have to be constant Over time…..are there omitted variables that are not constant over time? Equivalent estimation methods • Differencing is only applicable to the case where T = 2. More generally we have two options • Dummy variables – One dummy variable for each individual, thus controlling for inter-individual heterogeneity • The ‘within’ estimator – Each individual’s value is a deviation from its own time-mean – This takes out the effect of differing individual levels as a result of inter-individual heterogeneity • Both give the same estimate of β1 Fixed Effects Regression: Estimation • “dummy variables” is only practical when N isn’t too big, because one runs into computational problems. With N very large, we use of lots of degrees of freedom • Note that with “dummy variables”, not all N can be included because of the dummy variable trap. Alternatively, we have to omit the constant. • Data layout using N-1 dummies • N=77 • T=2 n154 lnGDP_per_70_00 lnav_yrs_sch_70_00 fed_70_00[2] fed_70_00[3] 1.00 2.226 1.772 0.00000 0.00000 2.00 2.696 2.312 1.00000 0.00000 3.00 2.414 1.947 0.00000 1.00000 4.00 0.099 -0.163 0.00000 0.00000 78.00 2.398 2.139 0.00000 0.00000 79.00 3.241 2.358 1.00000 0.00000 80.00 3.164 2.175 0.00000 1.00000 81.00 0.521 0.896 0.00000 0.00000 • Output of a regression using N-1 dummies for fixed effects across 77 countries Estimates of parameters ----------------------- Parameter estimate s.e. t(76) Constant 1.619 0.333 4.85 lnav_yrs_sch_70_00 0.3548 0.0772 4.59 fed_70_00[2] 0.521 0.422 1.24 fed_70_00[3] 0.439 0.421 1.04 fed_70_00[4] -1.439 0.438 -3.28 fed_70_00[5] -0.104 0.421 -0.25 fed_70_00[6] 0.452 0.421 1.07 fed_70_00[7] -1.389 0.454 -3.06 fed_70_00[8] -1.197 0.422 -2.84 • Etc, up to fed[77] • Output of a regression using N dummies for fixed effects across 77 countries Estimates of parameters ----------------------- Parameter estimate s.e. t(76) lnav_yrs_sch_70_00 0.3548 0.0772 4.59 fed_70_00[1] 1.619 0.333 4.85 fed_70_00[2] 2.140 0.348 6.15 fed_70_00[3] 2.058 0.337 6.10 fed_70_00[4] 0.180 0.299 0.60 and so on until fed[77] • Interpretation, 77 regression lines, • each with the same slope but • different intercepts • Consider the model for countries 1,2 and 3 YXWeWXeit =+β 0112ββit +()()i + it = βββ02 +i + 11it + it for i =1,2,3 Y1021111111111tt=+()ββ W + β Xe +=+t αβ Xet +t Y2022112221122tt=+()ββ W + β Xe +=+t αβ Xet +t Y3023113331133tt=+()ββ W + β Xe +=+t αβ Xet +t YXeit=+αβ i 11it + it • Different intercepts Same slope The within estimator Calculate deviation from individual means, averaging over time 11TT YYXXit −=−∑∑it β1()it it +ν it TTtt==11 YYit−= i.1βν() Xit − X i . + it YXit=+βν1 it it The within estimator (continued) • Inference (hypothesis tests, confidence intervals) is as usual • This is like the “differences” approach, but instead Yit is subtracted from the average instead of from Yi1 . • This can be done in a single command in PcGive and Gretl (and most other econometric packages) Assumptions of fixed effects 1. The slopes of the regression lines are the same across states (countries) 2. The fixed effects capture entirely the time- constant omitted variables • This means we can soak up unmodelled heterogeneity across individuals/regions/countries and thus avoid misspecification error • But if there are time-varying omitted variables, their effects would not be captured by the fixed effects • Fixed time effects are also possible – But here we assume there are no fixed effects that cause GDP per capita to vary across time periods. These effects would have to be identical across all countries, a very strong assumption in this particular example Disadvantage of fixed effects • Fixed effects wipe out explanatory variables that do not vary within an individual (ie are time-invariant, such as gender, race) • We are often interested in in the effects of these separate sources of individual heterogeneity The error components model : random effects • The alternative to the fixed effects model is the random effects model – In this the individual specific error components are chosen at random from a population of possible intercepts Error components : random effects We can write our model as an error components model, so that YXXeit=+αβ i 11it +... β K Kit + it becomes YXit =+ββ11it... K Xu Kit + it ueit=+α i it α i = individual specific components eit = remainder components, a 'traditional' error term uit = disturbance term the disturbance term is a composite of the two error components The random effects model • In the fixed effects approach, we do not make any hypotheses about the individual specific effects • beyond the fact that they exist — and that can be tested • Once these effects are swept out by taking deviations from the group means, or by dummy variables, the remaining parameters can be estimated. The random effects model • the random effects approach attempts to model the individual effects as drawings from a probability distribution instead of removing them. • In this the individual effects are part of the disturbance term, that is, zero-mean random variables, uncorrelated with the regressors. The random effects model • The composite disturbance term means that OLS is not appropriate • We therefore use GLS (generalised least squares) • There are various GLS estimators, but all are asymptotically efficient as T and N become large • Gretl uses the Swamy and Arora(1972) estimator of the random effects model, which is also the default in Stata The random effects model • the fixed-effects estimator “always works”, but at the cost of not being able to estimate the effect of time-invariant regressors.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages76 Page
-
File Size-