Вы находитесь на странице: 1из 77

Part 7: Regression Extensions [ 1/77]

Econometric Analysis of Panel Data

William Greene
Department of Economics
Stern School of Business
Part 7: Regression Extensions [ 2/77]

Regression Extensions

 Time Varying Fixed Effects


 Heteroscedasticity (Baltagi, 5.1)
 Autocorrelation (Baltagi, 5.2)
 Measurement Error (Baltagi 10.1)
 Spatial Autoregression and Autocorrelation
(Baltagi 10.5)
Part 7: Regression Extensions [ 3/77]

Time Varying Effects Models


Random Effects
yit = β’xit + εit + ai(t)
or
yit = β’xit + εit + uig(t,)
A heteroscedastic random effects model
Stochastic frontiers literature – Battese-Coelli (1992)
     g (1, ) g (2, ) 
2
g (1, ) ... ...
 
2   g (2, )  g (1, )     
2
g (2, ) ... ...
i   I u 
2

 ... ... ... ... 
 g (T , ) g (1, ) ...  g (T , )  
    g (T , ) g (2, )
2
Part 7: Regression Extensions [ 4/77]
Part 7: Regression Extensions [ 5/77]

A Stochastic Frontier Model


yit =  + x it + vit - |u i |*exp(-(t-T)
vit ~ Normal (0,v2 ), u i normal(0,u2 )

u

v
Part 7: Regression Extensions [ 6/77]

Time Varying Effects Models


Time Varying Fixed Effects: Additive
yit = β’xit + ai(t) + εit
yit = β’xit + ai + ct + εit
ai(t) = ai + ct, t=1,…,T
Two way fixed effects model
Now standard in fixed effects modeling.
Part 7: Regression Extensions [ 7/77]

-----------------------------------------------------------------------------
LSDV least squares with fixed effects ....
LHS=YIT Mean = 11.57749
Standard deviation = .64344
---------- No. of observations = 1482 DegFreedom Mean square
Regression Sum of Squares = 605.772 255 2.37558
Residual Sum of Squares = 7.37954 1226 .00602
Total Sum of Squares = 613.152 1481 .41401
---------- Standard error of e = .07758 Root MSE .07057
Fit R-squared = .98796 R-bar squared .98546
Estd. Autocorrelation of e(i,t) = .007815
--------------------------------------------------
Panel:Groups Empty 0, Valid data 247
Smallest 6, Largest 6
Average group size in panel 6.00
Variances Effects a(i) Residuals e(i,t)
.021204 .006019
Std.Devs. .145615 .077583
Rho squared: Residual variation due to ai .778892
Within groups variation in YIT .49745D+02
R squared based on within group variation .851653
Between group variation in YIT .56341D+03
--------+--------------------------------------------------------------------
| Standard Prob. 95% Confidence
YIT| Coefficient Error z |z|>Z* Interval
--------+--------------------------------------------------------------------
X1| .63797*** .02380 26.81 .0000 .59132 .68461
X2| .04128*** .01544 2.67 .0075 .01100 .07155
X3| .02819 .02217 1.27 .2036 -.01527 .07165
X4| .30816*** .01323 23.30 .0000 .28224 .33408
--------+--------------------------------------------------------------------
T| Base = 1993
1994 | .03292*** .00713 4.62 .0000 .01894 .04690
1995 | .06137*** .00749 8.20 .0000 .04669 .07604 Evidence of technical
1996 | .07195*** .00801 8.98 .0000 .05625 .08765
1997 | .07530*** .00843 8.93 .0000 .05878 .09183
change
1998 | .09401*** .00892 10.53 .0000 .07651 .11150
--------+--------------------------------------------------------------------
Part 7: Regression Extensions [ 8/77]

Time Varying Effects Models


Time Varying Fixed Effects: Additive Polynomial
yit = β’xit + ai(t) + εit
yit = β’xit + ai0 + ai1t + ai2t2+ εit
Let Wi = [1,t,t2]Tx3 Ai = stack of Wi with 0s inserted
Use OLS, Frisch and Waugh. Extend “within” estimator.
Note Ai’Aj = 0 for all i  j.
1

  i 1 i W ,i i    i 1 i W ,i i 
ˆ   N XM X   N XM y 

i i i 
ˆ   W W  y  X ˆ
1
i i 
See Cornwell, Schmidt, Sickles (1990) (Frontiers literature.)
Part 7: Regression Extensions [ 9/77]

A Partial Fixed Effects Model

Some individual specific parameters


E.g., Individual specific time trends,
y it  i0  i1 t  x it β  it ; Detrend individual data, then OLS
E.g., Individual specific constant terms,
y it  i0  x it β  it ; Individual group mean deviations, then OLS
Strategy : Use OLS and Frisch-Waugh
y i  Diαi +X iβ  ε i , Ti observations
ˆ  [N X Mi X ]1 [N X Mi y ], Mi  I  D (DD ) 1 D
β i1 i D i i1 i D i D i i i i

ˆ)
ˆ i  [DiDi ]1 D(y i -X iβ
α
Part 7: Regression Extensions [ 10/77]
Part 7: Regression Extensions [ 11/77]

calc;list;r2=1-(1482-col(x)-3*247)*sst/((n-1)*var(yit))$
[CALC] R2 = .9975014
F[2*247, 1482-4-3*247]
= (.99750 - .98669)/(2*247) / ((1 - .99750)/(1482 – 4 – 3*247))
= 6.45
Wald = 6.45*494 = 3186. Critical chi squared for 494 DF = 546.81
Part 7: Regression Extensions [ 12/77]

Time Varying Effects Models


Time Varying Fixed Effects: Multiplicative
yit = β’xit + ai(t) + εit
yit = β’xit + it + εit
Not estimable. Needs a normalization. 1 = 1.
An EM iteration: (Chen (2015).)
1. Choose starting values for  (1) and  (1) .
(Linear FEM for  and 1,0,... for  , for example.)

   
1
2.1 ˆ (k+1) = i ,t
xit xit i ,t
xit ( yit  ˆ i ( k ) ˆ t ( k ) )

2.2 ˆ i ( k 1)  
T
t 1
( yit  xit
ˆ (k+1) ) ˆ ( k ) /
 t   T 2

 t 1  ˆ t ( k )  , i  1,..., N
2.3 ˆ t (k+1) = 
N
i 1
( yit  xit
ˆ (k+1) )ˆ ( k 1)
 i  /  N

i 1 

ˆ i
( k 1) 2

 , t  2,..., T

3. Iterate to convergence.
(*) a. What does this converge to? MLE under normality.
(*) b. How to compute standard errors? Hessian. No IP problem for linear model.
Part 7: Regression Extensions [ 13/77]

Time Varying Fixed Effects

911

Rescue
Part 7: Regression Extensions [ 14/77]

Need for Clarification


Part 7: Regression Extensions [ 15/77]

Time Varying Fixed Effects


Part 7: Regression Extensions [ 16/77]

Munnell State Production Model


Part 7: Regression Extensions [ 17/77]

No Effects
Part 7: Regression Extensions [ 18/77]

Quadratic Fixed Effects

Correct DF: 816-6-3(48)=666


Multiply standard errors by sqr(810/666) = 1.103
Part 7: Regression Extensions [ 19/77]

Generalized Regression
Accommodating Autocorrelation (and Heteroscedasticity)
Fixed Effects :
y it  x it β  i  it
β
y i  [X i Di ]    ε i
 α
Var[εi | X i , Di ]  Σ i = Ω i (Dimension Ti xTi ), Σ i positive definite
Random Effects :
y it  x it β  ui  it
y i  [X i ]β  uii+ε i
Var[uii + εi | X i ]  u2ii + Σ = Ω i (Dimension Ti xTi .)
Part 7: Regression Extensions [ 20/77]

OLS Estimation
β
Fixed Effects : y i  [X i Di ]    ε i = ZFi θF  w Fi
 α
Random Effects : y i  [X i ]β  uii +ε i = ZRi θR  w Ri
Least Squares
Coefficient Estimator, M = FE or RE
1
ˆ  N ZMZM  N ZMy M 
θM
 i1 i i   i1 i i 
Cluster Robust Covariance Matrix based on the White Estimator
1 1
ˆ ]    Z Z    Z  w
Est.Asy.Var[θ N M M
ˆ wN
ˆ Z   Z Z 
M M M M N M M
M
 i1
 
i i i1

i i i
 i i1 i i

wˆM
i  vector of Ti least squares residuals
Part 7: Regression Extensions [ 21/77]

GLS Estimation

Fixed Effects : No natural format (yet)


Random Effects : Ωi  u2ii + 2 I = 2 [I  2ii]=2 Φi
(Φi has subscript i because it is Ti x T.)
i

(Feasible) Generalized Least Squares

ˆ  N ZMΦ
1  ˆ2
 
θ ˆ -1ZM  N ZMΦ
ˆ -1 y M  , Φ
ˆ -1  I  ii
R
 i1 i i i   i1 i i i  i
 1  Tiˆ
2
 
1
ˆ  Z Φ
ˆ ] ˆ Z 
2 N M -1 M
Est.Asy.Var[θR
 

i1 i i i
Part 7: Regression Extensions [ 22/77]

Heteroscedasticity
 Naturally expected in microeconomic data, less so in
macroeconomic
 Model Platforms
 Fixed Effects yit  i  xitβ  it , E[it2 | Xi ]  2,it
 Random Effects y it  x itβ  ui  it , E[it2 | X i ]  2 ,it
(not actually estimable) E[ui2 | X i ]  u,i
2

 Estimation
 OLS with (or without) robust covariance matrices
 GLS and FGLS
 Maximum Likelihood
Part 7: Regression Extensions [ 23/77]

Dear Professor Greene,

I have to apply multiplicative heteroscedastic models,


that I studied in your book, to the analysis of trade
data.

Since I have not found any Matlab implementations, I


am starting to write the method from scratch. I was
wondering if you are aware of reliable
implementations in Matlab or any other language,
which I can use as a reference.
Part 7: Regression Extensions [ 24/77]

Baltagi and Griffin’s Gasoline Data


World Gasoline Demand Data, 18 OECD Countries, 19 years
Variables in the file are

COUNTRY = name of country


YEAR = year, 1960-1978
LGASPCAR = log of consumption per car
LINCOMEP = log of per capita income
LRPMG = log of real price of gasoline
LCARPCAP = log of per capita number of cars

See Baltagi (2001, p. 24) for analysis of these data. The article on which the
analysis is based is Baltagi, B. and Griffin, J., "Gasoline Demand in the OECD: An
Application of Pooling and Testing Procedures," European Economic Review, 22,
1983, pp. 117-137. The data were downloaded from the website for Baltagi's
text.
Part 7: Regression Extensions [ 25/77]

Heteroscedastic Gasoline Data


Baltagi - Griffin Gasoline Data: 18 OECD Countries, 19 Years
6 .5 0

6 .0 0

5 .5 0
L GASPCAR

5 .0 0

4 .5 0

4 .0 0

3 .5 0

3 .0 0
0 2 4 6 8 10 12 14 16 18
COUNT RY
Part 7: Regression Extensions [ 26/77]

LSDV Residuals
Country Specific Residuals
.4 0

.2 0
EIT

.0 0

-. 2 0

-. 4 0
0 2 4 6 8 10 12 14 16 18
COUNT RY
Part 7: Regression Extensions [ 27/77]

Evidence of Country Specific


Heteroscedasticity
Country Specific Residual Variances
.0 5 0

.0 4 0

.0 3 0
VARIANCE

.0 2 0

.0 1 0

.0 0 0
0 2 4 6 8 10 12 14 16 18
COUNT RY
Part 7: Regression Extensions [ 28/77]

Heteroscedasticity in the FE Model


 Ordinary Least Squares
 Within groups estimation as usual.
 Standard treatment – this is just a (large) linear
regression model.
 White estimator
1
b  Ni1 XiMDi X i  Ni1 XiMDi y i 
1 1
Var[b | X]  Ni1 X iMDi X i  Ni1 t=1
Ti
2 ,it ( x it  x i )( x it  x i ) Ni1 X iMDi X i 
White Robust Covariance Matrix Estimator

 
1 1
Est.Var[b | X]  Ni1 X iMDi X i  Ni1  tTi 1eit2 ( x it  x i )( x it  x i )  Ni1 XiMDi X i 
 
Using a conventional notation,

     
1 1
Est.Var[b | X]  Ni1  tTi 1 x it x it  Ni1  tTi 1eit2 x it x it  Ni1  tTi 1 x it x it 
    
Part 7: Regression Extensions [ 29/77]

In order to test robustness two versions of the fixed effects model were run. The first is
Ordinary Least Squares, and the second is heteroscedasticity and auto-correlation robust
(HAC) standard errors in order to check for heteroscedasticity and autocorrelation.
[Only one version of the model was computed. There was no “check.”]
Part 7: Regression Extensions [ 30/77]

Narrower Assumptions
Constant variance within the group
y it  i  x itβ  it , E[it2 | X i ]  2 ,i
White Robust Covariance Matrix Estimator - no change
1 1
Est.Var[b | X]  Ni1 X iMDi X i  Ni1 t=1
Ti
e 2
( x  x )( x  x )   Ni1 X iMDi X i 
 it it i it i 
Modified estimator - use within group constancy of variance
1 1
Var[b | X ]  Ni1 X iMDi X i  Ni12 ,i X iMDi X  Ni1 X iMDi X i 
1    
Ti 2
 t=1 eit
1
 N
 i

Est.Var[b | X]  i1 X iMD X i  i1  N
 i
 N
 i

 X iMD X  i1 X iMD X i 
  Ti  
Does it matter?
Part 7: Regression Extensions [ 31/77]

Heteroscedasticity in Gasoline Data


+----------------------------------------------------+
| Least Squares with Group Dummy Variables |
| LHS=LGASPCAR Mean = 4.296242 |
| Fit R-squared = .9733657 |
| Adjusted R-squared = .9717062 |
+----------------------------------------------------+
Least Squares - Within
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
LINCOMEP .66224966 .07338604 9.024 .0000 -6.13942544
LRPMG -.32170246 .04409925 -7.295 .0000 -.52310321
LCARPCAP -.64048288 .02967885 -21.580 .0000 -9.04180473
+---------+--------------+----------------+--------+---------+----------+
White Estimator
+---------+--------------+----------------+--------+---------+----------+
LINCOMEP .66224966 .07277408 9.100 .0000 -6.13942544
LRPMG -.32170246 .05381258 -5.978 .0000 -.52310321
LCARPCAP -.64048288 .03876145 -16.524 .0000 -9.04180473
+---------+--------------+----------------+--------+---------+----------+
White Estimator using Grouping
+---------+--------------+----------------+--------+---------+----------+
LINCOMEP .66224966 .06238100 10.616 .0000 -6.13942544
LRPMG -.32170246 .05197389 -6.190 .0000 -.52310321
LCARPCAP -.64048288 .03035538 -21.099 .0000 -9.04180473
Part 7: Regression Extensions [ 32/77]

Feasible GLS
Requires a narrower assumption, estimation of 2 ,it is not feasible.
(Same as in cross section model.)
E[it2 | X i ]  2 ,i ; Var[ε|X i ]  2 ,iI = Ωi
ˆ  N XMi Ω-1Mi X  1 N X Mi Ω-1Mi y 
β  i1 i D i D i   i1 i D i D i 
1
 N  1    N  1  
= i1  2  XiMD X i  i1  2  X iMD y i 
i i

       
  ,i    ,i 
= weighted within groups LS with constant weights within groups.

 Ti 2
 ˆ
ˆ i  y i  xi β

2  e

ˆ  ,i   t=1 it
 (Not a function of  2
ˆ  ,i . Proof left to the reader.)
 Ti 
Part 7: Regression Extensions [ 33/77]

Does Teaching Load Affect Faculty Size?


Becker, W., Greene, W., Seigfried, J.
Do Undergraduate Majors or PhD Students Affect Faculty Size? American Economist
56(1): 69-77. Becker, Jr., W.E., W.H. Greene & J.J. Siegfried. 2011

Mundlak form of Random Effects


Part 7: Regression Extensions [ 34/77]

Random Effects Regressions


Part 7: Regression Extensions [ 35/77]

Modeling the Scedastic Function

Suppose = 2 ,i a function of zi , e.g., = 2 f(ziδ).


Any consistent estimator of 2 ,i = 2 f(ziδ) brings
full efficiency to FGLS. E.g.,
2 ,i = 2 exp (ziδ)
Estimate using ordinary least squares applied to
log(eit2 )  log 2 + ziδ + w it
Second step FGLS using these estimates
Part 7: Regression Extensions [ 36/77]

Two Step Estimation


Benefit to modeling the scedastic function vs. using the robust estimator:
  t=1
Ti
eit2  ˆ)
ˆ  exp (ziδ
2 2 2

ˆ 
 ,iR  vs. 
ˆ  ,iM = 
 Ti 
Inconsistent; T Consistent in N
is fixed. Fixed T is irrelevant
Does it matter? Do the two matrices converge to the same matrix?
1 N  1   1 N  1  
 i
 i
 i1  2  X iMD X i  vs.  i1  2  X iMD X i 
 N   ,iR    N   ,iM  
It is very unlikely to matter very much.
What if we use Harvey's maximum likelihood estimator instead of LS.
Unlikely to matter. In Harvey's model, the OLS estimator is consistent in NT.
Downside: What if the specified function is wrong.
Probably still doesn't matter much.
Part 7: Regression Extensions [ 37/77]

Heteroscedasticity in the RE Model


Heteroscedasticity in both it and ui ?
y it  x itβ  ui  it , E[it2 | X i ]  2 ,i , E[ui2 | X i ]  u,i
2

OLS
1
b   X i X i  Ni1 X i y i 
N
i1

1 1
 X X  X ΩX  X X 
1
Var[b | X]  N  N   
i1 Ti  i1 Ti  Ni1 Ti  Ni1 Ti 
Ω = diag[Ω1 , Ω2 , ...ΩN ] Each block is Ti xTi
Ωi  2 ,iI  u,i
2
ii
Part 7: Regression Extensions [ 38/77]

Ordinary Least Squares


 Standard results for OLS in a GR model
 Consistent
 Unbiased
 Inefficient
 Variance does (we expect) converge to zero;
1 1
 Ni1 X i X i   Ni1 X iΩi X i   Ni1 X i X i 
1
Var[b | X ]  N  N    
i1 Ti  i1 Ti   Ni1 Ti   Ni1 Ti 
1 1
1  N X i X i   N X iΩi X i   N X i X i 
N i1fi  i1fi   i1fi  , 0 < fi < 1.
i1 Ti  Ti   Ti   Ti 
Part 7: Regression Extensions [ 39/77]

Estimating the Variance for OLS

White correction?

 
1 1
Est.Var[b|X]=  Xi X i  Ni1  t=1
N Ti
eit2 x it x it  Ni1 Xi X i 
i1  
Does this work? No. Observations are correlated.

Cluster Estimator
Est.Var[b|X]  ( X'X)1 Ni=1 ( t=1
Ti Ti
x it eit )( t=1 x it eit )  ( X'X) 1
Part 7: Regression Extensions [ 40/77]

White Estimator for OLS


1 1
1  X X  X ΩX  X X 
Var[b | X ]  N  N   
i1 Ti  i1 Ti  Ni1 Ti  Ni1 Ti 
X ΩX X iΩi X i
N
N
 i1 fi , where = Ωi =E[w i wi | X i ]
i1 T Ti
In the spirit of the White estimator, use
X ΩX X i w ˆ i X i
ˆ iw
N
N
 i1 fi ˆ i = y i - X ib
, w
i1 T Ti
Hypothesis tests are then based on Wald statistics.
Part 7: Regression Extensions [ 41/77]

Generalized Least Squares

ˆ=[XΩ-1 X ]1 [X Ω-1 y ]


β
=[Ni1 XiΩi-1 X i ]1 [Ni1 X iΩi-1 y i ]
1  2
 ,i 
-1
Ωi  2 I Ti  2 2
ii
 ,i   ,i  Tiu,i 
(Depends on i through 2 ,i ,u,i2
and Ti )
Part 7: Regression Extensions [ 42/77]

Maximum Likelihood
Let  ,i   exp(ziδ),
u,i  u exp(hi  )
i =1/2i ,
i =ui2 / 2i ,
R i  Ti i  1,
Qi  i / R i ,
logL i  (1 / 2)[i (εiε i  Qi (Ti i )2 )  logR i  Ti log i  Ti log 2]
Can be maximized using ordinary optimization methods.
Treat as a standard nonlinear optimization problem. Solve
with iterative, gradient methods.
Is there much benefit in doing this? Why would one do this?
Part 7: Regression Extensions [ 43/77]

Conclusion Het. in Effects


 Choose robust OLS or simple FGLS with moments based
variances.
 Note the advantage of panel data – individual
specific variances
 As usual, the payoff is a function of
 Variance of the variances
 The extent to which variances are correlated with
regressors.
 MLE and specific models for variances probably don’t
pay off much unless the model(s) for the variances is
(are) of specific interest.
Part 7: Regression Extensions [ 44/77]

Autocorrelation
 Source?
 Already present in RE model – equicorrelated.
 Models:
 Autoregressive: εi,t = ρεi,t-1 + vit – how to interpret
 Unrestricted: (Already considered)
 Estimation requires an estimate of ρ
1 N   Ti
t 2 ei,t ei,t 1
 1 N

ˆ  i1    i1
ˆi
N  T 2 
  t 1ei,t  N
i

using LSDV residuals in both RE and FE cases


Part 7: Regression Extensions [ 45/77]

FGLS – Fixed Effects


y i,t  i  x i,t β  i,t , i,t  i,t 1  v it
y i,t  y i,t 1  i (1  )  ( x i,t  x i,t 1 )β  v i,t
y i,t *  i *  x i,t * β  v i,t
Using ˆ in LSDV estimation estimates
i *  i (1  ),
β,
2v  2 (1  2 )
Estimate i with ai * /(1  
ˆ),
Estimate 2 with  2
ˆ2 )
ˆ v /(1  
Part 7: Regression Extensions [ 46/77]

FGLS – Random Effects


y i,t  x i,tβ  ui  i,t , i,t  i,t 1  v it
y i,t  y i,t 1  ui (1  )  ( x i,t  x i,t 1 )β  v i,t
y i,t *  x i,t * β  ui *  v i,t
(1) Step 1. Transform data using 
ˆ to partial deviations
(2) Residuals from transformed data to estimate variances
Step 2 estimator of 2v using LSDV residuals
Step 2 estimator 2v  u2 (1  2 )  2v  u2 *
(3) Apply FGLS to transformed data to estimate β and
asymptotic covariance matrix
(4) Estimates of u2 , 2 can be recovered from earlier results.
Part 7: Regression Extensions [ 47/77]

Microeconomic Data - Wages


+----------------------------------------------------+
| Least Squares with Group Dummy Variables |
| LHS=LWAGE Mean = 6.676346 |
| Model size Parameters = 600 |
| Degrees of freedom = 3565 |
| Estd. Autocorrelation of e(i,t) .148641 |
+----------------------------------------------------+
+---------+--------------+----------------+--------+---------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] |
+---------+--------------+----------------+--------+---------+
OCC -.01722052 .01363100 -1.263 .2065
SMSA -.04124493 .01933909 -2.133 .0329
MS -.02906128 .01897720 -1.531 .1257
EXP .11359630 .00246745 46.038 .0000
EXPSQ -.00042619 .544979D-04 -7.820 .0000
Part 7: Regression Extensions [ 48/77]

Macroeconomic Data –
Baltagi/Griffin Gasoline Market
+----------------------------------------------------+
| Least Squares with Group Dummy Variables |
| LHS=LGASPCAR Mean = 4.296242 |
| Estd. Autocorrelation of e(i,t) .775557 |
+----------------------------------------------------+
+---------+--------------+----------------+--------+---------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] |
+---------+--------------+----------------+--------+---------+
LINCOMEP .66224966 .07338604 9.024 .0000
LRPMG -.32170246 .04409925 -7.295 .0000
LCARPCAP -.64048288 .02967885 -21.580 .0000
Part 7: Regression Extensions [ 49/77]

