Page 1 of 1

MLwiN does not respond with Stata 14

Posted: Fri Jan 06, 2017 4:40 pm
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

Re: MLwiN does not respond with Stata 14

Posted: Fri Jan 06, 2017 4:49 pm
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.

Re: MLwiN does not respond with Stata 14

Posted: Mon Jan 09, 2017 10:29 am
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?

Re: MLwiN does not respond with Stata 14

Posted: Mon Jan 09, 2017 11:36 am
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?

Re: MLwiN does not respond with Stata 14

Posted: Mon Jan 09, 2017 12:34 pm
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!

Re: MLwiN does not respond with Stata 14

Posted: Mon Jan 09, 2017 12:45 pm
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.

Re: MLwiN does not respond with Stata 14

Posted: Mon Jan 09, 2017 12:55 pm
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.

Re: MLwiN does not respond with Stata 14

Posted: Mon Jan 09, 2017 1:03 pm
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

Re: MLwiN does not respond with Stata 14

Posted: Mon Jan 09, 2017 1:12 pm
by davidekstam
That did solve the issue! Awesome, thank you!

Kind regards,

David