Negative Binomial model is crashing

Welcome to the forum for R2MLwiN users. Feel free to post your question about R2MLwiN here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Go to R2MLwiN: Running MLwiN from within R >> http://www.bris.ac.uk/cmm/software/r2mlwin/
Post Reply
dcanarteg
Posts: 14
Joined: Tue Feb 05, 2019 9:30 pm

Negative Binomial model is crashing

Post by dcanarteg »

Hi it's me again. I need to run different models for different types of outcomes of social support, and now I tried a Poisson model and it went fine, but the Neg binomial is constantly crashing.

This is the formula.
#######################################################
m8 = log(AltSupportCount) ~ 1 + TieIsFamily + TieSameSex + TieSameAge + EgoMarital + EgoSex +
EgoTMig + AltSex + AltIsRoma + AltNatRomanian + AltResidence + NetPropFemCen + NetPropFamCen +
NetPropIsRomaCen + NetPropNatRomanianCen + NetPropResidCen + EgoTMig:TieSameSex + EgoSex:AltIsRoma +
EgoTMig:AltIsRoma + (1 | EgoIdentifier)
(VarCompModel <- runMLwiN(Formula = m8, D = "Negbinom", data = RomaAllData,
estoptions = list(EstM = 1)))

This is the error on the console
"error while obeying batch file /var/folders/3n/zvw9lr5s1c1dnl0jkrc8y2xh0000gn/T//Rtmp1LfSTP/macrofile_9f41447b133.txt at line number 195:
MCMC 0 500 1 5.8 50 10 C2498] C2499] 1 1 1 1 1 8
MCMC Error 0010 : Wrong parameters for Gamma distribution generator
Execution completed"

Best,
ChrisCharlton
Posts: 1348
Joined: Mon Oct 19, 2009 10:34 am

Re: Negative Binomial model is crashing

Post by ChrisCharlton »

It's hard to know what is going wrong here without a reproducible example. My suggestion would be to check the IGLS estimates (i.e. remove EstM=1) for the model and see whether they look sensible, as these will be used as starting values for MCMC. I would also suggest checking your response variable to ensure that all values are positive.
Post Reply