MLwiN does not respond with Stata 14

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
davidekstam
Posts: 7
Joined: Fri Jan 06, 2017 4:20 pm

MLwiN does not respond with Stata 14

Post by davidekstam »

Hi forum! I recently picked up the 30 days trial version of MLwiN for my dissertation project and I consider purchasing the full license. However, so far I have not been able to make MLwiN to run with Stata 14. I have followed the tutorial (http://www.stata.com/meeting/uk11/abstr ... leckie.pdf) and used the tutorial data set and successfully created a global mlwin_path.

When I, in Stata, execute:

. runmlwin normexam cons, level2(school: cons) level1(student: cons)

MLwiN does not open and Stata gives me the error "The model did not run properly in MLwiN. You most likely clicked the 'Abort Macro' button in MLwiN, rather than the 'Resume Macro' button." The same result occurs if MLwiN already is running when I execute the command in Stata.

What do I do wrong?

Kind regards,

David
ChrisCharlton
Posts: 1354
Joined: Mon Oct 19, 2009 10:34 am

Re: MLwiN does not respond with Stata 14

Post by ChrisCharlton »

Could you try running the following command to check that the MLwiN_path global has been set correctly:

Code: Select all

shell $MLwiN_path
When you run this MLwiN should start, if not then it would be worth checking that the value you set the global to refers to the location of MLwiN on your machine, as it is likely to be different to the one in the tutorial you refer to.
davidekstam
Posts: 7
Joined: Fri Jan 06, 2017 4:20 pm

Re: MLwiN does not respond with Stata 14

Post by davidekstam »

Thanks for the reply Chris! If I run shell $MLwiN_path MlwiN responds, so I guess the problem isn't related to the global... :( Just to clarify, is it correct that I do not have to do anything in MlwiN prior to the runmlwin command in Stata?
ChrisCharlton
Posts: 1354
Joined: Mon Oct 19, 2009 10:34 am

Re: MLwiN does not respond with Stata 14

Post by ChrisCharlton »

Yes, that is correct, it should just be a matter of telling -runmlwin- where MLwiN has been installed. It's possible that because MLwiN has been wrapped up to make it a trial version that the command line options are not being passed on correctly, however if that was the case I would have expected that at least the application would have started up. Could you try running the Stata command:

Code: Select all

set trace on
and posting the output from Stata, in particular from just before the error message is displayed?
davidekstam
Posts: 7
Joined: Fri Jan 06, 2017 4:20 pm

Re: MLwiN does not respond with Stata 14

Post by davidekstam »

------------------------------------------------------------------------------------------------------------------------ end runmlwin_qshell ---
- else {
quietly runmlwin_qshell "`mlwinpath'" /nogui /run `filemacro3'
display as text " --- Begin MLwiN error log --- "
type `errlog'
display as text " --- End MLwiN error log --- " _n
}
- }
- if "`fit'" == "nofit" {
= if "" == "nofit" {
di as txt "The savewinbugs nofit option caused runmlwin to end prematurely."
ereturn scalar mcmcnofit = 1
exit
}
- capture use "`fileresults'", clear
= capture use "C:\Users\davek724\AppData\Local\Temp\ST_01000005.tmp", clear
- if _rc {
- if ("`pause'"=="") display as error "The model did not run properly in MLwiN. You most likely clicked the 'Abort Macro' button in MLwiN, rather
> than the 'Resume Macro' button." _n
= if (""=="") display as error "The model did not run properly in MLwiN. You most likely clicked the 'Abort Macro' button in MLwiN, rather than th
> e 'Resume Macro' button." _n
The model did not run properly in MLwiN. You most likely clicked the 'Abort Macro' button in MLwiN, rather than the 'Resume Macro' button.

- if ("`pause'"=="nopause") display as error "The model did not run properly in MLwiN. Re-run the model without the nopause option to debug the mo
> del in MLwiN." _n
= if (""=="nopause") display as error "The model did not run properly in MLwiN. Re-run the model without the nopause option to debug the model in
> MLwiN." _n
- exit 198
}
----------------------------------------------------------------------------------------------------------------------- end runmlwin.Estimates ---


Let me know if you need more of the Stata output. Thank you once more!
ChrisCharlton
Posts: 1354
Joined: Mon Oct 19, 2009 10:34 am

Re: MLwiN does not respond with Stata 14

Post by ChrisCharlton »

Could you try the following command:

Code: Select all

runmlwin_qshell $MLwiN_path
and report any messages as this may help determine whether the problem is with our shell plugin? This should, like the -shell- command before, start up MLwiN.
davidekstam
Posts: 7
Joined: Fri Jan 06, 2017 4:20 pm

Re: MLwiN does not respond with Stata 14

Post by davidekstam »

. runmlwin_qshell $MLwiN_path
-------------------------------------------------------------------------------------------------------------------------- begin runmlwin_qshell ---
- version 9.0
- syntax [anything(equalok everything)] [, *]
- if `"`anything'"' == "" {
= if `"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Centre for MultiLevel Modelling\MLwiN 2.36 (32-bit).lnk"' == "" {
capture plugin call runmlwin_quietshell, `"cmd"'
if c(rc) == 199 {
shell `cmd'
}
}
- else {
- capture plugin call runmlwin_quietshell, `"`anything'"'
= capture plugin call runmlwin_quietshell, `"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Centre for MultiLevel Modelling\MLwiN 2.36 (32-bit
> ).lnk"'
- if c(rc) == 199 {
shell `anything'
}
- }
---------------------------------------------------------------------------------------------------------------------------- end runmlwin_qshell -

This did not start up MLwiN, however.
ChrisCharlton
Posts: 1354
Joined: Mon Oct 19, 2009 10:34 am

Re: MLwiN does not respond with Stata 14

Post by ChrisCharlton »

Could you try changing your global from the shortcut location:

Code: Select all

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Centre for MultiLevel Modelling\MLwiN 2.36 (32-bit).lnk
to the location of the executable, which will be something like:

Code: Select all

C:\Program Files (x86)\MLwiN trial\i386\mlwin.exe
davidekstam
Posts: 7
Joined: Fri Jan 06, 2017 4:20 pm

Re: MLwiN does not respond with Stata 14

Post by davidekstam »

That did solve the issue! Awesome, thank you!

Kind regards,

David
Post Reply