Skip to content
Prev 12290 / 20628 Next

lmer random and fixed effect?

Greetings,

I have been looking more into mixed models recently and have run into a
situation that confuses me.  I was initially under the impression that
fixed and random effect variables are separate, however can they be both in
an lmer model and if so why would you do so?

Such as example is with the following dataset:
lmm.data <- read.table("
http://www.unt.edu/rss/class/Jon/R_SC/Module9/lmm.data.txt",
                       header=TRUE, sep=",", na.strings="NA", dec=".",
strip.white=TRUE)

Reading online, I have found the following model:
require(lme4)
fit <- lmer(formula = extro~open+agree+social+class+(1|school/class), data
= lmm.data)

Everything runs fine but I am confused as to what this actually means or if
it is even appropriate.

Thank you for any insight,
Regards,