Aggregation Test
Aggregation: Separate equations for each unit; the
aggregation hypothesis is that the s are the same.
H0: β1  β2  ...  βN
H1: Not H0
Correlation structure (free Σ) is maintained.
Approaches :
(1) Wald test using bi from separate OLS regressions
(2) LR test, using NT[log|S 0 |  log | S1 |]. S is computed
using residuals equation by equation. All equations fit
by ML in both cases
(3) Other strategies based on F statistics
(4) Other hypotheses related Σ to are based on the likelihood.
(See Greene (2012, section 11.11).)
Part 7: Regression Extensions [ 50/77]

Baltagi and Griffin’s Gasoline Data


World Gasoline Demand Data, 18 OECD Countries, 19 years
Variables in the file are

COUNTRY = name of country


YEAR = year, 1960-1978
LGASPCAR = log of consumption per car
LINCOMEP = log of per capita income
LRPMG = log of real price of gasoline
LCARPCAP = log of per capita number of cars

See Baltagi (2001, p. 24) for analysis of these data. The article on which the
analysis is based is Baltagi, B. and Griffin, J., "Gasoline Demand in the OECD: An
Application of Pooling and Testing Procedures," European Economic Review, 22,
1983, pp. 117-137. The data were downloaded from the website for Baltagi's
text.
Part 7: Regression Extensions [ 51/77]

