Simulation of mixing proportion

1 messages 1 people Latest: Dec 28, 2015

Simulation of mixing proportion

From: Ka Ho Hui Date: December 28, 2015 technical
Dear all, I am trying to simulate datasets with variable mixing proportion of a mixture of 2 subgroups. Relevant codes are shown below: $SIMULATION (61965) (24214184 UNIFORM) (3261746 NORMAL) ONLYSIMULATION $SUBROUTINE ADVAN2 $PK IF (ICALL.EQ.4.AND.NEWIND.EQ.0) THEN CALL RANDOM (2,R) PMIX=R*0.8+0.1 ;SIMUATION OF MIXING PROPORTION in U(0.1,0.9) CALL RANDOM (2,R) OMG_ETA1=R*0.4+0.1 ;SIMULATION OF SD OF ETA(1) in U(0.1,0.5) ENDIF IF (ICALL.EQ.4.AND.NEWIND.NE.2) THEN CALL RANDOM (3,R) CL1_ETA1=R*OMG_ETA1 ;SIMULATION OF RANDOM EFFECT in N(0,OMG_ETA1) ENDIF TVCL=THETA(1) CL=TVCL*(1+CL1_ETA1) … $MIX NSPOP=2 P(1)=PMIX ↑ P(2)=1-P(1) … I got the “208 UNDEFINED VARIABLE” error from this (Location of error shown with an arrow above). It seems that it does not work if I include a user-defined variable in the $MIX block, nor can I do so in the $OMEGA, $SIGMA or $THETA block. Fortunately somehow I could use the above workaround to allow the simulation of the variance of the random effect CL1_ETA1, instead of relying on the $OMEGA record. But I have no idea how I can simulate different mixing proportions if the above method does not work. It would be great if somebody can help me a bit on this =] Best Regards, Matthew