Solved – Understanding binomial GLMM with three fixed factors

categorical dataglmminteractionlme4-nlmer

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 participants
  • function (two levels: component vs radical), a between-subject effect
  • position (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:

  1. 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?

  2. 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?

  3. 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.

  4. 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

  1. I would like to see the interaction between these three IVs (proficiency*function*position). Is the R code suitable? How could I get the p-value of this interaction?

The simplest approach is to do a likelihood ratio test between the model with and without this interaction;

glmm_noint <- update(glmm, . ~ . - proficiency:function:position)
anova(glmm_noint,glmm)

drop1(glmm,test="Chisq") should also work; you may also be interested in afex::mixed(glmm)

  1. 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? (For example, English.component.bottom vs English.radical.bottom, since English, component and bottom were set as the baseline, I could not find them in the output of the model.)

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.

  1. 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.

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).

  1. 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?

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.

Related Question