Page 1 of 1

Clustered standard errors

Posted: Sat Jul 13, 2013 12:37 pm
by bobreednz
I am a new user of RATS and have a question about individual clustered standard errors with panel data.

As I understand it, the ROBUST option with LINREG allows one to calculated clustered standard errors when used with the LWINDOW=PANEL option, where the within-unit correlation is unrestricted. Degrees of freedom for hypothesis testing of coefficients = NT-K (for a balanced panel).

This contrasts with how clustered standard errors are calculated in STATA. There a common correlation parameter is calculated for each unit. Degrees of freedom for hypothesis tests of coefficients = N-1, or a related variant (see http://www.stata.com/meeting/uk10/UKSUG10.Baum.pdf ).

Could you please help me understand how I can know which approach is appropriate in a given situation?

Re: Clustered standard errors

Posted: Mon Jul 15, 2013 10:20 am
by TomDoan
The calculations appear to be identical---it's just a question of interpretation of the distribution. The asymptotic distribution is Normal with the sandwich covariance matrix. The papers cited in the Stata talk appear to show that that's overly optimistic as is an NT-K t distribution (which, in practice, would probably be almost identical to the Normal). Even though there's no exact finite sample distribution, they recommend comparing it to a t with just G-1 degrees of freedom. In practice, the difference will matter only when G is relatively small (<50).

If you want to redisplay the table of coefficients and t-stats with the altered significance levels, you can do:

Code: Select all

dec vect withdfc(%nreg)
ewise withdfc(i)=%ttest(%tstats(i),# of groups-1)
report(action=define)
report(regression,extra=neither)
report(atrow=1,atcol=3,fillby=cols) %tstats
report(atrow=1,atcol=4,fillby=cols) withdfc
report(action=show)

Re: Clustered standard errors

Posted: Mon Jul 15, 2013 7:33 pm
by bobreednz
Thanks for the quick response, Tom. A follow-up question. It is my understanding that the assumed error var-cov matrix is not the same for Stata's and Rats' cluster robust. Rats assumes a completely general specification: (e.g., e(sub-g)*e(sub-g)', while Stata assumes a common covariance term for all the off-diagonal elements in the block corresponding to group g. If that is correct (and I'm not 100% sure it is), then the difference is more than just a question of how many degrees of freedom to use. I'd appreciate any insight you could throw my way.

Re: Clustered standard errors

Posted: Tue Jul 16, 2013 9:25 am
by TomDoan
bobreednz wrote:Thanks for the quick response, Tom. A follow-up question. It is my understanding that the assumed error var-cov matrix is not the same for Stata's and Rats' cluster robust. Rats assumes a completely general specification: (e.g., e(sub-g)*e(sub-g)', while Stata assumes a common covariance term for all the off-diagonal elements in the block corresponding to group g. If that is correct (and I'm not 100% sure it is), then the difference is more than just a question of how many degrees of freedom to use. I'd appreciate any insight you could throw my way.
That wasn't my impression. The actual formula used for the Stata calculation is described beginning on page 24, and is the same as what RATS does. The early discussion appears to be theoretical---with particular structures it's possible to compute the change analytically, but the actual calculations are done without making those assumptions.

Re: Clustered standard errors

Posted: Sat Oct 22, 2016 2:10 pm
by mamacle
Hi,

I am a beginner in Panel data. I am trying to estimate a panel error correction model. I have a long panel (T=1303 and N=16). The data exhibits hereroskedasticity, serial correlation and spatial correlation. I am trying to code a fixed effects regression that provides me the corrected standard errors. The code below only allows me to account for heteroskedasticity and correlation within groups. I wonder how can I allow for spatial correlation between the units of the panel.

pregress(method=fixed,effects=time,robust,lwindow=panel) RF
# constant RI Res{1}
report(regress)

Thank you in advance!

C

Re: Clustered standard errors

Posted: Sun Oct 23, 2016 6:17 pm
by TomDoan
There are quite a few things wrong with what you're doing. If you're trying to estimate a cointegrating vector, then you can't do that by fixed effects (i.e. least squares) in the first place. You might want to look at Pesaran, Shin and Smith(1999), "Pooled Mean Group Estimation of Dynamic Heterogeneous Panels", JASA, vol 94, no. 446, pp 621-634. The replication for that is included with RATS. That estimates an ECM allowing for differing variances and adjustment speeds. And even if you could estimate your model by fixed effects, the clustered standard errors calculation has big N-small T asymptotics and you have the exact opposite.

You'd have to see if there has been any work on allowing for spatial effects in panel cointegration models.

Re: Clustered standard errors

Posted: Mon Oct 24, 2016 7:13 am
by mamacle
Hi Tom,

Thank you for your help. In fact, as far as I know there has been done very little work, if any, on allowing for spatial effects in panel cointegration models. I was thinking of perhaps applying Beck and Katz(1995) or Driscoll and Kraay (1998) to my ECM to get the correct standard errors. They both rely on T large. Do you think any of these options would do the job?

Thank you very much in advance!

C