[R-sig-ME] Output and post-hoc comparisons for lme with splines specification of fixed effects

Cole, Tim tim.cole at ucl.ac.uk
Thu Apr 7 14:39:33 CEST 2016


Dear Gabriela,

I think this addresses your first question:

model <- lme( Damage ~ bs( Location , degree=1, df=5) * Disease,
              random=~1| PatientID,
              data=my.data, na.action=na.omit, method="ML")

x <- with(my.data, seq(min(Location), max(Location), length.out=50))
pred0 <- predict(model, newdata=data.frame(Location=x, Disease=0), level=0)
pred1 <- predict(model, newdata=data.frame(Location=x, Disease=1), level=0)
plot(x, pred0, type='l', xlab='Location', ylab='Damage')
lines(x, pred1, col=2)

I'm not sure I follow your second question.

Best wishes,
Tim Cole
---
Tim.Cole at ucl.ac.uk<mailto:Tim.Cole at ich.ucl.ac.uk> Phone +44(0)20 7905 2666 Fax +44(0)20 7905 2381
Population Policy and Practice Programme
UCL Institute of Child Health, London WC1N 1EH, UK


Date: Mon, 4 Apr 2016 18:38:29 +0100
From: Gabriela Czanner <g.czanner at googlemail.com<mailto:g.czanner at googlemail.com>>
To: r-sig-mixed-models at r-project.org<mailto:r-sig-mixed-models at r-project.org>
Subject: [R-sig-ME] Output and post-hoc comparisons for lme with
splines specification of fixed effects

Dear R-users,

I am attempting to estimate a difference in damage across space (at 24
locations) for two disease types of patients (defined as a factor, 0
disease absent, 1 disease present). Examining the plots of the damage
across the 24 locations in space it appears that the damage increases then
decreases and it is best described by a spline specification like this:

model<- lme( Damage ~ bs( Location , degree=1, df=5) * Disease,
              random=~1| PatientID,
              data=my.data,na.action=na.omit,method="ML")

I wonder if any one can advice with my questions: How can I plot the
predicted mean profiles of the damage for the two groups? How can I make
post-hoc comparison of mean damage across the two disease groups of
patients?

I did tried many online searches but did not find a good answer. So I will
really appreciate your advice!

Gabriela

--
Gabriela Czanner, PhD
Lecturer
Department of Biostatistics
Department of Eye and Vision Science
University of Liverpool


	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list