Page 1 of 1

Cross-classified model with negative binomial distribution

Posted: Tue Jul 09, 2013 3:25 pm
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

Re: Cross-classified model with negative binomial distributi

Posted: Wed Jul 10, 2013 5:55 pm
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.

Re: Cross-classified model with negative binomial distributi

Posted: Tue Jul 30, 2013 2:38 pm
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

Re: Cross-classified model with negative binomial distributi

Posted: Tue Jul 30, 2013 3:01 pm
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

Re: Cross-classified model with negative binomial distributi

Posted: Wed Jul 31, 2013 9:17 am
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

Re: Cross-classified model with negative binomial distributi

Posted: Wed Jul 31, 2013 10:06 am
by GeorgeLeckie
Great, you're welcome
George