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....?
LMER MODEL summary(lmer(AnxietyScore ~ cc + (1|SetID), data=mydf)) Linear mixed model fit by REML Formula: AnxietyScore ~ cc + (1 | SetID) Data: mydf AIC BIC logLik deviance REMLdev 493.4 503.4 -242.7 486.6 485.4 Random effects: Groups Name Variance Std.Dev. SetID (Intercept) 1.2819e-09 3.5803e-05 Residual 1.3352e+01 3.6540e+00 Number of obs: 90, groups: SetID, 33 Fixed effects: Estimate Std. Error t value (Intercept) 3.1064 0.5330 5.828 cc 2.3122 0.7711 2.999 Correlation of Fixed Effects: (Intr) cc -0.691 STATA XTMIXED xtmixed anxietyscore cc || setid:, reml Mixed-effects REML regression Number of obs = 90 Group variable: setid Number of groups = 33 Log restricted-likelihood = -242.48259 Prob > chi2 = 0.0023 ------------------------------------------------------------------------------ anxietyscore | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- cc | 2.289007 .7492766 3.05 0.002 .8204519 3.757562 _cons | 3.116074 .5464282 5.70 0.000 2.045094 4.187053 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ setid: Identity | sd(_cons) | 1.002484 .797775 .2107137 4.769382 -----------------------------+------------------------------------------------ sd(Residual) | 3.515888 .3281988 2.928045 4.22175 ------------------------------------------------------------------------------ with thanks & best wishes M [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.