Page 1 of 1

The model did not run properly in MLwiN. Re-run the model without the nopause option to debug the model in MLwiN.

Posted: Sun May 14, 2023 3:58 pm
by alirizvi29
Hi,

I am trying to run a four-level model in Stata using "runmlwin' command. Here is the Stata syntax:

use "D:\refuseData.dta", replace
drop if refuse==. | caste==. | religion==. | v190==. | urban==. | age==. | schooling==. | working==. | media==. | parity==. | living_son==.
sort v024 v001 intrid womenid
global MLwiN_path "C:\Program Files (x86)\MLwiN trial\i386\mlwin.exe"

*Fit a Four-level variance components logit model by PQL2
quietly runmlwin refuse cons i.caste i.religion i.v190 urban age i.schooling working media parity living_son, level4(v024: cons) level3(v001: cons) level2(intrid: cons) level1(womenid:) discrete(distribution(binomial) link(logit) denom(cons) pql2) nopause mlwinsettings(optimat) noversioncheck

* Fit the previous model by MCMC using the PQL2 estimates from the previous model as starting values for MCMC estimation.
runmlwin refuse cons i.caste i.religion i.v190 urban age i.schooling working media parity living_son, level4(v024: cons) level3(v001: cons) level2(intrid: cons) level1(womenid:) discrete(distribution(binomial) link(logit) denom(cons)) mcmc(cc burnin(5000) chain(5000)) initsprevious mlwinsettings(optimat) nopause noversioncheck


I am getting the following response to the model:
The model did not run properly in MLwiN. Re-run the model without the nopause option to debug the model in MLwiN.

But if I remove the 'nopause' option then I don't get results in Stata. Can you please help me out in the matter?
Thank you in advance.

Re: The model did not run properly in MLwiN. Re-run the model without the nopause option to debug the model in MLwiN.

Posted: Fri May 26, 2023 9:33 am
by ChrisCharlton
Is it the first or second of your two model fits that triggers the error? If it is the first have you checked whether switching from pql2 to mql1 allows it to fit?

Re: The model did not run properly in MLwiN. Re-run the model without the nopause option to debug the model in MLwiN.

Posted: Thu Jun 01, 2023 7:27 am
by alirizvi29
Thank you for your response!

Earlier, I tried to switch from pql2 to mql2 estimation, but the problem persisted. However, It is solved after removing some units at v001 at a level with no variation, which means a unit had all responses either 1 or 0. Because of this, it couldn't converge.

Re: The model did not run properly in MLwiN. Re-run the model without the nopause option to debug the model in MLwiN.

Posted: Thu Jun 01, 2023 7:37 am
by alirizvi29
Now I am trying to get some graphical representation of the results as the tables are too large, and I have many other outcome variables. Here is the code for the model again.

*Fit a Four-level variance components logit model by PQL2
quietly runmlwin faith_b cons i.caste i.religion i.v190 urban age i.schooling working media parity living_son, level4(v024: cons) level3(v001: cons) level2(intrid: cons) level1(womenid:) discrete(distribution(binomial) link(logit) denom(cons) pql2) nopause mlwinsettings(optimat) noversioncheck

* Fit the previous model by MCMC using the PQL2 estimates from the previous model as starting values for MCMC estimation.
runmlwin faith_b cons i.religion i.v190 urban age i.schooling working media parity living_son, level4(v024: cons) level3(v001: cons) level2(intrid: cons) level1(womenid:) discrete(distribution(binomial) link(logit) denom(cons)) mcmc(cc burnin(5000) chain(5000)) initsprevious mlwinsettings(optimat) nopause noversioncheck


Can you please guide me on getting some graphs to visualize these results in Stata?
Thank you in Advance!