I once saw the GLMM modeling building process using the following script:
dative.glmm8 <- lmer(RealizationOfRecipient ~ AnimacyOfRec + DefinOfRec +
PronomOfRec * PronomOfTheme + I(AccessOfRec=="given") + AnimacyOfTheme + DefinOfTheme +
I(AccessOfTheme=="given") + log(RatioOfLengthsThemeOverRecipient) + (1|Verb),
family="binomial")
I do not understand the passed argument of “I(AccessOfTheme==”given”)”? What is the physical meaning of this kind of argument setting?
This question is not actually
lmer-specific, but applies to all model formulas in R. In a formula context,I()stands for “insulate”: from http://cran.r-project.org/doc/manuals/R-intro.pdf ,This is essentially creating a dummy (0/1) variable on the fly for
AccessOfRecbeing equal to “given” (1) or anything else (0).You could also do this by creating the variable beforehand, e.g.
AccessOfRec_given <- (AccessOfRec=="given"), and then using the derived variable in the formula.By the way, I would strongly recommend using the
dataargument tolmer, rather than either using variables from the global workspace orattach()ing data frames.