Two-way cluster robust standard error
Posted: Sat Jul 17, 2010 9:10 am
Hi,
I posted a while ago asking for instruction to estimate two-way cluster robust standard errors (i.e. clustered by BOTH cross section and period, as described in page 12 of the attached paper). Glenn kindly provided me with the answer, which I very much appreciate. I quote Glenn's answer below:
"...
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.
..."
I followed the instructed procedures to estimate quite a few equations, and things seemed to run smoothly untill I had the following error message: "Log or square root of negative number in "Vector..." in one instance.
I understand that I have a negative value in the diagonal of the covariance matrix, but could not figure out why. Any help is very much appreciated!
I basically try to regress wc_ab_prod on a constant and 4 independent variables: wl_mvye_la1_dev, wc_bm_la1_dev, wc_roa_dev and jb_ov (which is dummy with value of 1 and 0). Attached is the excerp of the data and my program.
I hope I can have some feedbacks. Thanks in advance!
Chau
I posted a while ago asking for instruction to estimate two-way cluster robust standard errors (i.e. clustered by BOTH cross section and period, as described in page 12 of the attached paper). Glenn kindly provided me with the answer, which I very much appreciate. I quote Glenn's answer below:
"...
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.
..."
I followed the instructed procedures to estimate quite a few equations, and things seemed to run smoothly untill I had the following error message: "Log or square root of negative number in "Vector..." in one instance.
I understand that I have a negative value in the diagonal of the covariance matrix, but could not figure out why. Any help is very much appreciated!
I basically try to regress wc_ab_prod on a constant and 4 independent variables: wl_mvye_la1_dev, wc_bm_la1_dev, wc_roa_dev and jb_ov (which is dummy with value of 1 and 0). Attached is the excerp of the data and my program.
I hope I can have some feedbacks. Thanks in advance!
Chau