option level2() not allowed error

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
MeenaParam
Posts: 4
Joined: Tue Mar 06, 2012 2:06 pm

option level2() not allowed error

Post by MeenaParam »

Dear runmlwin users,

I am having what I think is a very simple problem to solve, but I have been stuck on this for the last few days so I am asking for help.

I can run this random intercept model ok and get output to stata:

runmlwin ols_imprel constant (female age mardum2 mardum3 mardum4 incomedum2 ///
incomedum3 incomedum4 incomedum5 incomedum6 incomedum7 incomedum8 ///
highqualdum4 highqualdum3 highqualdum2 highqualdum1 socdum2 socdum3 , contrast(1/3)), ///
level2(lacode2: (constant , contrast (1/3))) ///
level1(caseid) discrete(distribution(multinomial) ///
link(ologit) denom(caseid) base(3) mql1)

The null model also produces output, and the step by step models prior to the one above.
But I get errors as soon as I try to add more independent variables in the next stage of the model building, like this:

runmlwin ols_imprel constant (female age mardum2 mardum3 mardum4 incomedum2 ///
incomedum3 incomedum4 incomedum5 incomedum6 incomedum7 incomedum8 ///
highqualdum4 highqualdum3 highqualdum2 highqualdum1 socdum2 socdum3 ///
ethdum2 ethdum3 ethdum4 , contrast(1/3)), ///
level2(lacode2: (constant , contrast (1/3))) ///
level1(caseid) discrete(distribution(multinomial) ///
link(ologit) denom(caseid) base(3) mql1)

I get the error "option level2() not allowed"

This seems to happen whichever extra independent variables I add in. I can't figure out why in the top model runmlwin is happy with the commas and options, but in the lower model it is not. All I think I have done differently in the lower model is add in three dummies.

Thanks very much for your help,
Meena
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: option level2() not allowed error

Post by GeorgeLeckie »

Hi Meena,

We fixed a bug like this a while back relating to long lists of explanatory variables.

Hopefully it is as simple as you not using the latest version of runmlwin

Can you check that you are using the latest version of runmlwin

Code: Select all

. ssc install runmlwin, replace
Do you still get the same error message?

Best wishes

George
MeenaParam
Posts: 4
Joined: Tue Mar 06, 2012 2:06 pm

Re: option level2() not allowed error

Post by MeenaParam »

That's fixed the problem, thank you very much George!

Meena
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: option level2() not allowed error

Post by GeorgeLeckie »

Great news
Good luck with your modelling
George
lisagruene
Posts: 3
Joined: Mon Feb 06, 2017 3:25 pm

Re: option level2() not allowed error

Post by lisagruene »

Dear all,

I just ran into the same problem.

I am a first time user and just installed runmlwin - via ssc install runmlwin-. Just to be safe, I updated again just now -ssc install runmlwin, replace. However, for me the problem remains, even when estimating my baseline model (run mlwin dv cons, level2(identifier: cons) level1(identifier:cons)).

Do you maybe have any idea what the problem may be, or what I can try? Could it be that something went wrong (I made a mistake) during the installation?

I´m sorry to bother,

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

Re: option level2() not allowed error

Post by ChrisCharlton »

If you have only recently installed -runmlwin- then it is unlikely to have the same cause as the updated version was uploaded to ssc many years ago. Could you try running the command:

Code: Select all

help runmlwin
and testing some of the examples listed there to see whether they work with your setup?

If they do then there is likely to be an error with your model specification and it would be useful if you could provide the exact command syntax that you are using.

If the examples are not working then can you run the command:

Code: Select all

set trace on
before running an example, and then posting the output from Stata?
Post Reply