Econometrics of Panel Data Jakub Mućk Meeting # 2 Jakub Mućk Econometrics of Panel Data Meeting # 2 1 / 26
Outline 1 Fixed effects model The Least Squares Dummy Variable Estimator The Fixed Effect (Within Group) Estimator 2 Random Effect model Testing on the random effect 3 Comparison of Fixed and Random Effect model Jakub Mućk Econometrics of Panel Data Fixed effects model Meeting # 2 2 / 26
One-way Error Component Model In the model: y it = α + X itβ + u it i {1,..., N }, t {1,..., T} (1) it is assumed that all units are homogeneous. Why? One-way error component model: u i,t = µ i + ε i,t (2) where: µi the unobservable individual-specific effect; εi,t the remainder disturbance. Jakub Mućk Econometrics of Panel Data Fixed effects model Meeting # 2 3 / 26
Fixed effects model We can relax assumption that all individuals have the same coefficients where u it N (0, σ 2 u). y it = α i + β 1 x 1it +... + β k x kit + u it (3) Note that an i subscript is added to only intercept α i but the slope coefficients, β 1,..., β k are constant for all individuals. An individual intercept (α i ) are include to control for individual-specific and time-invariant characteristics. That intercepts are called fixed effects. Independent variables (x 1it... x kit ) cannot be time invariant. Fixed effects capture the individual heterogeneity. The estimation: i) The least squares dummy variable estimator ii) The fixed effects estimator Jakub Mućk Econometrics of Panel Data Fixed effects model Meeting # 2 4 / 26
The Least Squares Dummy Variable Estimator The natural way to estimate fixed effect for all individuals is to include an indicator variable. For example, for the first unit: { 1 i = 1 D 1i = (4) 0 otherwise The number of dummy variables equals N. It s not feasible to use the least square dummy variable estimator when N is large We might rewrite the fixed regression as follows: Why α is missing? y it = N α i D ji + β 1 x 1it +... + β k x kit + u i,t (5) j=1 Jakub Mućk Econometrics of Panel Data Fixed effects model Meeting # 2 5 / 26
The Least Squares Dummy Variable Estimator In the matrix form: y = Xβ + u (6) where y is NT 1, β is (K + N ) 1, X is NT (K + N ) and u is NT 1. 1 0... 0 x 11... x k1 0 1... 0 x 12... x k2 X =................. 0 0... 1 x 1N... x kn and y = y 1 y 2. y N and β = where x ij is the vector of observations of the jth independent variable for unit i over the time and y i is the vector of observation of the explained variable for unit i. Then: α 1. α N β 1. β K ˆβ LSDV = ( X X ) 1 X y = [ˆα 1 LSDV... ˆα N LSDV ˆβ 1 LSDV LSDV... ˆβ K ] (7) Jakub Mućk Econometrics of Panel Data Fixed effects model Meeting # 2 6 / 26
The Least Squares Dummy Variable Estimator We can test estimates of intercept to verify whether the fixed effects are different among units: H 0 : α 1 = α 2 =... = α N (8) To test (8) we estimate: i) unrestricted model (the least squares dummy variable estimator) and ii) restricted model (pooled regression). Then we calculate sum of squared errors for both models: SSE U and SSE R. F = (SSE R SSE U )/(N 1) SSE U /(NT K) (9) if null is true then F F (N 1,NT K). Jakub Mućk Econometrics of Panel Data Fixed effects model Meeting # 2 7 / 26
The Fixed Effect (Within Group) Estimator Let s start with simple fixed effects specification for individual i: y it = α i + β 1x 1it +... + β k x kit + u it t = 1,..., T (10) Average the observation across time and using the assumption on time-invariant parameters we get: ȳ i = α i + β 1 x 1i +... + β k x ki + ū i (11) where ȳ i = 1 T T t=1 yit, x1i = 1 T T t=1 x1it, x ki = 1 T T t=1 x kit and ū i = 1 T T t=1 ui Now we substract (11) from (10) (y it ȳ i) = (α i α i) + β 1(x 1it x 1i) +... + β k (x itk x ki ) + (u it ū i) (12) }{{} =0 Using notation: ỹ it = (y it ȳ i), x 1it = (x 1it x 1i), x kit = (x kit x ki ) ũ it = (u it ū i), we get ỹ it = β 1 x 1t +... + β k x kt + ũ i,t (13) Note that we don t estimate directly fixed effects. Jakub Mućk Econometrics of Panel Data Fixed effects model Meeting # 2 8 / 26
The Fixed Effect (Within Group) Estimator The Fixed Effect Estimator or the within (group) estimator in vector form: ỹ = Xβ + ũ (14) where ỹ is NT 1, β is K 1, X is NT K and ũ is NT 1 and: x 11... x k1 ỹ 1 x 12... x k2 ỹ 2 X =....... and ỹ = and β =. x 1N... x kn ỹ N Then: ˆβ FE = ( 1 X X) X ỹ FE FE = [ ˆβ 1... ˆβ K ] (15) The standard errors should be adjusted by using correction factor: NT K (16) NT N K where K is number of estimated parameters without constant. The fixed effects estimates can be recovered by using the fact that OLS fitted regression passes the point of the means. ˆα FE i = ȳ i β 1. β K FE FE FE ˆβ 1 x 1i ˆβ 2 x 2i... ˆβ k x ki (17) Jakub Mućk Econometrics of Panel Data Fixed effects model Meeting # 2 9 / 26
Empirical example Grunfeld s (1956) investment model: where I it = α + β 1 K it + β 2 F it + u it (18) I it the gross investment for firm i in year t; K it the real value of the capital stocked owned by firm i; F it is the real value of the firm (shares outstanding). The dataset consists of 10 large US manufacturing firms over 20 years (1935 54). Jakub Mućk Econometrics of Panel Data Fixed effects model Meeting # 2 10 / 26
Empirical example Pooled OLS FE α 42.714 58.744 (9.512) (12.454) [0.000] [0.000] β 1 0.231 0.310 (0.025) (0.017) [0.000] [0.000] β 2 0.116 0.110 (0.006) (0.012) [0.000] [0.000] Note: The expressions in round and squared brackets stand for standard errors and probability values corresponding to the null about parameter s insignificance, respectively. I it = α + β 1 K it + β 2 F it + u it Jakub Mućk Econometrics of Panel Data Fixed effects model Meeting # 2 11 / 26
Empirical example Pooled OLS Pooled OLS FE FE robust se robust se α 42.714 42.714 58.744 58.744 (9.512) (11.575) (12.454) (27.603) [0.000] [0.000] [0.000] [0.062] β 1 0.231 0.231 0.310 0.310 (0.025) (0.049) (0.017) (0.053) [0.000] [0.000] [0.000] [0.000] β 2 0.116 0.231 0.110 0.110 (0.006) (0.007) (0.012) (0.015) [0.000] [0.000] [0.000] [0.000] Note: The expressions in round and squared brackets stand for standard errors and probability values corresponding to the null about parameter s insignificance, respectively. I it = α + β 1 K it + β 2 F it + u it Jakub Mućk Econometrics of Panel Data Fixed effects model Meeting # 2 12 / 26
Outline 1 Fixed effects model The Least Squares Dummy Variable Estimator The Fixed Effect (Within Group) Estimator 2 Random Effect model Testing on the random effect 3 Comparison of Fixed and Random Effect model Jakub Mućk Econometrics of Panel Data Random Effect model Meeting # 2 13 / 26
Random Effect model Let s assume the following model y it = α + X itβ + u it, i {1,..., N }, t {1,..., T}. (19) The error component (u t ) is the sum of the individual specific random component (µ i ) and idiosyncratic disturbance (ε i,t ): where µ i N (0, σ 2 µ); and ε i,t N (0, σ 2 ε). u it = µ i + ε it, (20) Jakub Mućk Econometrics of Panel Data Random Effect model Meeting # 2 14 / 26
Random Effect model Let s assume the following model y it = α + X itβ + u it, i {1,..., N }, t {1,..., T}. (19) The error component (u t ) is the sum of the individual specific random component (µ i ) and idiosyncratic disturbance (ε i,t ): where µ i N (0, σ 2 µ); and ε i,t N (0, σ 2 ε). u it = µ i + ε it, (20) Note that independent variables can be time invariant. Individual (random) effects are independent: E (µ i, µ j ) = 0 ifi j. (21) Estimation method: GLS (generalized least squares). Jakub Mućk Econometrics of Panel Data Random Effect model Meeting # 2 14 / 26
RE model variance covariance matrix of the error term I The error component (u t ): where µ i N (0, σ 2 µ) and ε i,t N (0, σ 2 ε). u it = µ i + ε it, (22) Diagonal elements of the variance covariance matrix of the error term: E ( uit 2 ) = E ( µ 2 ) ( ) i + E ε 2 it + 2cov (µi, ε it ) = σ 2 µ + σ 2 ε Non-diagonal elements of the variance covariance matrix of the error term (t s): cov (u it, u is ) = E (u it u is ) = E [(µ i + ε it ) (µ i + ε is )]. After manipulation: cov (u it, u is ) = E ( µ 2 ) i + E (µ i ε it ) + E (µ i ε is ) + E (ε it ε is ) = σµ 2 }{{}}{{}}{{}}{{} σµ 2 0 0 0 Jakub Mućk Econometrics of Panel Data Random Effect model Meeting # 2 15 / 26
RE model variance covariance matrix of the error term II Finally, variance covariance matrix of the error term for given individual (i): 1 ρ... ρ E (u i. u i.) = Σ u,i = ( σµ 2 + σε 2 ) ρ 1. ρ......, (23) ρ ρ... 1 where ρ = σ2 µ σµ 2 + σε 2. Note that Σ u is block diagonal with equicorrelated diagonal elements Σ u,i but not spherical. Although disturbances from different (cross-sectional) units are independent presence of the time invariant random effects (µ i ) leads to equi-correlations among regression errors belonging to the same (cross-sectional) unit. Jakub Mućk Econometrics of Panel Data Random Effect model Meeting # 2 16 / 26
GLS estimator Consider the following linear model: y = βx + u (24) when the variance covariance matrix of the error term (E(uu ) = σ 2 I ) is spherical then the OLS estimator is motivated: β OLS = ( X X ) 1 X y. (25) Let s relax the assumption about the variance covariance matrix of the error term, i.e., E(uu ) = Σ and Σ is not diagonal but is positively defined. We can transform the baseline model (24) as follows: Cy = CβX + Cu, (26) where C = Σ 2 1. The variance covariance matrix of the error term becomes in the transformed model: E ( CuC u ) ) = E (Σ 1 2 u(σ 2 1 ) u = E ( Σ 1 Σ ) = I. (27) After manipulations, the GLS estimator of the vector β is: How to choose Σ?. β GLS = ( X Σ 1 X ) 1 X Σ 1 y. (28) Jakub Mućk Econometrics of Panel Data Random Effect model Meeting # 2 17 / 26
Model estimation: RE Using the GLS estimator we have: but we don t know Σ! ˆβ RE = ( X Σ 1 X ) 1 X Σ 1 y, (29) Var ( ˆβRE ) = ( X Σ 1 X ) 1, (30) We know that Σ = E (uu ) is block-diagonal and: 0 if i j, cov (u it, u js ) = σµ 2 + σε 2 if i = j and s = t, ρ ( ) σµ 2 + σε 2 if i = j and s t, where ρ = σ 2 µ/ ( σ 2 µ + σ 2 ε). But we do not know σ µ and σ ε. There are many different strategies to estimates σ µ and σ ε. Jakub Mućk Econometrics of Panel Data Random Effect model Meeting # 2 18 / 26
Model estimation: RE example We use the GLS transforms of the independent (x jit) and dependent variable (y it): xjit = x jit ˆθ i x ji yit = y it ˆθ iȳ i where x ji and ȳ i are the individuals means. Estimates of the transforming parameter: ˆσ 2 ε ˆθ i = 1. T i ˆσ µ 2 + ˆσ ε 2 The estimates of the idiosyncratic error component σ ε: n Ti ˆσ ε 2 û i t it 2 = N n K + 1 where û 2 it = (y it ȳ i + ȳ) ˆα Within (x it x i + x) ˆβ Within, where ˆα Within and ˆβ Within stand for the within estimates. Jakub Mućk Econometrics of Panel Data Random Effect model Meeting # 2 19 / 26
Model estimation: RE example The error variance of individual specific random component (σ 2 µ): ˆσ 2 µ = SSRBetween n K ˆσ2 ε T where T n is the harmonic mean of T i, i.e., T = n/ (1/Ti), and SSRBetween i stands for the sum of squared residuals from the between regression (details on further lectures): SSR Between = n (ȳi ˆα Between x ) ˆβBetween i i where ˆβ Between and ˆα Between stand for the coefficient estimates from the between regression. Jakub Mućk Econometrics of Panel Data Random Effect model Meeting # 2 20 / 26
Model estimation: RE Swamy-Arora method Method which gives more precise estimates in small samples and unbalanced panels. The estimation of σ ε (the idiosyncratic error component) is the same = it bases on the residuals from the within regression. The variance or the individual error term: ˆσ µ,sa 2 = SSRBetween (n K) ˆσ ε 2, N tr where SSR Between is the sum of the squared residuals from the between regression and { (X tr = trace PX ) } 1 X ZZ X { } 1 P = diag e Ti e T T i i where e Ti is a T i 1 vector of ones. Z = diag {e Ti } Jakub Mućk Econometrics of Panel Data Random Effect model Meeting # 2 21 / 26
Testing on the random effect In the standard RE model, the variance of the random effect is assumed to be σ 2 µ (µ N ( 0, σ 2 µ) ). We can test for the presence of heterogeneity: H 0 : σ µ = 0 H 1 : σ µ 0 If the null hypothesis is rejected, then we conclude that there are random individual differences among sample members, and that the random effects model is appropriate. If we fail to reject the null hypothesis, then we have no evidence to conclude that random effects are present. We construct the Lagrange multiplier statistic: LM = ( ( N T ) 2 ) NT i=1 t=1 ûit 2(T 1) N T 1, (31) i=1 t=1 û2 it where û i,t stands for the residuals, i.e., û it = y it ˆα 0 ˆβ 1x 1it... ˆβ k x kit. Conventionally, LM χ 2 (1). In large samples, LM N (0, 1). Jakub Mućk Econometrics of Panel Data Random Effect model Meeting # 2 22 / 26
Empirical example Pooled OLS FE RE α 42.714 58.744 57.834 (9.512) (12.454) (28.899) [0.000] [0.000] [0.045] β 1 0.231 0.310 0.308 (0.025) (0.017) (0.012) [0.000] [0.000] [0.000] β 2 0.116 0.110 0.110 (0.006) (0.012) (0.010) [0.000] [0.000] [0.000] Note: The expressions in round and squared brackets stand for standard errors and probability values corresponding to the null about parameter s insignificance, respectively. I it = α + β 1 K it + β 2 F it + u it Jakub Mućk Econometrics of Panel Data Random Effect model Meeting # 2 23 / 26
Empirical example Table: The estimates of the RE model ˆσ µ 84.20 ˆσ ε 52.77 ˆρ 0.72 LM 798.16 H 0 : σ µ = 0 [0.000] Jakub Mućk Econometrics of Panel Data Random Effect model Meeting # 2 24 / 26
Outline 1 Fixed effects model The Least Squares Dummy Variable Estimator The Fixed Effect (Within Group) Estimator 2 Random Effect model Testing on the random effect 3 Comparison of Fixed and Random Effect model Jakub Mućk Econometrics of Panel Data Comparison of Fixed and Random Effect model Meeting # 2 25 / 26
Comparison of Fixed and Random Effect model If the true DGP includes random effect then RE model is preferred: The random effects estimator takes into account the random sampling process by which the data were obtained. The random effects estimator permits us to estimate the effects of variables that are individually time-invariant. The random effects estimator is a generalized least squares estimation procedure, and the fixed effects estimator is a least squares estimator. Endogenous regressors If the error term is correlated with any explanatory variable then both OLS and GLS estimators of parameters are biased and inconsistent. Jakub Mućk Econometrics of Panel Data Comparison of Fixed and Random Effect model Meeting # 2 26 / 26