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]

st: Replicating Stata's xtreg clustered SEs in R


From   "David A. Kim" <david_kim@hms.harvard.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: Replicating Stata's xtreg clustered SEs in R
Date   Mon, 12 Mar 2012 00:45:06 -0400

I'm trying to replicate a time-series cross-sectional analysis
(countries over years) with SEs clustered by country.  The original
analysis was done in Stata 10 with: xtreg [DV] [IVs] fe
cluster(country).

Using plm() in R (cran.r-project.org/web/packages/plm/index.html),
I've replicated the coefficients. I sought to estimate
country-clustered SEs with vcovHC(), and tried a variety of options,
but couldn't exactly replicate the published (i.e., Stata 10's) SEs.
In R, vcovHC(x, method="arellano", type="HC1", cluster="group") came
closest to Stata's SEs (differing at the 3rd decimal place or so).

Does anyone happen to know what method cluster() for Stata's xtreg
uses to calculate clustered SEs for panel data, and/or how this could
be implemented equivalently in R?  Any help would be much appreciated.

Thanks in advance,

David

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