2-way clustered standard errors

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

cmd41
Posts: 15
Joined: Fri Apr 30, 2010 8:23 am

2-way clustered standard errors

Postby cmd41 » Fri Apr 30, 2010 8:38 am

I want to calculate clustered standard errors for the coefficients estimated from OLS regression on panel data. Eviews provides the option to calculate the coefficient covariance matrix using White – cross section and White – period. But the problem is that I want the 2-way clustered standard error, i.e. clustered by BOTH cross section and period (described in page 12 of the attached paper). This is the approach that is currently strongly recommended in research in corporate finance that uses panel data.

I notice that Eviews also has the White – Diagonal option to calculate the standard errors. I am not sure if (1) it will give me directly the 2-way clustered standard errors, or (2) it will give the standard error that is robust across the“intersection”clusters, or (3) it will give something else. In the words of the paper attached, I am not sure the coefficient covariance matrix I’ve got from using the White – Diagonal option is (1) the V matrix, or (2) the VI matrix, or (3) something else.

Any help is highly appreciated!

Chau
Attachments
Gow et al 2009 Correct for Autocorrelation.pdf
(334.41 KiB) Downloaded 624 times

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: 2-way clustered standard errors

Postby EViews Glenn » Fri Apr 30, 2010 10:42 am

You're not going to want the diagonal White.

In my quick reading of the paper, what you first need to do is to compute the clustering in each direction and save the covariances. That will give you V1 and V2.

Getting VI is harder since EViews doesn't offer clustering along an arbitrary dimension (we should do this at some point).

What you'll have to do is to create a new variable that indexes industry-year combinations. Then restructure your workfile page to an undated panel structured by that variable. Estimate the *same* model you estimated when you obtained V1 and V2, with White-period clustered errors (which will give you within cross-section correlation robust errors). Save the covariances as VI.

Then V1 + V2 - VI should give you the desired variance estimates.

This is the kind of thing that is a natural for an add-in since it's not too hard to implement, but does require a bit of monkeying around with the workfile. Someone here might be able to take a look, but no promises. Perhaps you or others will step-in. If you know of an empirical example with readily available data and known results (there is a link in the paper that may be all that is necessary), that certainly will increase the chances that someone will step-up.

cmd41
Posts: 15
Joined: Fri Apr 30, 2010 8:23 am

Re: 2-way clustered standard errors

Postby cmd41 » Wed May 05, 2010 9:12 am

Thank you very much Glenn. The answer is excellent and very to the point. I've followed the suggestions and the results look very "reliable" (as I've compared the results with some "comparable" methodologies).

Chau

cassie_
Posts: 2
Joined: Wed Apr 30, 2014 5:42 pm

Re: 2-way clustered standard errors

Postby cassie_ » Thu May 01, 2014 12:46 am

Hi,

I am trying to do something similar and this post has been useful so far. However, instead of calculating 2-way clustered standard errors by firm and by period, I would like to compute 2-way clustered standard errors by industry and by period (my data is based on firms as the original cross-ids).

I have restructured by workfile to an undated panel structured by industry to calculate the 1-way clustered standard errors by industry (for V1). But I am unsure how to proceed to calculate VI. If I have already clustered by industry, VI from this is the same as V1. Or am I missing something? If I restructure by industry and date then I have a 3 dimensional panel - if a 3 dimensional panel is the right thing, how do I estimate to obtain the white-period clustered errors?

Also, is there a reason why this is being done using white cross-section and white period and not with cross-section SUR (PCSE) and period SUR (PCSE)?

Thanks for your help

Cassie

cassie_
Posts: 2
Joined: Wed Apr 30, 2014 5:42 pm

Re: 2-way clustered standard errors

Postby cassie_ » Mon May 05, 2014 3:55 pm

Hi,

Just wondering if anyone is working on an answer to my above question? Or should I give more information?

Thanks,
Cassie

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: 2-way clustered standard errors

Postby EViews Glenn » Mon May 05, 2014 4:38 pm

Sorry this fell by the wayside. It's different enough that I had to think about it and I'm not certain I fully understand all of the details. Plus, as I note at the bottom, there is a conceptual issue in the exercise with which I am not entirely comfortable....(then I forgot about the post :oops: )

What makes this different (I think) is that you want your clustering by industry and time, when you have data at the firm level. And the industry/time design doesn't match the traditional dated panel data. Thus, I think the following is what you want to do:

Create an undated panel using industry as the identifier. Do White period and save the covariances.
Create an undated panel using period as the identifier. Do White period and save the covariances.
Create an industry/period variable and use that to create an undated panel. Do white period and save the covariances.

Then follow the discussion above.

Note that steps 1 and 2 are slightly different than the prior example since your data are firm based while the clustering is on industry. Basically, you're using artificial panels to define the period and industry clusters. Note also that the computed clustering by industry is odd since it is across both different firms in the industry and time. I think you should give that some thought.

To answer your last question, the PCSEs have slightly stronger assumptions about the correlation structure.


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests