Hi, Sorry for a basic questions on linear models.
I am trying to adjust raw data for both fixed and mixed effects. The data that I output should account for these effects, so that I can use the adjusted data for further analysis. For example, if I have the blood sugar levels for 30 patients, and I know that 'weight' is a fixed effect and that 'height' is a random effect, what I'd want as output is blood sugar levels that have been adjusted for these effects. ==================== library("lme4") sugar <- c(1:10,sample(1:100,20)) weight <- 1:30 height <- rep(sample(1:15,15,replace=F),2) lm.adj <- lmer(sugar ~ weight + (1|height)) adjusted.sugar <- fitted(lm.adj) ===================== I'm not sure if I'm doing this right...? thanks! [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.