0

I am dealing with some collinearity issues with a fixed effect negative binomial model. I am currently working with fixest package in R.

In few words, many of my regressors are collinear with the county and time fixed effects

I want to predict a model with homicide as the outcome variable. I have a panel dataset of n=2500 counties measured across 14 years. I am also incorporating county and year fixed effects.

Below is the code I am working with:

f2 <- fenegbin(homicide ~ treatmentdummy +
 log(gdppc) +
 gasprice +
 offset(log(pobconapo))
| id + year,
               se= "standard",
            panel.id = ~id+year,
            data=panel)

I am experiencing two type of collinearity problems. First, variable gasprice is collinear with fixed effect year. In my dataset, gasprice is the national average price of gas during that year. Gasprice is thus equal to every county in the year, At the same time, gdppc is collinear with fixed effect county. I understand the reason that these variables are collinear. My question is, what am I doing wrong. I've seen dozens of panel set regressions with time invariant variables. Is there any way to deal with this issue?

kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
stat199
  • 1
  • 1
  • Welcome. Why do you think you’re doing something wrong? – Thomas Bilach Dec 17 '21 at 04:12
  • Random-effects type approaches (my answer here outlines what I interpret as such an approach, the terminology is somewhat crowded: https://stats.stackexchange.com/questions/4700/what-is-the-difference-between-fixed-effect-random-effect-and-mixed-effect-mode/188559#188559) can handle time-invariant variables. Not sure about specifics for the negative binomial though – Christoph Hanck Dec 17 '21 at 09:07

0 Answers0