problem with parameter estimated

Welcome to the forum for MLwiN users. Feel free to post your question about MLwiN software 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!

Remember to check out our extensive software FAQs which may answer your question: http://www.bristol.ac.uk/cmm/software/s ... port-faqs/
Post Reply
norraida76
Posts: 4
Joined: Thu Nov 14, 2013 10:13 pm

problem with parameter estimated

Post by norraida76 »

Dear all,
I have a problem with my output. I'm doing a simulation of 1000 set data and got 1000 values for all parameters. The problem is all the values are same which means the convergence is 100% and this happen even i change my N and n or intraclass correlation value. Here are my macro

1) simulation program

GENErate 1 3000 c1
CODE 100 30 1 c2
PUT 3000 1 c3
PUT 3000 1 c4
NRANdom 3000 c5
NRandom 100 c6
CODE c6 30 1 c7
name c1 'id1'
name c2 'id2'
name c3 'cons'
name c4 'y'
name c5 'x'
name c7 'z'
RESP c4
IDEN 2 c2
IDEN 1 c1
ADDT c3
SETV 2 c3
SETV 1 c3
ADDT c5
SETV 2 c5
ADDT c7
ADDT 'x' 'z'
ERASE c10
LOOP b1 1 1000
BATCH 1
SEED 1
OBEY C:\Windows\MLwiN v2.16\samples\gensimulation.txt
OBEY C:\Windows\MLwiN v2.16\samples\runmodel1.txt
OBEY C:\Windows\MLwiN v2.16\samples\analyse1.txt
JOIN c10 b1 c10
ENDLOOP

2) gensimulation.txt
EDIT 1 c1096 0.0747
edit 2 c1096 0.000
EDIT 3 c1096 0.0747
EDIT 4 c1096 0.500
EDIT 1 c1098 1.0
EDIT 2 c1098 0.3
EDIT 3 c1098 0.3
EDIT 4 c1098 0.3
SIMU 'y'

3)runmodel1.txt
note IGLS
start
join c1098 c1096 c11 c11
join c1099 c1097 c12 c12

4)analyse1.txt
note macro analyses the results of the simu.txt macro and puts results in c40 & c41
erase c40-c41
code 8 1 1000 c20
code 20 1 1000 c19
split c11 c20 c21-c28
split c12 c19 c29-c48
ChrisCharlton
Posts: 1384
Joined: Mon Oct 19, 2009 10:34 am

Re: problem with parameter estimated

Post by ChrisCharlton »

As far as I can see all the commands within the loop will generate the same output each time, hence why you get the same parameter values for each iteration. The only commands that involve random number generation in this script are:

Code: Select all

NRANdom 3000 c5
NRandom 100 c6
however these only occur once, outside the loop.
norraida76
Posts: 4
Joined: Thu Nov 14, 2013 10:13 pm

Re: problem with parameter estimated

Post by norraida76 »

Thank you mr Chris. will try to check it back.
norraida76
Posts: 4
Joined: Thu Nov 14, 2013 10:13 pm

Re: problem with parameter estimated

Post by norraida76 »

Dear Mr Chris. im very happy now, i wonder why i cant think the problem is about the 'loop'. Thank you. :P
Post Reply