[R] Very small random effect estimation in lmer but not in stata xtmixed

Thomas Lumley tlumley at uw.edu
Thu May 3 22:24:57 CEST 2012


On Thu, May 3, 2012 at 11:50 PM, Mohammed Mohammed
<M.A.MOHAMMED at bham.ac.uk> wrote:
> Hi folks
>
> I am using the lmer function (in the lme4 library) to analyse some data where individuals are clustered into sets (using the SetID variable) with a single fixed effect (cc - 0 or 1). The lmer model and output is shown below.
> Whilst the fixed effects are consistent with stata (using xtmixed, see below), the std dev of the random effect for SetID is very very small (3.5803e-05)compared to stata's (see below 1.002). Any ideas why this should be happening please....?
>

You're not fitting the same model.  Like SAS, Stata by default assumes
that random effects are independent of each other, so your Stata model
has correlation between the random effects forced to zero.  The R
model estimates the correlation, and finds it to be far from zero
(-0.69).

   -thomas

-- 
Thomas Lumley
Professor of Biostatistics
University of Auckland



More information about the R-help mailing list