Skip to content
Prev 245 / 20628 Next

random effect variance per treatment group in lmer

"Douglas Bates" <bates at stat.wisc.edu> on Friday, July 13, 2007 at 12:16 PM -0500 wrote:

            
rep(1:n.timepoints, n.subj.per.tx*2) was a cheesy way of turning time back into a quantitative predictor.

Since rep(1:n.timepoints, n.subj.per.tx*2)*drug wasn't wrapped in I(), this expression in the context of a model formula indicates that there's a fixed linear effect of time, a main effect of drug, and an interaction term (in other words letting the
fixed effect of time be different for the "D" condition than it is for the "P" condition).
"Douglas Bates" <bates at stat.wisc.edu> on Friday, July 13, 2007 at 12:16 PM -0500 wrote:

            
Yes, that would be clearer! As would adding a variable to the data frame for quantitative time! This would allow a fairly simple lmer call like

fm.het <- lmer( dv ~ time.num*drug + (0+Dind|Patient) + (0+Pind|Patient), ... )
for a parameterization in terms of an interaction
or
fm.het <- lmer( dv ~ drug/time.num + (0+Dind|Patient) + (0+Pind|Patient), ... )
for a parameterization in terms of the time course being nested within level of drug
--
Alan B. Cobo-Lewis, Ph.D.		(207) 581-3840 tel
Department of Psychology		(207) 581-6128 fax
University of Maine
Orono, ME 04469-5742     		alanc at maine.edu

http://www.umaine.edu/visualperception