Modelling Count Data in R: A Multilevel Framework
A Quick Practical Guide
One of my research areas of interest revolves around understanding human mobility and migration flows. Key attributes of flow data are that they are counts and a right-skewed, overdispesed and often zero-inflated distribution. And I was interested in measuring the variability in region-specific intercepts and slopes in a multilevel modelling framework in R! So, I decided to test the most commonly used R packages to fit four different variants: Poisson, Zero-inflated Poisson, Negative Binomial and Zero-inflated Negative Binomial models - and I wrote a quick practical guide to do this using three R packages: glmmTMB()
, glmer()
or glmer.nb()
, and lme4
. I wrote the tweet thread when I did this here:
Been modelling count data in a multilevel framework using #rstats & decided to put together this quick guide to sort my thoughts & get a list of common model specs, packages & approaches
— Francisco (@Fcorowe) January 22, 2021
Link to the code if you find it useful: https://t.co/xRhd0Lo9hu pic.twitter.com/xcD7qC3h7s
If you are interested in the guide, click HERE