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 "Schaffer, Mark E" To Subject st: RE: IVREG2 and Multi-way Clustering Date Sun, 29 Jan 2012 21:02:54 -0000

```Jessie,

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Jessie C
> Sent: 29 January 2012 16:54
> To: statalist@hsphsun2.harvard.edu
> Subject: st: IVREG2 and Multi-way Clustering
>
> 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)

None of the three.  Two-way clustering is different from one-way
clustering.

The difference between (c) and 2-way clustering on z_1 and z_2 can be
seen from a very simple 2x2 case.  z_1 is either A or a.  z_2 is either
B or b.  You have 4 obs: AB, Ab, aB, ab.

Your (c) would define 4 groups and put 1 ob in each group.  The
cluster-robustness is completely lost.  2-way clustering defines 2
groups and is robust to clustering within the A/a and B/b groups.

> 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.
>
> 2. Does ivreg2 adjust standard errors in anyway if 1 of the
> clusters if small in number (e.g. 12 clusters in z_2)?
> Should there be any adjustment made or does there not need to
> be if z_1 is sufficiently large in size (e.g. 1000 clusters)?

This is in the -ivreg2- help file, under "Small sample corrections":

"If cluster is chosen, the finite sample adjustment qc =
(N-1)/(N-K)*M/(M-1) if small, where M=number of clusters, qc = 1
otherwise.  If 2-way clustering is used, M=min(M1,M2), where M1=number
of clusters in group 1 and M2=number of clusters in group 2."

Cheers,
Mark

>
> I would be very grateful for any help you could provide.
> *
> *   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/
>

--
Heriot-Watt University is a Scottish charity
registered under charity number SC000278.

Heriot-Watt University is the Sunday Times
Scottish University of the Year 2011-2012

*
*   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/
```