The data I am working with can be modelled using a negative binomial regression model. My response variable is discrete count values (including zero). All my predictor variables are categorical data. I am now at the stage where I am looking at model diagnostics. When I look at the fitted values obtained using
final.model is obtained using
glm.nb, I get
NA values for fits when the corresponding observation in the data is zero. Is this what I should be getting? Is there an argument that I can specify to also account for the zero counts?
The model is given as:
final.model <- glm.nb(y ~ X1 + X2 + X3 + X4 + X5 + X6, na.action = na.omit, data = dataset) fits <- final.model$fitted.values
y takes interger values from
X1, X2, X3, X4, and X5 are all categorical variables each with two factor levels, except
X3 which has three factor levels.
X6 is a discrete variable that takes values from
When I look at the fitted values corresponding to the observation when, e.g.
y=0, I get