Count data

Hierarchical and Mixed Effects Models in R

Richard Erickson

Data Scientist

Examples of count data

  • Events at a rate of time
  • Events per area
  • Differs from binomial because no explicit upper limit
Hierarchical and Mixed Effects Models in R

Alternative to Chi-square test

  • Chi-square test used to compare binned counts
  • Poisson glm can be an alternative
Hierarchical and Mixed Effects Models in R

R Syntax for Poisson regression with `glmer`

glm(y ~ x, family = 'poisson')

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

Marketing click through case study

  • Redesigned website
  • Clicks on different webpages
  • Focus groups looked at old and new
  • Marketer was using a linear mixed model
  • Demonstrate how a generalized model
Hierarchical and Mixed Effects Models in R

Chlamydia by age-group and county data

  • State of IL
  • By county and age group
  • Important for public health
  • Public policy application
  • Marketing/drug research
Hierarchical and Mixed Effects Models in R

Let's apply Poisson regression!

Hierarchical and Mixed Effects Models in R

Preparing Video For Download...