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.
'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?