Modelling Chidren Ever Born

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
rahulvbb
Posts: 9
Joined: Thu Feb 19, 2015 1:01 pm

Modelling Chidren Ever Born

Post by rahulvbb »

Dear All,
I am examining community level correlates of Children Ever Born using Indian DHS data. I am using multilevel (2 level) Poisson regression with community at level 2 (PSU) and women at level 1.
My problem is that the community level variance is coming to be very low (around 0.0007). When, I rerun the model model treating CEB as metric variable (two level linear regression), the variance is again too low at both women and community level ( 0.007 and 0.05). Also, the coefficient against constant (intercept) is 0.3 only.
I suspect that I am making mistake somewhere; But have not been able to detect it.
Please help me in this. I am pasting the results below.
Attachments
Normal response model
Normal response model
image (1).png (14.49 KiB) Viewed 11034 times
Poisson model
Poisson model
image.png (12.09 KiB) Viewed 11034 times
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: Modelling Chidren Ever Born

Post by GeorgeLeckie »

Dear rahulvbb,

The output all looks normal enough, although you did not paste the runmlwin commands so I cannot comment on that.

You certainly did the right thing by temporarily simplifying the model to a two-level linear regression model in order to try to work out what is going on.

I am presuming that your ceb variable is a count of the number births per adult woman and that you expect to see more than 0.3 births per mother?

I suspect the problem more likely lies with the data than your specification of the runmlwin command. I suggest you therefore first fit a single-level model with the Stata's regress command. Only once you are happy with the intercept and residual variance in that model, revert back to trying to fit a two-level model to decompose that residual variance into within- and between-community variance components.

Sorry not to be of more help, but there is nothing obviously wrong with your runmlwin output

Best wishes

George
rahulvbb
Posts: 9
Joined: Thu Feb 19, 2015 1:01 pm

Re: Modelling Chidren Ever Born

Post by rahulvbb »

Dear Sir,
Yes, the ceb variable is count of the number births per adult woman. I am pasting the runmlwin syntax below:
#delimit ;
runmlwin ceb cons ,
level2(psuid:cons ) level1(id:)
discrete(distribution(poisson) link(log) mql1)
mlwinsettings(size(536000) levels(5) columns(1500) variables(300) optimat) nopaus;
#delimit cr


As per your suggestion, I estimated the null models for single level linear regression as well as the poisson regression. I am pasting results from these as follows. From these regressions, the intercept seems ok. But when, I run the two level model, the problem is same again. I am not able to understand the difference. I can send you the data if you would like to have a look.

Thanks and regards
Attachments
single level regression
single level regression
ceb.jpg (55.83 KiB) Viewed 11016 times
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: Modelling Chidren Ever Born

Post by GeorgeLeckie »

Dear rahulvbb,

Forget the Poisson regression for now. My immediate concern is why you estimate such a different intercept in the two-level linear regression (0.322944) from the intercept in the single-level linear regression (2.951333). You would expect to see some difference, but this different seems rather extreme.

Please run the following commands, and paste the output from the Stata results window

Best wishes

George

Code: Select all

. regress ceb
. xtset psuid
. xtreg ceb, mle
. runmlwin ceb cons, level2(psuid: cons) level1(id: cons) nopause
rahulvbb
Posts: 9
Joined: Thu Feb 19, 2015 1:01 pm

Re: Modelling Chidren Ever Born

Post by rahulvbb »

Dear Sir,
Thank you very much for you response. As, suggested I ran the codes you sent.
From the results, The intercept and variance estimated from stata's random effects command (xtreg) seem to be ok. But the runmlwin's estimates are still same. There is huge difference in the psu level variance estimates as well. I am pasting the results below. Please have a look.
Attachments
Runmlwin random effects
Runmlwin random effects
CEB1.png (9.78 KiB) Viewed 11003 times
stata random effects
stata random effects
ceb.jpg (86.66 KiB) Viewed 11003 times
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: Modelling Chidren Ever Born

Post by GeorgeLeckie »

Dear rahulvbb,

Very odd. Please email me

(1) do-file
(2) dataset

so that I can take a look

Best wishes

George
rahulvbb
Posts: 9
Joined: Thu Feb 19, 2015 1:01 pm

Re: Modelling Chidren Ever Born

Post by rahulvbb »

Dear Sir,
I have mailed you the data set and codes.
Regards
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: Modelling Chidren Ever Born

