1

I am running a negative binomial regression on my dataset using the glm.nb() function. My model looks something like this:

m_nb= glm.nb(Error_Count ~ TotalWL + Auto_frac +PHONE+JUSTIF_weight + MESSAGE_OTHER_count + Hour+ I(Auto_frac^2)+I(TotalWL^2), data = df)

When I ran it with a dataset of 10,000, the model is able to run, however, when I ran it with a larger dataset (60,000), I got this error:

`Error: no valid set of coefficients has been found: please supply starting values`

I then tried to give it some start values, but still throw the same error

m_nb= glm.nb(Error_Count ~ TotalWL + Auto_frac +PHONE+JUSTIF_weight + MESSAGE_OTHER_count + Hour+ I(Auto_frac^2)+I(TotalWL^2), data = df, start = c(0.02, 0.3,0.2,3,43, 4,13,0.04, 100))

Error: cannot find valid starting values: please specify some But the model still doesn't converge. How should I set the starting value?

I also tried the same model with the fenebin() function in the fixest pacakage and the model works. However, I need the glm package, since the fixest package does not provide the standard error (S.E.) in the predict(). Thank you.

Edward
  • 10,360
  • 2
  • 11
  • 26
  • Already tried `vglm` of the the [VGAM](https://cran.r-project.org/web/packages/VGAM/index.html) package? Here an example `library(VGAM); fit <- vglm(nBnW ~age, family=negbinomial(), coalminers); predict(fit, se.fit=TRUE)`. – jay.sf Feb 08 '23 at 06:49
  • 1
    have you tried using the estimates from the reduced dataset as the start value for the full dataset? also I wonder if the squared coefficients might be an issue if they get very large so rescaling your predictors might help? – George Savva Feb 08 '23 at 06:53
  • @jay.sf thanks for the recommendation. I tried your suggestions, and it got this error: `In slot(family, "validparams")(eta, y = y, extra = extra) : parameter 'size' has very large values relative to 'mu'; try fitting a quasi-Poisson model instead (e.g., using glm())` – georgia-max Feb 08 '23 at 15:25
  • @georgia-max I did not do the recommendation, please address other commenter or try `vglm`as I suggested. – jay.sf Feb 08 '23 at 16:07
  • @jay.sf I tried the vglm of the VGAM package, and I received the error as I posted in the previous comment. – georgia-max Feb 09 '23 at 04:12
  • 1
    @georgia-max Aha sorry. You may want to make this [reproducible](https://stackoverflow.com/a/5963610/6574038). – jay.sf Feb 09 '23 at 05:04

0 Answers0