Bookmark and Share

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


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

st: RE: two-way clustering advice


From   "Schaffer, Mark E" <[email protected]>
To   <[email protected]>
Subject   st: RE: two-way clustering advice
Date   Thu, 30 Aug 2012 00:55:14 +0100

Dmitry,

Have you tried using the partial() option to partial out anything that
isn't of interest?  Maybe your dcid* dummies?  This can reduce the
dimensions of the matrices -ivreg2- is working with quite a lot, and
that would speed things up as well as improve the numerical accuracy.

HTH,
Mark

> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Dimitriy V. Masterov
> Sent: 30 August 2012 00:08
> To: Statalist
> Subject: st: two-way clustering advice
> 
> I am estimating a twelfth-difference panel data equation. My panels
are US
> counties (N=3101) and the variables are measured every month for 2008-
> 2012 (T=53).
> 
> The specification is -ivreg2 S12.(lny L1.x) dcid*, cluster(state
dateym)-. The
> intercept in this model gives me a national trend and the coefficients
on the
> dcid dummies estimate the county trends.
> 
> I would like to cluster at the state level (S=48) and for time, and I
was hoping
> to use the user-written ivreg2. This has been running more than ten
times
> longer than it takes to cluster on state or time alone, so I am not
sure why it's
> taking so long. My understanding is that Stata actually calculates the
variance
> covariance matrix as
> Cov(cluster(state)) + Cov(cluster(time)-Cov(cluster(state*time))), so
there
> are 3 separate regressions that are estimated, but this seems fairly
doable.
> Toy models seem to work very well. Any advice about how I can figure
out
> where the bottleneck is?
> 
> I have not tried cluster2 (from
> http://www.kellogg.northwestern.edu/faculty/petersen/htm/papers/se/se
> _programming.htm)
> yet, since it does not have as rich a set of diagnostics.
> 
> DVM
> *
> *   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 the Sunday Times
Scottish University of the Year 2011-2012

We invite research leaders and ambitious early career researchers to 
join us in leading and driving research in key inter-disciplinary themes. 
Please see www.hw.ac.uk/researchleaders for further information and how
to apply.

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


*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index