Level 1 residuals merge 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
michaellawton
Posts: 11
Joined: Tue Nov 22, 2011 10:40 pm

Level 1 residuals merge error

Post by michaellawton »

When asking runmlwin to store the level 1 residuals (using the residuals command) from my repeated measures model I get the following error message:

merge: after merge, not all observations from master or matched
(merged result left in memory)

I then have a list of residuals with a corresponding _residualid that does not always match up with the correct observation in my dataset and there are many duplicates of the residual_ids (that is 3609 residuals including duplicates when there are only 2301 observations). I am assuming that the _residualid matches to the true order of my original dataset, and a quick analysis by eye of some individuals and there fitted lines seems to back this up.

I have been getting round the problem by creating a dataset of only the residuals and the _residualid, then removing all the duplicates. At that point I then merge these residuals back to the original dataset with the _residualid and the ordered original dataset as the merging variable. Then I create my different residual plots like q-q plots, etc...

Is there a simpler way of dealing with this problem?
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: Level 1 residuals merge error

Post by GeorgeLeckie »

Hi Michael,

This doesn't sound great.

Can I check that you are first using the latest version fo runmlwin

Code: Select all

. ssc install runmlwin, replace
I you are and you are still getting this same problems, please send us a simple do-file and small dataset which replicates the problem.

We will then work on making the corrections to runmlwin

Many thanks

George
michaellawton
Posts: 11
Joined: Tue Nov 22, 2011 10:40 pm

Re: Level 1 residuals merge error

Post by michaellawton »

Hi,

Just tried your install command and now Stata displays the message:

runmlwin requires MLwiN version 2.24 or higher. You can download the latest version of MLwiN at: http://www.bristol.ac.uk/cmm/software/m ... rades.html

Can you tell me how to revert to the previous runmlwin because I do not have administrator rights to upgrade MLWIN on my computer!

Thanks
Michael
michaellawton
Posts: 11
Joined: Tue Nov 22, 2011 10:40 pm

Re: Level 1 residuals merge error

Post by michaellawton »

Hello

I just found my problem, I had fitted the following model:

runmlwin score cons ageonset fp1 fp6 , level2 (patid: cons fp1 fp6 ) level1(score: cons, residuals(lev1,var) ) nopause

However because I had made my level 1 indicator the same as my dependent variable (i.e. score) it came into problems when the score was the same in multiple observations. So instead after sorting my data I created a new sequential variable and used that as my level 1 indicator. That solved all the problems.

sort patid fp1
seq newids
runmlwin score cons ageonset fp1 fp6 , level2 (patid: cons fp1 fp6 ) level1(newids: cons, residuals(lev1,var) ) nopause
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: Level 1 residuals merge error

Post by GeorgeLeckie »

Great, I'm glad you solved the problem!

Thanks very much for giving the solution as other users may run into the same problem.

We will think about how to reduce the risk of people running into this problem nonetheless

Best wishes

George
Post Reply