Using imputed values to runmlwin

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
likestatistic
Posts: 39
Joined: Fri Sep 12, 2014 4:11 pm

Using imputed values to runmlwin

Post by likestatistic »

Hello Both,
I hope you are doing well. I wish you a happy new year.
I am using 50 imputed data to runmlwin. Due to the size of my database (more than 200000 obs and 85 var), I am using the flong format.
I sorted my data according to level3 level2 level1 but I am getting the following error message:

The data must be sorted according to the order of the model hierarchy: level3 level2 level1.
an error occurred when mi estimate executed runmlwin on m=1
no results will be saved


. xi: mi est, saving(miest) cmdok: runmlwin responsvar cons var1 var2 var3 var4 var5 var6 i.var7 var8 i
> .var9 i.var10 i.var11 i.var12 i.var13 i.var14 var15, level3(id_level3 : cons) level2(id_level2 : co
> ns) level1(id_level1 : cons) nopause
i.var7 _Ivar7_0-2 (naturally coded; _Ivar7_0 omitted)
i.var9 _Ivar9_1-3 (naturally coded; _Ivar9_1 omitted)
i.var10 _Ivar10_0-1 (naturally coded; _Ivar10_0 omitted)
i.var11 _Ivar11_1-5 (naturally coded; _Ivar11_1 omitted)
i.var12 _Ivar12_0-3 (naturally coded; _Ivar12_0 omitted)
i.var13 _Ivar13_0-3 (naturally coded; _Ivar13_0 omitted)
i.var14 _Ivar14_1-3 (naturally coded; _Ivar14_1 omitted)
The data must be sorted according to the order of the model hierarchy: id_level3 id_level2 id_level1.

an error occurred when mi estimate executed runmlwin on m=1
no results will be saved


Is it related to the imputed data style? Do I need to convert them to the wide style (Stata wouldn’t support a certain amount of variables) ?
Many thanks for your help
Attachments
sample.xls
(26.25 MiB) Downloaded 381 times
ChrisCharlton
Posts: 1353
Joined: Mon Oct 19, 2009 10:34 am

Re: Using imputed values to runmlwin

Post by ChrisCharlton »

Probably the simplest solution would be to switch to the flongsep format, which stores each imputed dataset in a different file. This would allow you to check the sorting is correct for each file used.

Alternatively you could try using the forcesort -runmlwin- setting which will cause -runmlwin- to automatically sort the data in the way that it is expecting. If you try this I would suggest initially running for a small number of imputed datasets and removing the nopause option so that you can check from within MLwiN that the data is sorted correctly.

Finally it's possible that you might instead be able to include the _mi_id variable in your sort command to ensure that the records for each imputed dataset appear in the correct order. If you try this I would again suggest testing with the nopause option turned off so you can check what is sent to MLwiN.
likestatistic
Posts: 39
Joined: Fri Sep 12, 2014 4:11 pm

Re: Using imputed values to runmlwin

Post by likestatistic »

Hi Georges

Many thanks for your suggestions

Regards

L
likestatistic
Posts: 39
Joined: Fri Sep 12, 2014 4:11 pm

Re: Using imputed values to runmlwin

Post by likestatistic »

Sorry
Thank you ChrisCharlton :)
Post Reply