[R-sig-ME] contrasts in lmer to test difference in growth models
Malcolm Fairbrother
m.fairbrother at bristol.ac.uk
Wed Nov 28 13:15:40 CET 2012
Dear Carl,
My instinct would be to use a parametric bootstrap on your model, then calculate/plot 95% confidence intervals for the expected performance of students with different treatments over time.
It's not hard, and wouldn't take long with your data and model. You can use the "refit" and "simulate" functions, calculate expected performance using the parameter estimates generated by each bootstrap, and then take the 2.5th and 97.5th percentiles. This would be good way to report your model results anyway.
Just as another observation, if you only have three time points, you might model time as a factor rather than a continuous variable. This will increase the number of interaction terms, but might reveal non-linear time effects.
Hope this helps.
Cheers,
Malcolm
> Date: Tue, 27 Nov 2012 15:57:24 +0000
> From: Carl Lamote <Carl.Lamote at ppw.kuleuven.be>
> To: "r-sig-mixed-models at r-project.org"
> <r-sig-mixed-models at r-project.org>
> Subject: [R-sig-ME] contrasts in lmer to test difference in growth
> models
> Message-ID:
> <B73FF2DF7DFE6D44B1F56DA4F7E88F77111B7381 at ICTS-S-MBX3.luna.kuleuven.be>
>
> Content-Type: text/plain
>
> Dear R-mixed models members,
>
> For my PhD, I'm working with multilevel models on educational data. However, I'm struggling with some basic concepts and implementations in R (I'm used to MLwiN). Basically, I'm trying to estimate the effect of grade retention on achievement in the years after grade retention. I split up the 'grade retention' into several conditions (reflecting the situation in Flanders, Belgium). A short summary of what I'm doing:
>
> Dependent variable: NL (language achievement)
> Independent variable: TIME (0,1,2), treat (0,1,2,3).
> Following Singer & Willett (2003), I nested the 'time' into the students (IDlln) and students into schools (SCHOOL). The - very simple - example model looks as follows (I first did a propensity score matching and work with the weights of the MatchIt package, but that is not important in this example):
>
> Model1=lmer(NL~1+TIME*factor(treat)+(1|IDlln)+(1|SCHOOL),data=datagroei.dat,REML=FALSE)
>
> I get the following output:
>
> Formula: NL ~ 1 + TIME * factor(treat) + (factor(treat)/TIME) + (1 | IDlln) + (1 | SCHOOL)
> Data: datagroei.dat
> AIC BIC logLik deviance REMLdev
> 7523 7592 -3750 7501 7536
> Random effects:
> Groups Name Variance Std.Dev.
> IDlln (Intercept) 0.17087 0.41337
> SCHOOL (Intercept) 0.21577 0.46451
> Residual 0.29760 0.54553
> Number of obs: 4144, groups: IDlln, 1595; SCHOOL, 48
>
> Fixed effects:
> Estimate Std. Error t value
> (Intercept) -0.75356 0.07910 -9.527
> TIME -0.10915 0.02055 -5.311
> factor(treat)1 -0.24797 0.05480 -4.525
> factor(treat)2 -0.06242 0.07868 -0.793
> factor(treat)3 -0.22599 0.08254 -2.738
> TIME:factor(treat)1 0.10704 0.02474 4.326
> TIME:factor(treat)2 -0.24052 0.05300 -4.538
> TIME:factor(treat)3 -0.37148 0.06052 -6.139
>
> Correlation of Fixed Effects:
> (Intr) TIME fct()1 fct()2 fct()3 TIME:()1 TIME:()2
> TIME -0.241
> factr(trt)1 -0.374 0.347
> factr(trt)2 -0.267 0.243 0.399
> factr(trt)3 -0.251 0.233 0.347 0.244
> TIME:fct()1 0.199 -0.831 -0.409 -0.201 -0.192
> TIME:fct()2 0.093 -0.388 -0.134 -0.479 -0.086 0.322
> TIME:fct()3 0.090 -0.339 -0.122 -0.087 -0.395 0.282 0.131
>
> My question now is very simple: although I know the difference in growth of the treatment-groups compared to the reference group and whether this growth is significant (which it is). But I also want to test whether these treatment group differ at the last time point (at time 2); whether treatment group 2 has a significantly higher score at Time 2 compared to treatment group 3 (or 1). This sounds like I'll need to test for contrasts, isn't it? For the last two days, I read a lot about these contrasts, but I have still no clue on how to implement these in my model. Or is there a more easy answer to my question?
>
> The (example) data can be found at: https://perswww.kuleuven.be/~u0064197/Growth_upload.txt.
>
> Thank you in advance!
>
> Kind regards,
> Carl Lamote
>
> PS: I hope I followed all the forum-rules in describing the situation and providing the dataset? If not, please say so!
More information about the R-sig-mixed-models
mailing list