A Test Against Aggregation


 Log Likelihood from restricted model =
655.093. Free parameters in  and Σ are 4 +
18(19)/2 = 175.
 Log Likelihood from model with separate
country dummy variables = 876.126. Free
parameters in  and Σ are 21 + 171 = 192
 Chi-squared[17]=2(876.126-655.093)=442.07
 Critical value=27.857. Homogeneity hypothesis
is rejected a fortiori.
Part 7: Regression Extensions [ 52/77]

Measurement Error
Standard regression results: General effects model
y it  x *it   c i  it
x it  x *it  hit
x it  measured variable, including measurement error.

b=(x x )-1 x y=(x x/Ni=1 Ti )-1 (x *  h)[x *+c+ε]/Ni=1 T 
 Var[x *it ]  Cov[x *it , c i ]
plim b =   *  *
 Var[x it ]  Var[h ]
it  Var[x it ]  Var[hit ]

biased twice, possibly in opposite directions.


(Griliches and Hausman (1986).)
Part 7: Regression Extensions [ 53/77]

General Conclusions About


Measurement Error
 In the presence of individual effects, inconsistency is in
unknown directions
 With panel data, different transformations of the data
(first differences, group mean deviations) estimate
different functions of the parameters – possible method
of moments estimators
 Model may be estimable by minimum distance or GMM
 With panel data, lagged values may provide suitable
