Error when running MLwiN MCMC Manual examples

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
FloHarrison
Posts: 5
Joined: Thu Jan 24, 2013 4:19 pm

Error when running MLwiN MCMC Manual examples

Post by FloHarrison »

Hi,

I'm trying to work out how to run multiple membership models through runmlwin, so am working through the examples in chapter 16 of the MLwiN MCMC Manual. Whenever I try and run something with the MCMC option on I get this error:

invalid expression
r(3000);

so

Code: Select all

runmlwin logearn cons age_40 numjobs, level2(company:) level1(id: cons) nopause
runs fine, but:

Code: Select all

runmlwin logearn cons age_40 numjobs, level2(company:) level1(id: cons) mcmc(on) initsprevious nopause
then generates the error.

Does anyone know why I'm getting this error, and what I can do about it? I'm using MLwiN2.26 and Stata/IC 11.0 for windows

Flo
ChrisCharlton
Posts: 1353
Joined: Mon Oct 19, 2009 10:34 am

Re: Error when running MLwiN MCMC Manual examples

Post by ChrisCharlton »

Could you please firstly check that your version of runmlwin is up to date? If it is then could you type the following Stata command before running the model:

Code: Select all

set trace on
and then us know what the output is prior to the error message?
ChrisCharlton
Posts: 1353
Joined: Mon Oct 19, 2009 10:34 am

Re: Error when running MLwiN MCMC Manual examples

Post by ChrisCharlton »

I've just remembered that I have come across this error before. Currently in runmlwin we have some version checking code which isn't correctly matched up (in one place it checks for 11.0 and another 11.1). You should be able to work around this by either updating your version of Stata to at least 11.1 (which you can do with the Help->Check for updates menu in Stata), or by editing the following lines in runmlwin.ado:

Code: Select all

if _caller() >= 11 {

to:

if _caller() >= 11.1 {

in the program define runmlwin_savechains section of runmlwin.ado.
This will be fixed in the next release of runmlwin.
FloHarrison
Posts: 5
Joined: Thu Jan 24, 2013 4:19 pm

Re: Error when running MLwiN MCMC Manual examples

Post by FloHarrison »

Hi Chris,

Thanks for your help - I went with the second option and it's all running fine now.

Flo
Post Reply