Cross-classified model with negative binomial distribution

Welcome to the forum for runmlwin users. Feel free to post your question about runmlwin 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 runmlwin: Running MLwiN from within Stata >> http://www.bristol.ac.uk/cmm/software/runmlwin/
Post Reply
VBMHealthEcon
Posts: 7
Joined: Tue Jul 09, 2013 3:09 pm

Cross-classified model with negative binomial distribution

Post by VBMHealthEcon »

Hello,

I'm relatively new to MLwiN and I'm using it through the runmlwin command in Stata

I'm trying to estimate a cross-classified random intercepts model with a negative binomial distribution using MCMC. However, I received an error message saying that "The selected distribution is not available for MCMC". In which case, what is the best way for me to proceed in estimating my model? I have a relatively large dataset with 127,700 level 1 observations so I fear IGLS may not be appropriate. Appreciate your advice.

Thanks, Valerie
ChrisCharlton
Posts: 1384
Joined: Mon Oct 19, 2009 10:34 am

Re: Cross-classified model with negative binomial distributi

Post by ChrisCharlton »

Unfortunately as you have seen MLwiN cannot currently fit negative binomial models using MCMC. As an alternative method for introducing over-dispersion you can however add a pseudo level with the identifier set to your level-1 identifier and then add a random effect at this level. As you are using a cross-classified model you will need to ensure that the unit IDs have unique codes.
VBMHealthEcon
Posts: 7
Joined: Tue Jul 09, 2013 3:09 pm

Re: Cross-classified model with negative binomial distributi

Post by VBMHealthEcon »

Dear Chris,

Thanks very much for your help. I couldn't add a random effect to the level 1 identifier (perhaps I was doing something wrong) but alternatively I tried the poisson distribution with the extra option and this gives similar results to the negbin so I'm happy with that.

Best,
Valerie
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: Cross-classified model with negative binomial distributi

Post by GeorgeLeckie »

Hi Valerie,

Glad you found a solution which works for you. Nonetheless, this is how you add the psuedo-level...

The data are county-level counts. There are 354 counties. There is one observation (row of data) per county

Single-level Poisson

Code: Select all

. runmlwin obs cons uvbi, level1(county) discrete(distribution(poisson) offset(lne
> xpected)) rigls nopause
 
MLwiN 2.28 multilevel model                     Number of obs      =       354
Poisson response model
Estimation algorithm: RIGLS, MQL1

Run time (seconds)   =       1.28
Number of iterations =          4
------------------------------------------------------------------------------
         obs |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        cons |  -.0701054   .0110454    -6.35   0.000     -.091754   -.0484569
        uvbi |  -.0571914   .0026768   -21.37   0.000    -.0624378   -.0519449
------------------------------------------------------------------------------

Overdispersed Poisson


Here we add a county-level random effect.

Code: Select all

. runmlwin obs cons uvbi, level2(county: cons) level1(county) discrete(distributio
> n(poisson) offset(lnexpected)) rigls nopause
 
MLwiN 2.28 multilevel model                     Number of obs      =       354
Poisson response model
Estimation algorithm: RIGLS, MQL1

-----------------------------------------------------------
                |   No. of       Observations per Group
 Level Variable |   Groups    Minimum    Average    Maximum
----------------+------------------------------------------
         county |      354          1        1.0          1
-----------------------------------------------------------

Run time (seconds)   =       1.58
Number of iterations =          5
------------------------------------------------------------------------------
         obs |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        cons |   -.091411   .0248586    -3.68   0.000    -.1401329    -.042689
        uvbi |  -.0479693   .0053335    -8.99   0.000    -.0584227   -.0375159
------------------------------------------------------------------------------

------------------------------------------------------------------------------
   Random-effects Parameters |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
Level 2: county              |
                   var(cons) |   .1468484   .0157706      .1159385    .1777583
------------------------------------------------------------------------------

I hope that helps

George
VBMHealthEcon
Posts: 7
Joined: Tue Jul 09, 2013 3:09 pm

Re: Cross-classified model with negative binomial distributi

Post by VBMHealthEcon »

Dear George,

Many thanks for your prompt reply and example of how to add a pseudo level - I understand now what I was doing wrong.

Best,
Valerie
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: Cross-classified model with negative binomial distributi

Post by GeorgeLeckie »

Great, you're welcome
George
Post Reply