Some Basic lmer Questions
I am taking my first cautious steps into the mixed-models pool and I have a few, probably basic questions. The data I am faced with are lab values taken at regular time intervals (0, 4, 8, 12 and 24 hours) following a surgery.
str(trop)
'data.frame': 790 obs. of 6 variables: $ pid : int 0 0 0 0 0 1 1 1 1 1 ... $ ittrx: int 1 1 1 1 1 2 2 2 2 2 ... $ pprx : int 1 1 1 1 1 2 2 2 2 2 ... $ rx3 : Factor w/ 3 levels "On","Off","Converted": 1 1 1 1 1 2 2 2 2 2 ... $ hours: num 0 4 8 12 24 0 4 8 12 24 ... $ trop : num 2.12 9.51 5.79 4.37 1.8 NA NA NA NA NA ... - attr(*, "reshapeLong")=List of 4 ..$ varying:List of 1 .. ..$ : chr "Trop0" "Trop4" "Trop8" "Trop12" ... ..$ v.names: chr "trop" ..$ idvar : chr "pid" ..$ timevar: chr "hours" Of interest is whether or not there are differences among the groups represented by rx3 above. If we pretend for the moment that the time effect is linear and there is no treatment by time interaction, I would be inclined to test for differences as follows (also ignoring any correlation structure). trop.lme0 <- lmer(trop~hours+(1|pid),data=trop,method="ML") trop.lme1 <- lmer(trop~rx3+hours+(1|pid),data=trop,method="ML") anova(trop.lme0,trop.lme1) I seem to recall hearing/reading that the LRT from anova() is appropriate for maximum-likelihood but not REML which is why I used method="ML". So, is this the right approach or have I seriously misunderstood something? Next, assuming I have not done anything egregious, I want to turn to the non-linearity of the time effect. I found that I can use ns() in the splines package to include a spline term for hours, but is this the right approach? I could also see making hours a factor to allow for non-linearity as well. Finally, (and feel free to point me at suitable references) how does one determine the appropriate correlation structure to use in these models? Thanks for your time.
Kevin E. Thorpe Biostatistician/Trialist, Knowledge Translation Program Assistant Professor, Department of Public Health Sciences Faculty of Medicine, University of Toronto email: kevin.thorpe at utoronto.ca Tel: 416.864.5776 Fax: 416.864.6057