Post by GeorgeLeckie »

Dear rahulvbb,

The problem is simply that the variable associated with the intercept in your runmlwin model (cons) takes the value for 9 for all observations when it should take the value 1. When you replace the variable cons with the value 1, the runmlwin results coincide with the xtreg results.

I hope that helps

Best wishes

George

Code: Select all

. * Model 1
. xtset psuidx
       panel variable:  psuidx (unbalanced)

. xtreg birth_5, mle
Iteration 0:   log likelihood = -206164.57
Iteration 1:   log likelihood =  -206164.5

Random-effects ML regression                    Number of obs      =    164732
Group variable: psuidx                          Number of groups   =      8814

Random effects u_i ~ Gaussian                   Obs per group: min =        10
                                                               avg =      18.7
                                                               max =        94

                                                Wald chi2(0)       =      0.00
Log likelihood  =  -206164.5                    Prob > chi2        =         .

------------------------------------------------------------------------------
     birth_5 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       _cons |   .8710794   .0032569   267.46   0.000     .8646961    .8774627
-------------+----------------------------------------------------------------
    /sigma_u |   .2329677   .0030127                      .2271372    .2389479
    /sigma_e |   .8259677   .0014785                      .8230751    .8288705
         rho |    .073692   .0018055                      .0702179     .077296
------------------------------------------------------------------------------
Likelihood-ratio test of sigma_u=0: chibar2(01)= 4749.20 Prob>=chibar2 = 0.000

. 
. * Model 2
. runmlwin birth_5 cons, ///
>   level2(psuidx: cons) ///
>   level1(id: cons) ///
>   nopause
 
MLwiN 2.32 multilevel model                     Number of obs      =    164732
Normal response model
Estimation algorithm: IGLS

-----------------------------------------------------------
                |   No. of       Observations per Group
 Level Variable |   Groups    Minimum    Average    Maximum
----------------+------------------------------------------
         psuidx |     8814         10       18.7         94
-----------------------------------------------------------

Run time (seconds)   =       5.76
Number of iterations =          2
Log likelihood       =  -206164.5
Deviance             =     412329
------------------------------------------------------------------------------
     birth_5 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        cons |   .0967866   .0003619   267.46   0.000     .0960774    .0974959
------------------------------------------------------------------------------

------------------------------------------------------------------------------
   Random-effects Parameters |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
Level 2: psuidx              |
                   var(cons) |     .00067   .0000172      .0006363    .0007038
-----------------------------+------------------------------------------------
Level 1: id                  |
                   var(cons) |   .0084225   .0000302      .0083634    .0084816
------------------------------------------------------------------------------

. // Model 2 results should match Model 1 results, but they don't as expected
. 
. * Summarize the variable cons
. summarize cons

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
        cons |    164732           9           0          9          9

. // Note that the variable takes the value 9 when it should take the value 1
. 
. * Make cons equal to 1
. replace cons = 1
(164732 real changes made)

. 
. * Model 3
. runmlwin birth_5 cons, ///
>   level2(psuidx: cons) ///
>   level1(id: cons) ///
>   nopause
 
MLwiN 2.32 multilevel model                     Number of obs      =    164732
Normal response model
Estimation algorithm: IGLS

-----------------------------------------------------------
                |   No. of       Observations per Group
 Level Variable |   Groups    Minimum    Average    Maximum
----------------+------------------------------------------
         psuidx |     8814         10       18.7         94
-----------------------------------------------------------

Run time (seconds)   =       6.17
Number of iterations =          2
Log likelihood       =  -206164.5
Deviance             =     412329
------------------------------------------------------------------------------
     birth_5 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        cons |   .8710794   .0032568   267.46   0.000     .8646962    .8774627
------------------------------------------------------------------------------

------------------------------------------------------------------------------
   Random-effects Parameters |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
Level 2: psuidx              |
                   var(cons) |   .0542722   .0013939      .0515403    .0570041
-----------------------------+------------------------------------------------
Level 1: id                  |
                   var(cons) |   .6822233   .0024435      .6774342    .6870125
------------------------------------------------------------------------------

. // Model 3 results now match Model 1 as expected
rahulvbb
Posts: 9
Joined: Thu Feb 19, 2015 1:01 pm

Re: Modelling Chidren Ever Born

Post by rahulvbb »

Thank you very much sir.
Post Reply