instruments for IV estimation.
 Various applications listed in Baltagi (pp. 205-208).
Part 7: Regression Extensions [ 54/77]

Application: A Twins Study

"Estimates of the Economic Returns to Schooling from a New Sample


of Twins," Ashenfelter, O. and A. Kreuger, Amer. Econ. Review, 12/1994.
(1) Annual twins study in Twinsburg, Ohio.
(2) (log) wage equations, y i,j  log wage twin j=1,2 in family i.
(3) Measured data:
(a) Self reported education, Sibling reported education, Twins report
same education, other twin related variables
(b) Age, Race, Sex, Self employed, Union member, Married,
of mother at birth
(4) Skj  reported schooling by of twin j by twin k. Measurement error.
Skj  S j  v kj . Re liability ratio = Var[S j ]/(Var[S j ]+Var[v kj ])]
Part 7: Regression Extensions [ 55/77]

Wage Equation
Structure
y i1  x iα  zi1β+i  i1
y i2  x iα  zi2β+i  i2
i  zi1θ+zi2θ+x iδ  i
Reduced Form=Two equation SUR model.
y i1  x i (α+δ)  zi1 (β+θ)+zi2θ + (i1  i )
y i2  x i (α+δ)+ zi1θ  zi2 (β+θ)+ (i2  i )
First differences gives the "fixed effects" approach
y i1  y i2  (zi1 - zi2 )β+(i1 -i2 )
y i1  y i2  (S11 -S22 )β+(i1 -i2 ) The regressor is measured with error.
First difference gets rid of the family effect, but worsens the
measurement problem
But, S12  S12 may be used as an instrumental variable
Part 7: Regression Extensions [ 56/77]
Part 7: Regression Extensions [ 57/77]

