Hi there,
Im a new user of runmlwin through STATA and I am following the runmlwin manual. I'm using MLwin version 2.30 and STATA version 13.1
I have the following problem:
In STATA, adding an i. in front of the variable name (e.g. i.percrimecat) tells the program to treat the variable as categorical. Otherwise is treated as continuous.
However, MLwin keeps crushing on binomial logistic regression models if I use i.percrimecat instead of percrimecat in the code lines below
quietly runmlwin aawlktotguide cons percrimecat, level2(cd2006:cons) level1(id:) discrete(distribution(binomial) link(logit) denominator(cons) pql2) nopause
runmlwin aawlktotguide cons percrimecat, level2(cd2006:cons) level1(id:) discrete(distribution(binomial) link(logit) denominator(cons)) mcmc(on) initsprevious nopause nogroup
My colleague is running a linear regresion model in runmlwing and does not seem to have this problem for continuous outcome analyses.
The Mlwin manual tells users to generate dummy variables for each category within a variable of interest instead and uses these to run the model in MLwin. I tried doing this too as shown below, but MLwin keeps crushing.
gen percrimeLow = (percrimecat==1)
gen percrimeMedium = (percrimecat==2)
gen percrimeHigh = (percrimecat==3)
quietly runmlwin aawlktotguide cons percrimeLow percrimeMedium percrimeHigh, level2(cd2006:cons) level1(id:) discrete(distribution(binomial) link(logit) denominator(cons) pql2) nopause
runmlwin aawlktotguide cons percrimeLow percrimeMedium percrimeHigh, level2(cd2006:cons) level1(id:) discrete(distribution(binomial) link(logit) denominator(cons)) mcmc(on) initsprevious nopause nogroup
I would be most grateful if you could please suggest a solution.
Cheers,
Fatima.
Problem runmlwing for binomial logistic regressions
-
- Posts: 6
- Joined: Wed Oct 15, 2014 7:07 am
-
- Posts: 1384
- Joined: Mon Oct 19, 2009 10:34 am
Re: Problem runmlwing for binomial logistic regressions
Would you be able to post any error messages that you are getting as this might help diagnose the cause of the problem? Normally if you are putting dummy variables into the model you would omit one of them as a base category. It's hard to see from what you have provided whether you have done this in your case, but if not I would suggest trying that.
-
- Posts: 6
- Joined: Wed Oct 15, 2014 7:07 am
Re: Problem runmlwing for binomial logistic regressions
Hi Chris,
Thanks for your advice. I deleted the reference dummy variable (percrimeLow), rerun the model as the runmlwin manual suggests and it produced an output.
tab percrimecat, m
gen percrimeMedium = (percrimecat==2)
tab percrimeMedium
gen percrimeHigh = (percrimecat==3)
tab percrimeHigh
quietly runmlwin aawlktotguide cons percrimeMedium percrimeHigh, level2(cd2006:cons) level1(id:) discrete(distribution(binomial) link(logit) denominator(cons) pql2) nopause
runmlwin aawlktotguide cons percrimeMedium percrimeHigh, level2(cd2006:cons) level1(id:) discrete(distribution(binomial) link(logit) denominator(cons)) mcmc(on) initsprevious nopause nogroup
I was wordering why runmlwin cannot cope with the i.percrimecat instead of creating dummy variables for the predictors for binomial regression, as it seems to work for linear regression.
Cheers,
Fatima
Thanks for your advice. I deleted the reference dummy variable (percrimeLow), rerun the model as the runmlwin manual suggests and it produced an output.
tab percrimecat, m
gen percrimeMedium = (percrimecat==2)
tab percrimeMedium
gen percrimeHigh = (percrimecat==3)
tab percrimeHigh
quietly runmlwin aawlktotguide cons percrimeMedium percrimeHigh, level2(cd2006:cons) level1(id:) discrete(distribution(binomial) link(logit) denominator(cons) pql2) nopause
runmlwin aawlktotguide cons percrimeMedium percrimeHigh, level2(cd2006:cons) level1(id:) discrete(distribution(binomial) link(logit) denominator(cons)) mcmc(on) initsprevious nopause nogroup
I was wordering why runmlwin cannot cope with the i.percrimecat instead of creating dummy variables for the predictors for binomial regression, as it seems to work for linear regression.
Cheers,
Fatima
-
- Posts: 1384
- Joined: Mon Oct 19, 2009 10:34 am
Re: Problem runmlwing for binomial logistic regressions
We have made some changes regarding the i. syntax in the development version of -runmlwin- (which you can download from http://www.cmm.bristol.ac.uk/forum/view ... t=10#p2633, so I would suggest trying this version to see if it behaves better.
Alternatively you might want to try using the -xi- prefix (see http://www.stata.com/help.cgi?xi) as an alternative way to specify your categorical/interaction variables.
Alternatively you might want to try using the -xi- prefix (see http://www.stata.com/help.cgi?xi) as an alternative way to specify your categorical/interaction variables.