Skip to main content
. 2018 Fall;17(3):rm2. doi: 10.1187/cbe.17-12-0280

TABLE 2.

Random effects can be implemented in regression models that model various types of outcome variablesa

Implementation in R
Outcome data type Example in DBER Regression type (R function) With random effect (R function) R package R syntax
Continuous Exam points Linear model (lm) Linear mixed effects model (lmer) lme4b Mod ← lmer(outcome ∼ predictor, data = data)
Binary (0/1; yes/no) Pass/fail Binomial (glm) Generalized linear mixed effects model (glmer) lme4b Mod ← glmer(outcome ∼ predictor, family = binomial, data = data)
Proportion Proportion of classes attended Binomial (glm, family = binomial) Generalized linear mixed effects model (glmer) lme4b Mod ← glmer(cbind(numerator, denominator) ∼ predictor, family = binomial, data = data)
Count Number of hand-raises Poisson (glm, family = Poisson) Generalized linear mixed effects model (glmer) lme4b Mod ← glmer(outcome ∼ predictor, family = Poisson, data = data)
Likert; categorical ordinal Agree–neutral–­disagree Proportional odds or ordered logit (polr) Cumulative link mixed model (clmm) ordinalc Mod ← clmm(as.factor(outcome) ∼ predictor, data = data)

aSome of the most common types of discipline-based education research (DBER) outcome variables can be categorized as continuous, binary, proportion, count, or on a Likert scale. This table shows the most common types of data in DBER and the corresponding implementation of multilevel models in R, including a recommended R package and corresponding syntax for model specification.