Spatial Autocorrelation

Thanks to Luc Anselin, Ag. U. of Ill.


Part 7: Regression Extensions [ 58/77]

Spatially Autocorrelated Data

Per Capita Income in


Monroe County, NY

Thanks Arthur J. Lembo Jr., Geography, Cornell.


Part 7: Regression Extensions [ 59/77]

Hypothesis of Spatial
Autocorrelation

Thanks to Luc Anselin, Ag. U. of Ill.


Part 7: Regression Extensions [ 60/77]

Testing for Spatial Autocorrelation

W = Spatial Weight Matrix. Think “Spatial Distance Matrix.” Wii = 0.


Part 7: Regression Extensions [ 61/77]

Modeling Spatial Autocorrelation


( y  i)  W( y  i)  ε, N observations on a spatially
arranged variable
W  ' contiguity matrix;' Wii  0
W must be specified in advance. It is not estimated.
  spatial autocorrelation parameter, -1 <  < 1.
 1
Identification problem: W =   k   W for any k  0
 k
Normalization: Rows of W sum to 1.
E[ε]=0, Var[ε]=2 I
( y  i)  [I  W]1 ε
E[y]=i, Var[y]=2 [(I  W)(I  W)]-1
Part 7: Regression Extensions [ 62/77]

Spatial Autoregression

