Multiple membership model error 2

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
migsanse
Posts: 15
Joined: Sat Apr 06, 2013 9:17 am

Multiple membership model error 2

Post by migsanse »

Dear George:

MLwiN gives me another error message: "error while obeying batch file C:\XXX at line number 90: MCMC 0 500 1 5.8 50 10 1 1 1 1 1 1"

I read in another post that it might be due to the starting values. Any suggestion how to solve this?

Regards,
Mguel
ChrisCharlton
Posts: 1355
Joined: Mon Oct 19, 2009 10:34 am

Re: Multiple membership model error 2

Post by ChrisCharlton »

Have you tried supplying your own starting values to see whether this fixes the problem? Example syntax for how to do this can be found in the Stata do file replicating chapter 5 of the MCMC manual, which is provided on http://www.bris.ac.uk/cmm/software/runm ... ples/#mcmc.
migsanse
Posts: 15
Joined: Sat Apr 06, 2013 9:17 am

Re: Multiple membership model error 2

Post by migsanse »

Hi,
I have tried to follow the instructions and do the following:
quietly runmlwin Qfunc43 cons, level2(SAMS81: cons) level1(id: cons) nopause
matrix b = e(b)
matrix V = e(V)
matrix b[1,1] = -2
matrix b[1,2] = 5
matrix b[1,3] = 2
matrix b[1,4] = 4

Here there is an error saying: "conformability error"

My plan was later to apply:
runmlwin Qfunc43 cons, level2(SAMS81: cons, mmids(SAMS81 SAMS86) mmweights(weight1-weight2)) level1(id:cons) mcmc(burnin(0) chain(500)) initsb(b) initsv(V)

Any suggestion to solve that error?
Thanks in advance,
Miguel
ChrisCharlton
Posts: 1355
Joined: Mon Oct 19, 2009 10:34 am

Re: Multiple membership model error 2

Post by ChrisCharlton »

The b matrix should be 1x[number of parameters] and the V matrix should be [number of paramters]x[number of parameters]. I count three parameters in in your example model (FP1:cons, RP2:cons, RP1:cons) so you would only need to specify three elements of b for this. You can check the dimensions and contents of these matrices with the following code:

Code: Select all

mat list b
mat list V
migsanse
Posts: 15
Joined: Sat Apr 06, 2013 9:17 am

Re: Multiple membership model error 2

Post by migsanse »

Thanks Chris. That problem is solved. But still when I run the last command:
runmlwin Qfunc43 cons, level2(SAMS81: cons, mmids(SAMS81 SAMS86) mmweights(weight1-weight2)) level1(id:cons) mcmc(burnin(0) chain(500)) initsb(b) initsv(V)

This error comes: "error while obeying batch file C:\XXX at line number 90: MCMC 0 0 1 5.8 50 10 1 1 1 1 1 1"

Any idea?
Thanks,
Miguel
ChrisCharlton
Posts: 1355
Joined: Mon Oct 19, 2009 10:34 am

Re: Multiple membership model error 2

Post by ChrisCharlton »

When MLwiN opens could you try pressing the "Abort Macro" button and instead run the model using the "Start" button, as this may give you a more informative error message?
migsanse
Posts: 15
Joined: Sat Apr 06, 2013 9:17 am

Re: Multiple membership model error 2

Post by migsanse »

Thanks. When I do that (Abort and Start) a new error message appears: MCMC Error 0142: The 2th MM unit for obs 3 is a duplicate of the 1th MM unit(MCMC)
I checked obs 3 but it seems to me the same as the others.
ChrisCharlton
Posts: 1355
Joined: Mon Oct 19, 2009 10:34 am

Re: Multiple membership model error 2

Post by ChrisCharlton »

Each row of multiple membership IDs should not contain any repeats, if they are the same you need to remove one and set the weight of the other to the combined weight. If SAMS81 and SAMS86 don't have the same value for your third observation could you post the first few lines of data so we can attempt to determine what else might be triggering the message?
migsanse
Posts: 15
Joined: Sat Apr 06, 2013 9:17 am

Re: Multiple membership model error 2

Post by migsanse »

Hi,
my population has been living in four neighborhoods during their live so for some cases (rows) the same code could apply for the neighborhood for instance at time 1 and 3 because the person lived first in neighborhood X1, moved to X2 and then to X1 again. Could it be this the source of error?
When I run:
sort SAMS81 id
quietly runmlwin Qfunc43 cons, level2(SAMS81: cons) level1(id: cons) nopause
matrix b = e(b)
matrix V = e(V)
matrix b[1,1] = -2
matrix b[1,2] = 5
matrix b[1,3] = 2
runmlwin Qfunc43 cons, level2(SAMS81: cons, mmids(SAMS81 SAMS86 SAMS95 SAMS07) mmweights(weight1-weight4)) level1(id:cons) mcmc(burnin(0) chain(500)) initsb(b) initsv(V)

If I click in Resume Macro still comes: error while obeying batch file C:\XXX at line number 90: MCMC 0 500 1 5.8 50 10 1 1 1 1 1 1"
If I click in Abort Macro then Start then comes: "MCMC Error 0142: The 2th MM unit for obs 2 is a duplicate of the 1th MM unit(MCMC)"

This is how it looks the first four records:
id SAMS81 SAMS86 SAMS95 SAMS07 weight1 weight2 weight3 weight4
1 258000.63 148003.84 0 0 .25 .75 0 0
2 258000.09 0 0 0 1 0 0 0
3 258000.59 258000.14 0 0 .25 .75 0 0
4 258000.63 0 18000.439 0 .5 0 .5 0

If you think it is more practical to send you the database I can do it (it is not big).
Regards,
Miguel
ChrisCharlton
Posts: 1355
Joined: Mon Oct 19, 2009 10:34 am

Re: Multiple membership model error 2

Post by ChrisCharlton »

Yes, this is most likely the cause of the problem. MLwiN doesn't do anything with the ordering of the IDs within a row and only needs to know the total relative time for each ID. In your example you could add the weight for time 3 onto time 1 and remove the second instance.

I would also suggest that you recode the IDs to use integer values, as otherwise you might encounter rounding issues.
Post Reply