[R] Fitting a linear model with lmer in the lme4 package

syrvn mentor_ at gmx.net
Mon Nov 28 15:50:44 CET 2011


I need to fit a "Nested Random Effects ANOVA model" with the lmer function
in the lme4 package.

I read through the documentation 


and the data structure of the "Pastes" data set looks almost

exactly like mine. The only difference is that I have another factor which
distinguishes controls

from diseased patients.

For the "Pastes" data set they fittet their "Nested Random Effects model" as
lmer(strength ~ 1 + (1|sample) + (1|batch), Pastes, REML=FALSE)

My data strucute looks like as follows:

I am not sure of how to fit my model now. Would it be as simple as only
adding the third factor?
lmer(Protein_1 ~ 1 + (1|Group) + (1|Sub_Disease) + (1|Disease)) ?


View this message in context: http://r.789695.n4.nabble.com/Fitting-a-linear-model-with-lmer-in-the-lme4-package-tp4115455p4115455.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list