web Extensin 6 Appendix 6.A A Matrix Representatin f Panel Data Panel data mdels cme in tw brad varieties, distinct intercept DGPs and errr cmpnent DGPs. his appendix presents matrix algebra representatins f thse DGPs and the estimatin methds apprpriate fr them. 6.A. WHA IS HE DGP? Panel Data DGPs We typically represent ne-dimensinal data, such as crsssectinal r time-series data, as Y = XB + E, 6.A. where, fr examples, Y and E are *, X is (k + ) *, and B is (k + ) * if the data are a time series with bservatins, and the explanatrs include an intercept term. his sectin adapts this basic frmulatin t describe several panel data mdels. Plain Panel Data Suppse the data represented by Equatin 6.A. are frm ne time series amng n such time series. Fr example, suppse these data are bservatins n military recruiting utcmes and their determinants fr ne state amng the 50 states f the United States. We can emphasize the multiplicity f states fr which we have data by replacing Equatin 6.A. fr the i-th state with Y i = X i b + e i (i =, Á, n). 6.A.2 EX 6-
EX 6-2 Web Extensin 6 We can als cmbine the infrmatin frm the n equatins f Equatin 6.A.2. Define Y Y 2 Y = D, Y n in which Y, Y 2, Á, Y n are each ( * ), X X 2 X = D X, n in which X, X 2, Á, X n are each (k + ) *, and, E E E 2 = D E, n in which E, E 2, Á, E n are each ( * ). In this frmulatin, in Y = XB + E, 6.A.3 Y and E are n *, X is (k + ) * n, and B is (k + ) *. If E fllwed the Gauss Markv Assumptins, OLS wuld be BLUE fr estimating the cefficients f Equatin 6.A.3. We have seen that panel data are ften nt that simple, thugh, and instead require alternative specificatins. Distinct Intercepts and Fixed Effects Estimatin he distinct intercepts mdel includes a separate intercept fr each individual grup f bservatins,, Á, n. We culd include thse intercepts in X in Equatin 6.A.3 and apply OLS t that equatin. his estimatr is called the least squares dummy variable (LSDV) estimatr. If the e satisfy the Gauss Markv Assumptins, OLS wuld be BLUE in this case. Hwever, smetimes n is quite large. Fr example, if each bservatin is n a particular cunty in the United States in a
A Matrix Representatin f Panel Data EX 6-3 particular year, there wuld be mre than 3,000 distinct intercepts t estimate. Inverting such a large matrix can be cmputatinally difficult. Als, s many estimated intercepts can make cmputer utput unmanageable. If we are nt particularly interested in the individual intercepts, but nly in the slpes, it is easier t estimate the mdel using an estimatr that btains the OLS estimates fr the slpe cefficients withut prducing the ptentially numerus intercepts. he fixed effects estimatr estimates nly the slpes f 6.A.3. allw estimatin f the slpe cefficients withut estimating the intercepts, first break up X int tw parts:. W, which is X less its clumn f nes fr an intercept, [X 0 X 02, Á, X 0n ] in which X 0i is a ( * ) clumn vectr f nes; and 2. X 0 = D X 0 0 Á 0 0 X 02 Á 0, Á 0 0 0 Á X 0n in which W is n * k and X 0 is n * n. We can write the distinct intercepts mdel as Y = X 0 A + WG + E 6.A.4 in which A is (n * ) and cntains the n distinct intercepts, and G is (k * ) and cntains the k slpe cefficients. Refrmulating the Distinct Intercepts Mdel Refrmulating the distinct intercepts mdel f Equatin 6.A.4 int a frm withut intercepts requires sme special matrix manipulatins. he purpse f these manipulatins is t express bservatins in terms f variables deviatins frm the variables grup means. he relevant grup fr an bservatin is the grup t which the bservatin belngs. We first develp the tls fr these manipulatins. Ntice that X 0 X 0 is the n * n diagnal matrix 0 Á 0 0 Á 0 D, 0 0 Á
EX 6-4 Web Extensin 6 the inverse f which is the n * n matrix 0 Á 0 (X 0 X 0 ) - 0 0 = D, Á 0 0 Á and that 0 Á 0 X 0 (X 0 X 0 ) - 0 X 0 = D Á 0, Á 0 0 0 Á where is a matrix with all elements equal t. X 0 (X 0 X 0 ) - * X 0 is n * n and symmetric. Fr any Y i, Y i = G ay it t = ay it t = ay it t = W, 6.A.5 a * matrix that we call Y i, and Y X 0 (X 0 X 0 ) - X 0 Y = D Y 2, 6.A.6 Y n an n * matrix that we call Y, in which the mean value f Y fr each bservatin s grup represents that bservatin. Similarly, W X 0 (X 0 X 0 ) - X 0 W = D W 2 = W, 6.A.7 W n an n * k matrix that we call W, in which W i is a * k matrix with each clumn the mean f the crrespnding explanatr fr the i-th individual.
A Matrix Representatin f Panel Data EX 6-5 Cnsequently, if we define the n * n symmetric matrix D = I n - X 0 (X 0 X 0 ) - X 0, 6.A.8 then DW is an n * k matrix cntaining, fr each bservatin, the deviatins f each explanatr frm the explanatr s mean fr the grup the bservatin belngs t. Similarly, DY is an n * matrix that cntains, fr each bservatin, the deviatin f that bservatin s Y-value frm the mean Y-value fr that bservatin s grup. DX = 0. Ntice that D is symmetric. If we pre-multiply the distinct intercept mdel f Equatin 6.A.4 by D we btain DY = DX 0 A + DWG + DE = 0 + DWG + DE, 6.A.9 in which De cntains, fr each bservatin, the deviatin f its disturbance frm the mean disturbance fr that bservatin s grup. Applying OLS t 6.A.9 yields gn FE = (W D DW) - W D DY. Pre-multiplicatin f D by D yields D, that is, D is what we have previusly called an idemptent matrix. Cnsequently, the OLS frmula reduces t gn FE = (W DW) - W DY. LSDV and Fixed Effects Estimatin he fixed effects estimatr prvides the same estimates f the slpe cefficients as des the LSDV estimatr. Recall that OLS estimatrs are characterized by X e = 0, where e is the clumn vectr f OLS residuals, that is, by the explanatrs being rthgnal t the residuals. In the case in which X is (X 0 W), X e is an (n + k) clumn vectr f zers. he (n + k) rws f X e uniquely characterize the OLS estimatr. Cnsequently, if X is rthgnal t the residuals f the fixed effects estimatr, the slpe estimates frm the fixed effects estimatr are the same as frm the OLS estimatr. demnstrate that the fixed effects and LSDV estimates f the slpes cincide, it suffices t shw that X is rthgnal t the residuals frm the fixed effects estimatr. Recall that we btain the fixed effects estimatr by applying OLS t Equatin 6.A.9, DY = DWG + DE, 6.A.0
EX 6-6 Web Extensin 6 s we knw that DW is rthgnal t the residuals frm this regressin, because it is the explanatr and the estimatin prcedure is OLS. Define the residuals, d, frm estimating Equatin 6.A.0 t be d = DY - DWgN FE. 6.A. hese residuals crrespnd t a set f residuals frm estimating Equatin 6.A.4: see that this is true, nte that Equatins 6.A.6 and 6.A.7, cupled with the definitin f D in Equatin 6.A.8, allw us t rewrite Equatin 6.A. as which we can rewrite as Y = X 0 A + WG + E. d = Y - Y - (W - W)gN, d = Y - (Y - WgN ) - WgN. In turn, we can rewrite Y - WgN as Y - W gn Y 2 - W 2 gn G a(y 2t - W 2t gn ) t = W D = X 0 = X0 an FE, Y n - W n gn a(y nt - W nt gn ) in which Y it is the value f Y in the t-th bservatin n the i-th individual, W it is a rw vectr cntaining the k-values f the explanatrs in the t-th bservatin n the i-th individual, and AN FE = G a t = t = a t = a t = a t = (Y t - W t gn ) (Y t - W t gn ) (Y 2t - W 2t gn ) W. (Y nt - W nt gn ) Cnsequently, we can rewrite Equatin 6.A. as d = Y - X 0 an FE - WgN FE,
A Matrix Representatin f Panel Data EX 6-7 which shws that d is the vectr f residuals that results frm estimating A and G in Equatin 6.A.4 with and GN FE. AN FE If X = (X 0 W) is rthgnal t these residuals, that is if X d = 0, then the fixed effects estimatr fr the slpes is the OLS estimatr f G. Des X d = 0? answer this questin, let s first rewrite d: d = DY - DWGN FE = DY - DW((W DW) - W DY) = (I n - DW(W DW) - W )DY. hus, X d = (X 0 W) d = (X 0 W) (I n - DW(W DW) - W )DY. 6.A.2 he first n rws f X d are X 0 (I n - DW(W DW) - W )DY r X 0 (I n - X 0 DW(W DW) - W )DY. But D is symmetric, s D = D, s (X 0 I n - X 0 DW(W DW) - W )DY = (X 0 I n - X 0 D W(W DW) - W )D Y. Because X 0 D =(DX) =0, X d = (X 0 I n - X 0 D W(W DW) - W )D Y = (X 0 I n - 0 )D Y which equals (X 0 I n )D Y = X 0 D Y = 0, in this case an n * clumn f zers. Returning t Equatin 6.A.2, the next k rws f X d are W (I n - DW(W DW) - W )DY = (W I n - W DW(W DW) - W )DY = (W -I k W )DY = (W -W )DY = 0. hus, X is rthgnal t d and the fixed effects estimatr f the slpes cincides with the LSDV estimatr f the slpes. Errr Cmpnents and Randm Effects Estimatin Errr cmpnents mdels return us t Equatin 6.A.3, Y = XB + E, 6.A.3
EX 6-8 Web Extensin 6 in which X is n * (k + ), with a single intercept. he errr cmpnents mdel cpes with unbserved hetergeneity by assuming that there are individual specific cmpnents f E. he individual specific effects appear in the disturbance n the premise that the individuals that appear in the sample vary randmly acrss samples. In the randm effects mdel, the disturbances d nt fllw the Gauss Markv Assumptins. Instead, the disturbance is assumed t cntain bth an individual-specific cmpnent and an bservatin-specific cmpnent. hus, he tw errr cmpnents DGPs discussed in this chapter share assumptins abut the variances and cvariances f the disturbance cmpnents: hey als share the assumptin that Hwever, the first errr cmpnents DGP assumes that whereas the secnd assumes the cntrary. Define π=d e it = n i + m it. E(m it ) = 0 i =, Á, n; t =, Á, var(m it ) = s 2 m i =, Á, n; t =, Á, E(m it m i t ) = 0 if i Z i r t Z t E(n i ) = 0 i =, Á, n var(n i ) = s 2 n i =, Á, n E(n i n j ) = 0 fr i Z j E(m it n j ) = 0 fr all i, j, and t. E(X jit m it ) = 0 fr all j, i, and t. E(X jit n i ) = 0 fr all j, i, and t, s m + s n s n Á s n s n s m + s n s n, Á Á s n s n. Á s m + s n a * matrix that represents the variances and cvariances amng the disturbances within the bservatins fr a single grup. he assumptins abut disturbances imply that π 0 Á 0 0 π 0 æke(ee ) = D, Á 0 0 Á π
A Matrix Representatin f Panel Data EX 6-9 which is an n * n matrix. he GLS estimatr f Equatin 6.A.3 fr this DGP is (X æ X) - X æ Y. ransfrming Variables and the Randm Effects Estimatr We can cnstruct the GLS estimatr by perfrming OLS n suitably transfrmed X and Y. Greene reprts that the * symmetric matrix P fr which PP =P P =π - is P = s m ci - u d, in which is a * matrix with every element equal t and u = - s m. 2s 2 n + s 2 m OLS applied t s m PY = s m PXB + s m PE yields B ~ RE = (s 2 mx P PX) - s 2 mx P PY = (X P PX) - X P PY = (X æ X) - X æ Y, the GLS estimatr fr B. In the first errr cmpnents DGP, in which E(X jit n i ) = 0 fr all j, i, and t, the GLS estimatr is asympttically efficient if the disturbances are jintly nrmally distributed cnditinal n X. In the secnd errr cmpnents DGP, GLS is biased and incnsistent because the explanatrs are cntempraneusly crrelated with the disturbances. he character f the GLS transfrmatin becmes clearer if we lk t Equatin 6.A.5, Y i = G ay it t = ay it t = : ay it t = W = Yi.
EX 6-0 Web Extensin 6 his relatinship suggests what transfrming Y, X, and E by s m P des in the GLS prcedure. Our transfrmed Y is uy uy 2 s m PY = Y - D, uy n in which the last matrix is, like Y, n *. Each clumn f X is similarly transfrmed by s m P.. William H. Greene, Ecnmetric Analysis, 5th ed., (Englewd Cliffs, NJ: Prentice Hall, 2003, 295).