Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: RE: cluster with multiple groups


From   Austin Nichols <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: cluster with multiple groups
Date   Sat, 6 Mar 2010 20:56:07 -0500

Fabio--

If you mean to cluster by distinct combinations of three variables,
e.g. if var1 is country and var2 is province code within country and
var3 is city code, and you think errors are correlated within city,
then
egen c=group(var1 var2 var3)
and cluster on c.

On Sat, Mar 6, 2010 at 3:57 PM, Schaffer, Mark E <M.E.Schaffer@hw.ac.uk> wrote:
> Fabio,
>
>> -----Original Message-----
>> From: owner-statalist@hsphsun2.harvard.edu
>> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Fabio Zona
>> Sent: 06 March 2010 20:53
>> To: statalist@hsphsun2.harvard.edu
>> Subject: st: cluster with multiple groups
>>
>> Dear statalist
>> when I use the cluster option, can I cluster around more than
>> one variable? For instance:
>>
>>
>> command y x z ..., cluster(var1 var2 var3)
>
> ivreg2, available from ssc in the usual way, supports 2-way clustering.
>
> Cheers,
> Mark
*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index