Binomial data

Hierarchical and Mixed Effects Models in R

Richard Erickson

Data Scientist

Examples of binomial data

  • Coin/toss
  • Yes/No
  • Dead/alive
  • Behavior
  • Choice
  • Study result
Hierarchical and Mixed Effects Models in R

Binomial data with glmer

glmer(y ~ x + (1 | group), family = "error term")
Hierarchical and Mixed Effects Models in R

Dose-response case study

  • Study had increasing dose
  • Repeated in triplicate
  • Requires glmer(), not glm()
Hierarchical and Mixed Effects Models in R

Internet purchase

  • "Purchases" or "Pass"
  • "ranking" of product 0 to 20
  • "friend recommendation"
  • Tracked sales with 4 focal groups in different "cities"
  • Do friend recommendations help?
Hierarchical and Mixed Effects Models in R

Odds-ratio

  • Regression coefficients hard to explain
  • Odds-ratios sometimes easier
  • If Group A has odds-ratio of 2.0 $\times$, 2:1 A will do something compared to the other group
  • Extract by exponentiation logistic coefficients
  • exp(coef(modelOut))
Hierarchical and Mixed Effects Models in R

Let's practice!

Hierarchical and Mixed Effects Models in R

Preparing Video For Download...