Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Zero-inflated negative binomial models taking forever

    Dear Stata users,

    Help would be much appreciate if you could help with figuring out what's wrong with my ZINB models.
    Here's the syntax I'm using:

    zinb DV controls (16 of them) c.IV1##c.IV2, inflate(inflation variable) vuong

    Here, IV1 is a categorical variable, and I have 3 versions of it. In version 1, it's a 2-group variable (IV=0, 1); in version 2, it's a 3-group variable (IV=0, 1, 2); in version 3, it's a 9-group variable (IV=0, ..., 8).
    The models when using the 2-group variable run fine.
    However, when using the 3-group and 9-group variables, the models take forever to run--they don't even start the convergence process.

    I do have a lot of observations (~650K), but I doubt this is causing the problem.
    I also tried running loops using the -if- command, instead of using the categorical variables, but the problem stays.

    What could be the possible causes for these long running times? Please let me know if you need further information to make any suggestions or guesses.

    Many thanks,
    Daniel

  • #2
    Daniel:
    it may be that with 9 categories your data become too sparse, causing the model to fail to converge.
    Keeping things simpler may be the fix.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Welcome to Statalist.

      zinb DV controls (16 of them) c.IV1##c.IV2, inflate(inflation variable) vuong

      Here, IV1 is a categorical variable ...
      IV1 is a categorical variable, but you are telling zinb to treat it as a continuous variable by using the syntax c.IV1 instead of i.IV1. The same is true if IV2 is also a categorical variable.

      Comment

      Working...
      X