Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# st: Re: IVREG2 and Multi-way Clustering

 From Jessie C To statalist@hsphsun2.harvard.edu Subject st: Re: IVREG2 and Multi-way Clustering Date Sun, 29 Jan 2012 16:42:08 -0500

```Mark,

Thank you very much for your response and for taking the time to help
out.  I greatly appreciate it.

1. Your example makes sense of the 2 X 2.  z_1 has 2 clusters.  z_2
has 2 clusters.  The union of z_1 and z_2 is 4 clusters but also 4
observations.

I don't quite understand then the 2-way clustering formula in terms of
1-way clusters.

Cameron, Gelbach, and Miller say:

1. OLS regression of y on X with variance matrix estimate computed
using clustering on g in the set of {1, 2, ...G};
2. OLS regression of y on X with variance matrix estimate computed
using clustering on h  in the set of {1, 2, ...H};
3. OLS regression of y on X with variance matrix estimate computed
using clustering on (g, h)  in the set of {(1, 1), ..., (G, H)};

Given these three components, V[beta] is computed as the sum of the
?first and second components, minus the third component.

I thought that would correspond with:
i. reg y x, cluster(g)
ii. reg y x, cluster(h)
iii. reg y x, cluster(i) where egen i = group(g h)
and the standard error is se(i) + se(ii) - se(iii) or
sqrt(se(i)^2 + se(ii)^2 - se(iii)^2)

I tried an example in Stata and it worked out using the sqrt formula.
Not sure if that's just a coincidence.

2. If I'm understanding correctly, the correction to ivreg2 is an

I am wondering whether you have any response to using the t-statistic
of G-L as suggested in:
http://www.stata.com/meeting/mexico11/materials/cameron.pdf
Section 4, slide 17

Thank you so much for everything!!

On Sun, Jan 29, 2012 at 11:54 AM, Jessie C <jessiecoh@gmail.com> wrote:
> I have 2 questions about two-way clustering using ivreg2.
>
> 1. What would be the 1-way cluster equivalent of the following 2-way clustering?
>
> ivreg2 y x, cluster(z_1, z_2)
>
> I thought it would be
> a. ivreg2 y x, cluster(z_1)
> b. ivreg2 y x, cluster(z_2)
> c. ivreg2 y x, cluster(z) where egen z = group(z_1 z_2)
> and the two-way standard error on x would be the standard error in a +
> the standard error in b - the standard error in c
> or would it be sqrt(se(a)^2 + se(b)^2 - se(c)^2)
>
> Note. That is not the full model, but I thought would be illustrative
> to get at the main issue.
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```