I am trying to run a fixed-effects Poisson Quasi Maximum Likelihood estimator on 3-dimensional(year, country, industry) Panel data.
The dependent variable is the number of patents(non-negative and non-integer) and the main independent variable is the deregulation(a dummy variable which equals 0 before the year deregulation was implemented in a country and 1 starting from the implementation year). I also have some independent variables as controls(size and share) and want to control for the year, country, and industry fixed effects.
I tried several packages and functions on R and mostly ended up on glm
and feglm
, which I expected to give the same results, but they are different.
model1 <- glm(pt ~ dereg + size + share +
factor(year) + factor(country) + factor(industry),
data=pdata, family=quasipoisson)
library(fixest)
model2 <- feglm(pt ~ dereg + size + share|year+country+industry, data=pdata,
cluster=c("country","industry", "year"),
family=quasipoisson)
What is the difference between the two methods?
Which one is more reliable in this case, or is there a more suitable package that will allow to include all fixed effects and run quasi-Poisson estimator on the panel data?