Page 1 of 1

Error message running any model with updated mlwin using runmlwin STATA 13

Posted: Thu Nov 03, 2016 12:17 pm
by ginamartin
Hello,

I have just updated my version of mlwin and ran the adoupdate which appeared to work fine. Now when I try to run even the simplest model(see below) I get an error message ("variable cons not found"). Any help with this would be much appreciated!

Thank you,
Gina

runmlwin coping cons, ///
level2(IntZone: cons ) ///
level1(SEQNO: cons ) nopause)

. . adoupdate runmlwin
(note: adoupdate updates user-written files; type -update- to check for updates to official
Stata)

Checking status of specified packages...

[5] runmlwin at http://fmwww.bc.edu/repec/bocode/r:
installed package is up to date

(no packages require updating)

. runmlwin coping cons, ///
> level2(IntZone: cons ) ///
> level1(SEQNO: cons ) nopause

variable cons not found

Re: Error message running any model with updated mlwin using runmlwin STATA 13

Posted: Thu Nov 03, 2016 1:13 pm
by ChrisCharlton
Can you confirm that you definitely do have a variable defined in your open data file called cons? If so, could you let us know what the names are of the other variables in the data, in case there is some conflict. It might also be worth trying some of the -runmlwin- examples available via help runmlwin to see whether the problem also occurs there.

Re: Error message running any model with updated mlwin using runmlwin STATA 13

Posted: Fri Nov 04, 2016 10:44 am
by ginamartin
Thank you Chris. I am new to runmlwin. I ran the help tutorial Two-level random-intercept model, analogous to xtreg (fitted using IGLS) which works fine. I created a variable cons =1 and now no longer get that message. I do get the error message:
The data must be sorted according to the order of the model hierarchy: IntZone SEQNO.

The variables in my data set are (in this order) IntZone, SEQNO, AGE,AGECAT,coping, cons. I sorted both the IntZone and SEQNO ascending but still get the error message. My data appears to be organised in the same fashion as the tutorial data.

Thank you,
Gina

Re: Error message running any model with updated mlwin using runmlwin STATA 13

Posted: Fri Nov 04, 2016 11:35 am
by ChrisCharlton
MLwiN requires that the data is sorted according to the level hierarchy, i.e.

Code: Select all

school student
1      1
1      2
1      3
1      4
2      1
2      2
2      3
2      4
3      1
3      2
3      3
3      4
This is because MLwiN uses a change in the ID to signify a new higher level unit rather than the codes themselves. -runmlwin- can sort the data for you with the forcesort option, however it is generally advisable for you to do this yourself prior to calling the command so that you can be sure that the data is as you expect. If you sorted your variables separately then it is possible that they do not match the form above, as the level-1 IDs need to be sorted within the level-2 IDs.

Re: Error message running any model with updated mlwin using runmlwin STATA 13

Posted: Fri Nov 04, 2016 12:55 pm
by ginamartin
Thank you Chris! It is working now.

Gina