Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: Fixed Effects Panel Regression with correlation between panels


From   Ash Alankar <[email protected]>
To   [email protected]
Subject   Re: st: RE: Fixed Effects Panel Regression with correlation between panels
Date   Sun, 22 Jun 2003 07:38:56 -0700 (PDT)

This is very useful.  Thank you.
Thanks,
Ash.
--- Scott Merryman <[email protected]> wrote:
> ----- Original Message ----- 
> From: "ash_alankar" <[email protected]>
> To: <[email protected]>
> Sent: Thursday, June 19, 2003 4:57 PM
> Subject: Re: st: RE: Fixed Effects Panel Regression
> with correlation between
> panels
> 
> 
> > Hi Dolores,
> >
> > Thanks for the info.  But when I mean correlation
> between panels I
> > mean that the errors for unit i are correlated
> with the errors for
> > unit j.  I am assuming that the errors are
> independent across time
> > i.e. no autocorrelation.
> >
> > Do you know how to do this in a fixed effects
> framework?  I was
> > thinking of using xtgls with a dummy of ones for
> each different unit
> > to capture the fixed effects, but was hoping that
> there might be a
> > better way.
> >
> > Thanks.
> > Ash.
> 
> 
> A possible alternative to fixed effects GLS would be
> to reshape the data and
> use -sureg-.  If you constrain the coefficients to
> be equal across
> equations, it will give you the same results fixed
> effects GLS, however,
> sureg would allow the slope coefficients to vary by
> equation as well as
> contemporaneous correlation between the error terms
> across equations.
> 
> Hope this helps,
> Scott
> 
> 
> Example:
> 
> The do file:
> preserve
> use http://www.stata-press.com/data/r8/grunfeld.dta
> drop kstock
> keep if comp <4
> 
> xtreg invest mvalue , fe
> 
> xi i.com
> xtgls invest mva _*, panel(corr)
> 
> drop _*
> 
> reshape wide invest mvalue , i(year)  j(company)
> forv i  = 1/3 {
>  local  rhs " `rhs' (invest`i'  mvalue`i'  )"
>  }
> di "`rhs'"
> 
> constraint 1  [invest1]mvalue1 = [invest2]mvalue2
> constrain 2 [invest2]mvalue2 = [invest3]mvalue3
> sureg `rhs' ,const(1 2) corr
> 
> restore
> 
> The results:
> 
> . preserve
> 
> . use
> http://www.stata-press.com/data/r8/grunfeld.dta
> 
> . drop kstock
> 
> . keep if comp <4
> (140 observations deleted)
> 
> .
> . xtreg invest mvalue , fe
> 
> Fixed-effects (within) regression              
> Number of obs      =
> 60
> Group variable (i): company                    
> Number of groups   =
> 3
> 
> R-sq:  within  = 0.3725                         Obs
> per group: min =
> 20
>        between = 0.6451                             
>           avg =
> 20.0
>        overall = 0.5131                             
>           max =
> 20
> 
>                                                
> F(1,56)            =
> 33.25
> corr(u_i, Xb)  = -0.3598                        Prob
> > F           =
> 0.0000
> 
>
----------------------------------------------------------------------------
> --
>       invest |      Coef.   Std. Err.      t   
> P>|t|     [95% Conf.
> Interval]
>
-------------+--------------------------------------------------------------
> --
>       mvalue |   .1982563   .0343844     5.77  
> 0.000     .1293759
> .2671366
>        _cons |  -171.4112   96.63739    -1.77  
> 0.082    -364.9991
> 22.17679
>
-------------+--------------------------------------------------------------
> --
>      sigma_u |  166.11924
>      sigma_e |  155.73559
>          rho |  .53222836   (fraction of variance
> due to u_i)
>
----------------------------------------------------------------------------
> --
> F test that all u_i=0:     F(2, 56) =    19.81      
>         Prob > F =
> 0.0000
> 
> .
> . xi i.com
> i.company         _Icompany_1-3       (naturally
> coded; _Icompany_1 omitted)
> 
> . xtgls invest mva _*, panel(corr)
> 
> Cross-sectional time-series FGLS regression
> 
> Coefficients:  generalized least squares
> Panels:        heteroskedastic with cross-sectional
> correlation
> Correlation:   no autocorrelation
> 
> Estimated covariances      =         6         
> Number of obs      =
> 60
> Estimated autocorrelations =         0         
> Number of groups   =
> 3
> Estimated coefficients     =         4          Time
> periods       =
> 20
>                                                 Wald
> chi2(3)       =
> 244.45
> Log likelihood             = -362.3947          Prob
> > chi2        =
> 0.0000
> 
>
----------------------------------------------------------------------------
> --
>       invest |      Coef.   Std. Err.      z   
> P>|z|     [95% Conf.
> Interval]
>
-------------+--------------------------------------------------------------
> --
>       mvalue |   .1166626   .0323914     3.60  
> 0.000     .0531767
> .1801485
>  _Icompany_2 |   78.01431   86.04438     0.91  
> 0.365    -90.62957
> 246.6582
>  _Icompany_3 |  -226.6125   89.96582    -2.52
> .012    -402.9423    -50.2827
>        _cons |   102.4225   149.0675     0.69  
> 0.492    -189.7444
> 394.5895
>
----------------------------------------------------------------------------
> --
> 
> .
> . drop _*
> 
> .
> . reshape wide invest mvalue , i(year)  j(company)
> (note: j = 1 2 3)
> 
> Data                               long   ->   wide
>
----------------------------------------------------------------------------
> -
> Number of obs.                       60   ->      20
> Number of variables                   5   ->       8
> j variable (3 values)           company   ->  
> (dropped)
> 
=== message truncated ===


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index