[R] cluster option in stata for random intercept model in the R language?

Martin Batholdy batholdy at googlemail.com
Tue Oct 15 12:32:34 CEST 2013

Dear R-list,

I am currently working on a dataset with a colleague who uses stata.
We fit a random intercept model to the data (decisions clustered in participants) and get closely the same results in stata (using xtreg re) and R (using the lme4 or multilevel package).

Now in stata, there is an additional option for the regression to control for clustering; the vce(cluster clustvar) option, which changes the standard errors quite a bit.
(see http://www.stata.com/support/faqs/statistics/standard-errors-and-vce-cluster-option/ or http://www.stata.com/manuals13/xtxtreg.pdf).

Unfortunately I don't understand what this 'correction' does and why it yields different results.
First I thought it would control for autocorrelations over time (decisions), but if I model this directly with a random-intercept random-slope model, I don't get nearly the same results.

Can someone help me understand what stata is doing here?
And what would be the equivalent in R to get similar results?


More information about the R-help mailing list