I am analyzing my data using a generalized linear mixed model in R. My design has three categorical variables:
proficiency
(three levels: Chinese vs English vs Japanese),a between subject effect, that is, three groups of participantsfunction
(two levels: component vs radical), a between-subject effectposition
(five levels: left, right,top,bottom, inside), a within-subject effect- and the dependent variable
response
is binomial (0 or 1)
I model these three categorical variables as fixed effects while subject
(the participants) and item
(the experimental trail) are random effects. The R code looks like this:
glmm <- glmer(formula=response~proficiency*function*position+
(1|item)+(1|subject),
family=binomial, data=data1,
control=glmerControl(optimizer="bobyqa"))
My questions are:
-
I would like to see the interaction between these three IVs (proficiencyfunctionposition). Is the R code suitable? How could I get the $p$-value of this interaction?
-
How do I interpret the results? Since the model sets English, component and bottom as the baseline levels by default, I cannot find the comparison of the baseline. So the question is, how could I do the comparison between different levels?
-
After looking though the websites, somebody suggested that by
relevel
the baseline then can find the results of different levels, but I found that the estimate and the $p$-value change by releveling the baseline. -
Somebody suggested using the
glht
function, but the output is general linear hypotheses rather than generalized linear mixed model. Does that influence the validity of the results?
Best Answer
The simplest approach is to do a likelihood ratio test between the model with and without this interaction;
drop1(glmm,test="Chisq")
should also work; you may also be interested inafex::mixed(glmm)
There are several different packages (
lsmeans
,effects
,multcomp
) that are designed for post hoc computation of expected values for particular levels and/or comparisons between particular levels.This is inevitable. The main effects are defined in terms of the baseline levels of the other parameters in the model (for example, the "main effect of French" is defined as "the effect of switching from English (baseline level) to French when the other predictors are at their baseline levels [component, bottom]"). The only time when the results will not depend on the factor definitions is in a model with no interactions (and a perfectly orthogonal design).
No.
glht
should work. Most forms of extensions of the linear model (e.g. generalized linear models and generalized linear mixed models) rely on the ability to make inferences, at least approximately, based on the underlying linear parameterizations.