[NMusers] Simulation of mixing proportion

From: HUI, Ka Ho <matthew.hui_at_link.cuhk.edu.hk>
Date: Mon, 28 Dec 2015 09:27:41 +0000

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)
¡K

$MIX
NSPOP=2
P(1)=PMIX
    ¡ô
P(2)=1-P(1)

¡K


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
Received on Mon Dec 28 2015 - 04:27:41 EST

This archive was generated by hypermail 2.3.0 : Fri Sep 27 2019 - 16:48:11 EDT