Error in random slope model

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
mario123
Posts: 4
Joined: Thu Jul 17, 2014 8:46 am

Error in random slope model

Post by mario123 »

Hi ,
I am trying to run two level random intercept and and random slope model using runmlwin program.Random intercept model for the problem easily converged to the solution. While I am having some problem with running random slope model.
Syntax for random slope model is given below.

runmlwin contra_use cons urban boy i. moth_edu, level2(psu_idm: cons urban,residual(u6)) level1(indi_idm:) discrete(distribution(binomial) link(logit)denominator(cons) pql2)maxiterations(500)
Attachments
Errors while running the random slope model when iurban made random at level 2
Errors while running the random slope model when iurban made random at level 2
error 2.jpg (176.95 KiB) Viewed 6172 times
Errors while running the random slope model when iurban made random at level 2
Errors while running the random slope model when iurban made random at level 2
error1.jpg (193.93 KiB) Viewed 6172 times
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: Error in random slope model

Post by GeorgeLeckie »

Hi Mario,

Currently you are trying to estimate your final model directly...

Code: Select all

. runmlwin contra_use cons urban boy i. moth_edu, ///
    level2(psu_idm: cons urban, residual(u6)) ///
    level1(indi_idm:) ///
    discrete(distribution(binomial) link(logit)denominator(cons) pql2) ///
    maxiterations(500)
... but you run into convergence problems. I would therefore try to build up to the final model gradually using the parameter estimates from simpler models as starting values for more complex models...

MODEL 1
Fit random-intercept version of the model by MQL1

Code: Select all

. runmlwin contra_use cons urban boy i. moth_edu, ///
    level2(psu_idm: cons) ///
    level1(indi_idm:) ///
    discrete(distribution(binomial) link(logit) denominator(cons) mql1)
. estimates store m1
MODEL 2
Fit the random-slope version of the model by MQL1 using the random-intercept model estimates (i.e., MODEL 1) as starting values

Code: Select all

. runmlwin contra_use cons urban boy i. moth_edu, ///
    level2(psu_idm: cons) ///
    level1(indi_idm:) ///
    discrete(distribution(binomial) link(logit) denominator(cons) mql1) ///
    initsmodel(m1)
. estimates store m2
MODEL 3
Fit random-slope model by PQL2 using the random-slope MQL1 model estimates (i.e., MODEL 2) as starting values

Code: Select all

. runmlwin contra_use cons urban boy i. moth_edu, ///
    level2(psu_idm: cons) ///
    level1(indi_idm:) ///
    discrete(distribution(binomial) link(logit) denominator(cons) pql2) ///
    initsmodel(m2)
. estimates store m3
Best wishes

George
mario123
Posts: 4
Joined: Thu Jul 17, 2014 8:46 am

Re: Error in random slope model

Post by mario123 »

hello George,
Thanks for the response. I would like to know what should be the maximum number of variable is acceptable for converging the model in both MCMC and IGLS .In my case my runmlwin command hangs when i am using (i.variable e.g i. caste) or the number of variable is large(Specially in MCMC).Should i avoid (i.variable) and enter the dummy of the categories of the variable.I hope i am making sense.
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: Error in random slope model

Post by GeorgeLeckie »

Hi,

In terms of fixed-part of the model, you should be able to make this as simple or complex as you would a linear regression model

In terms of random-part of the model at level-2, most authors tend to limit the number of random slopes to a maximum of, say, two or three

Above comments apply to both IGLS and MCMC

Best wishes

George
Post Reply