y  Wy + Xβ  ε.
E[ε|X]=0, Var[ε|X]=2 I
y  [I  W]1 (Xβ  ε)
 [I  W]1 Xβ  [I  W]1 ε
E[y|X]=[I  W]1 Xβ
Var[y|X ] = 2 [(I  W)(I  W)]-1
Part 7: Regression Extensions [ 63/77]

Generalized Regression
 Potentially very large N – GPS data on
agriculture plots
 Estimation of . There is no natural residual
based estimator
 Complicated covariance structure – no simple
transformations
Part 7: Regression Extensions [ 64/77]

Spatial Autocorrelation in Regression


y  Xβ  (I - W)ε. wii  0.
E[ε | X]=0, Var[ε | X]=2 I
E[y | X]=Xβ
Var[y | X] = 2 (I - W)(I - W)
A Generalized Regression Model

 
1
ˆ  X  (I - W)(I - W) X
β
1
X   (I - W)(I - W ) y
1

2
ˆ 

1
N
 

y - Xβ  (I - W)(I - W)  y - Xβ
ˆ 
1
ˆ  
ˆ  The subject of much research

Part 7: Regression Extensions [ 65/77]

Panel Data Application:


Spatial Autocorrelation
E.g., N countries, T periods (e.g., gasoline data)
y it  xitβ  ci  it
ε t  Wε t  v t = N observations at time t.
Similar assumptions
Candidate for SUR or SA model.
Part 7: Regression Extensions [ 66/77]
Part 7: Regression Extensions [ 67/77]

