Skip to content

Some Basic lmer Questions

4 messages · Kevin E. Thorpe, Andrew Robinson, Sundar Dorai-Raj +1 more

#
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?

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.
#
Hi Kevin,

welcome to the wonderful world of mixed-models!  I heartily recommend
that you read the following books: Gelman and Hill, and Pinehiro and
Bates.
On Mon, Jan 14, 2008 at 03:21:20PM -0500, Kevin E. Thorpe wrote:
It's under discussion.  The current recommendation is to use
mcmcsamp to sample the posterior distribution.
It's plausible.  You could also try GAMM in mgcv.
See above!

Andrew
#
Andrew Robinson said the following on 1/14/2008 12:50 PM:
With the exception that lmer currently does not support correlation 
structures. If you really need to estimate correlation parameters then 
you may need to use the nlme package.

--sundar
#
On 15/01/2008, at 7:50 AM, Andrew Robinson wrote:

            
For linear mixed models I would also suggest Verbeke and Molenberghs  
"Linear Mixed Models for Longitudinal Data"
While you can make life more complicated AIC is a reasonable method.  
This is criticised as it is not the same as statistical significance  
but all we need is a reasonable model for the correlation so that  
inferences about the other parameters are correct.

Ken