I'm trying to find the best way to model count data collected over three years. I have data representing the number of complaints pre-schools in one city has received for the years 2017, 2018 and 2019. There are roughly 200 pre-schools represented each year, but the number differs from one year to the next. I also have data for five explanatory variables each year, the same variables every year.

My data looks something like the following:

School Year Complaints X1 X2 X3 X4 X5 A 2017 23 .23 ........... A 2018 19 .35 ........... A 2019 24 .31 ........... B 2017 6 .24 ........... B 2018 9 .23 ........... B 2019 12 .24 ........... . . .

My question is the following: What would be the best way to model my data if I want to find out what x-variables have an effect on the outcome, the number of complaints? My first thought was to use a Poisson Time-Series Regression Model, but I don't know how to handle the fact that I have data from over 200 individual schools and not just one.

My second thought was to use panel data (not sure what the correct term is), but I have no experience at all working with panel data.

My third idea would be to build three separate Poisson Regression Models, one for each year, and compare the three models to see if the same x-variables are significant each year. If I would use this approach I think I would end up with additional problems if I wanted to compare coefficient effects between models, I imagine calculating the standard errors would be a nightmare. And since I don't think it's reasonable to assume that complaints against one school during year 1 is independent from complaints against the same school in year 2, I feel like this is not the best approach.

I have experience building Poisson Time-series Regression models, but never using data for more than one "individual". Any ideas or comments would be greatly appreciated!

  • 1
    $\begingroup$ stats.stackexchange.com/questions/158740/panel-data-iv Based on my understanding of panel data, you would use a poisson regression model, but include the # of complaints in 2017 and 2018 as variables in a regression predicting complaints in 2019. If you are using multiple variables from previous years, I think it's called 'dynamic panel data/ $\endgroup$
    – Mox
    Commented Oct 31, 2020 at 20:00

1 Answer 1


What you have at hand is panel data ; fixed effect Poisson models is well understood* and can be easily applied in many statistical software.

For Stata see xtpoisson ; for R, it seems that glmer() in the lme4 package with family=Poisson do it** ; or the fixest packages***.

*: https://en.wikipedia.org/wiki/Fixed-effect_Poisson_model

**: https://www.stata.com/manuals13/xtxtpoisson.pdf

*** : https://stackoverflow.com/questions/59760317/poisson-regression-with-fixed-effects-for-panel-data

****: https://cran.r-project.org/web/packages/fixest/vignettes/fixest_walkthrough.html


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.