Spatial Autocorrelation in a Panel


Part 7: Regression Extensions [ 68/77]

Spatial Autocorrelation in a
Sample Selection Model
Flores-Lagunes, A. and Schnier, K., “Sample Selection and Spatial
Dependence,” Journal of Applied Econometrics, 27, 2, 2012, pp. 173-204.

 Alaska Department of Fish and Game.


 Pacific cod fishing eastern Bering Sea – grid of locations
 Observation = ‘catch per unit effort’ in grid square
 Data reported only if 4+ similar vessels fish in the region
 1997 sample = 320 observations with 207 reported full data
Part 7: Regression Extensions [ 69/77]

Spatial Autocorrelation in a
Sample Selection Model
 LHS is catch per unit effort = CPUE
 Site characteristics: MaxDepth, MinDepth, Biomass
 Fleet characteristics:
 Catcher vessel (CV = 0/1)
 Hook and line (HAL = 0/1)
 Nonpelagic trawl gear (NPT = 0/1)
 Large (at least 125 feet) (Large = 0/1)
Part 7: Regression Extensions [ 70/77]

Spatial Autocorrelation in a
Sample Selection Model
yi*1   0  xi1  ui1 ui1   j  i cij u j1  i1

yi*2  0  xi 2  ui 2 ui 2    j  i cij u j 2  i 2

  i1   0   12 12  
  ~ N   ,  2 
, (?? 1  1??)
 i 2   0   12  2  
Observation Mechanism
yi1  1  yi*1 > 0  Probit Model
yi 2  yi*2 if yi1 = 1, unobserved otherwise.
Part 7: Regression Extensions [ 71/77]

Spatial Autocorrelation in a
Sample Selection Model
u1  Cu1  1
C = Spatial weight matrix, Cii  0.
u1  [I  C]1 1 =  (1) 1 , likewise for u 2
y  0  xi1   j 1 ()  , Var[ui1 ]     ()  (1) 2
* N (1) 2 N
i1 ij i1 1 j 1 ij

y  0  xi 2   j 1 (  )ij(2)  , Var[u ]     (  )  ( 2) 2


* N 2 N
i2 i2 i2 2 j 1 ij

Cov[u , u ]    () (  )
N (1) (2)
i1 i2 12 j 1 ij ij
Part 7: Regression Extensions [ 72/77]

Spatial Weights

1
cij  2 ,
dij
dij  Euclidean distance
Band of 7 neighbors is used
Row standardized.
Part 7: Regression Extensions [ 73/77]

Estimating the Variance


