[R] Discrepency between R and MlwiN

Damian Betebenner damian.betebenner at bc.edu
Mon Sep 13 01:44:30 CEST 2004

When playing around fitting unconditional growth models using R and MlwiN today, I produced two different sets of estimates that I can't reconcile and wondered if anyone here has an idea:

The data is two-level repeated measures data with measures nested within child. There are two measures per child. I've fit an unconditional growth model as in Singer and Willet (2003) that allows for variable intercepts
and slopes.

The R code for the analysis is:

model.uncgrowth.2lev <- lme(math ~ grade, mathdata, random=~grade|studentid)

The fixed effects estimates for the intercept and slope are the same between MlwiN and R. It's the random
effects estimates that differ. In particular, the residual error variance is ZERO using MlwiN and significantly
non-zero using R. It appears that MlwiN perfectly fits lines to each of the two data points supplied for each
student and R does not. The two program yield the same results when the covariate grade is treated as a fixed effect. Also, I used REML on both R and MlwiN.

Anyone have any idea how to explain this descrpency?

Damian Betebenner
Boston College
Chestnut Hill, MA 02467

More information about the R-help mailing list