Components: Baltagi
y it  x it β  ui  it
2
ui ~ (0, u,i ), it ~ (0, 2ε,i ), but here he assumes 2ε,i = 2 . (Homoscedastic)
2
Use GLS with y it * = y it - i y i , i  1   / Tiu,i  2ε .
2 2
FGLS needs 
ˆ ε and 
ˆ u,i. "Requires large T, preferably small N, T >> N."
N Ti 2
2   e
Use 
ˆ  = iN1 t 1 it.LSDV .
i1 Ti  K  N
Ti
2  ˆ
(w  ˆ
w ) 2
Based on Var[w it  ui +εit ]  u,i  2ε  i2 , use  2
ˆ i  t 1 it i

Ti  1
ˆ ε to compute FGLS using ˆ
2 2 2 2 2
Then, 
ˆ u,i = 
ˆi - 
ˆ ε . Use 
ˆ u,i and  i .
"Consistency of the variance estimators requires T   and finite N."

Invoking Mazodier and Trognon (1978) and Baltagi and Griffin (1988).
Part 7: Regression Extensions [ 74/77]

Estimating the Variance


Components: Hsiao
2
Let u,i and 2 ,i both vary across individuals. We consider FGLS
2
But, there is no way to get consistent estimates of u,i even if T  .
This is because there is but a single realization of ui.
2

ˆ  ,i
2
For example, using the conventional e  i. using OLS or LSDV
Ti
2  tTi 1 (eit  ei. )2
residuals. However, 
ˆ  ,i = or even if we assume homoscedasticity
Ti  1
2
and pool these estimators in a common 
ˆ  , as Baltagi does. If T is finite,
2
there do not exist consistent estimators of u,i and 2 ,i even if N  .(This is
the incidental parameters problem Neyman and Scott (1948). (No, it isn't).)

So, who’s right? Hsiao. This is no longer in Baltagi.


Invoking Mazodier and Trognon (1978) and Baltagi and Griffin (1988).
Part 7: Regression Extensions [ 75/77]

Maximum Likelihood
Assuming multivariate normally distributed it
Assuming fixed T > N
ˆ is computed, the MLE
(1) Regardless of how β
ˆ = (1/T) t=1
of Σ is Σ T
ε t εt
(2) In this model, for any given Σ, the MLE of
ˆ GLS
β is by β
(Oberhofer  Kmenta (1974)] - iterate back and
ˆ and Σ
forth between β ˆ until convergence. At the
solution.
-NT ˆ|]
logL= [1  log 2  log | Σ
2
Part 7: Regression Extensions [ 76/77]

OLS and PCSE


+--------------------------------------------------+
| Groupwise Regression Models |
| Pooled OLS residual variance (SS/nT) .0436 |
| Test statistics for homoscedasticity: |
| Deg.Fr. = 17 C*(.95) = 27.59 C*(.99) = 33.41 |
| Lagrange multiplier statistic = 111.5485 |
| Wald statistic = 546.3827 |
| Likelihood ratio statistic = 109.5616 |
| Log-likelihood function = 50.492889 |
+--------------------------------------------------+
+---------+--------------+----------------+--------+---------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] |
+---------+--------------+----------------+--------+---------+
Constant 2.39132562 .11624845 20.571 .0000
LINCOMEP .88996166 .03559581 25.002 .0000
LRPMG -.89179791 .03013694 -29.592 .0000
LCARPCAP -.76337275 .01849916 -41.265 .0000
+----------------------------------------------------+
| OLS with Panel Corrected Covariance Matrix |
+----------------------------------------------------+
+---------+--------------+----------------+--------+---------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] |
+---------+--------------+----------------+--------+---------+
Constant 2.39132562 .06388479 37.432 .0000
LINCOMEP .88996166 .02729303 32.608 .0000
LRPMG -.89179791 .02641611 -33.760 .0000
LCARPCAP -.76337275 .01605183 -47.557 .0000
Part 7: Regression Extensions [ 77/77]

FGLS
+--------------------------------------------------+
| Groupwise Regression Models |
| Pooled OLS residual variance (SS/nT) .0436 |
| Log-likelihood function = 50.492889 |
+--------------------------------------------------+
+---------+--------------+----------------+--------+---------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] |
+---------+--------------+----------------+--------+---------+
Constant 2.39132562 .11624845 20.571 .0000
LINCOMEP .88996166 .03559581 25.002 .0000
LRPMG -.89179791 .03013694 -29.592 .0000
LCARPCAP -.76337275 .01849916 -41.265 .0000
+--------------------------------------------------+
| Groupwise Regression Models |
| Test statistics against the correlation |
| Deg.Fr. = 153 C*(.95) = 182.86 C*(.99) = 196.61 |
| Test statistics against the correlation |
| Likelihood ratio statistic = 1010.7643 |
+---------+--------------+----------------+--------+---------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] |
+---------+--------------+----------------+--------+---------+
Constant 2.11399182 .00962111 219.724 .0000
LINCOMEP .80854298 .00219271 368.741 .0000
LRPMG -.79726940 .00123434 -645.909 .0000
LCARPCAP -.73962381 .00074366 -994.570 .0000

Вам также может понравиться