Re: $MIX and $CONTR
Nick,
I am not sure that the entire idea is correct: subject can only belong to one population, it cannot jump from population to population. Therefore, time dependent P() should not be allowed. Record-number dependence in $MIX was probably invented to have an option of defining the Ps either by the baseline values, or by the values at the end of the study, but not for time-dependence. This could explains differences with the PK block approach.
Thanks
Leonid
> First question: Why is the proportion of simulated subjects different from what I expected? It seems like all the values are being simulated with AGE=50 instead of AGE=0.
>
> Second question: More generally, if we used AGE in other subroutines (e.g. $PK, $PRED) then AGE would change depending on the value in the current event record. Why doesn't this happen with $MIX?
>
> Third question: Is there a way to know the index of the observation record that is being used by $MIX? If I wanted to use AGE like I do in $PK it seems I must give the index of the current observation record.
Nick Holford wrote:
> I wonder if someone can explain this item in the online NONMEM help guide for
> $MIX.
>
> $INPUT ... AGE ...
> $CONTR DATA=(AGE)
> Then AGE may be used on the right in $MIX. AGE and AGE(1) both
> refer to the value of AGE on the first observation record of the
> individual record. AGE(i) refers to the value of AGE on the i-
> th. observation record of the individual record.
>
> Assume there are 2 records for each subject like this
>
> ID AGE DV
> 1 0 10.506
> 1 50 10.331
> 2 0 10.039
> 2 50 10.99
> 3 0 9.3782
> 3 50 9.9395
> 4 0 98.438
> 4 50 99.411
> 5 0 10.598
> 5 50 9.6335
>
> and this code is used to simulate with a different mixing fraction if AGE is
> less than 25 compared with AGE greater than or equal to 25:
>
> $PROB MIX
> $DATA agemix.csv
> $INPUT ID AGE DV
> $SIM (20070730) ONLYSIM NSUB=1
> $THETA
> 0.25 ; PLT25 25% of young are non-responder
> 0.75 ; PGE25 75% of older are non-responder
> 10 ; NONRESPONDER
> 100 ; RESPONDER
> $OMEGA 0.01
> $OMEGA 0.1
>
> $SIGMA 1
>
> $PRED
> IF (MIXNUM.EQ.1) THEN ; non-responder
> Y=THETA(3) + ETA(1) + EPS(1)
> ELSE ; responder
> Y=THETA(4) + ETA(2) + EPS(1)
> ENDIF
>
> $CONTR DATA=(AGE)
> $MIX
> NSPOP=2
> IF (AGE.LT.25) THEN
> P(1)=THETA(1) ; young non-responder
> P(2)=1-THETA(1)
> ELSE
> P(1)=THETA(2) ; older non-responder
> P(2)=1-THETA(2)
> ENDIF
>
> $TABLE ID AGE DV
> NOAPPEND NOPRINT ONEHEADER FILE=agemix.fit
>
> I choose to define a response > 50 as a responder and <=50 as a non-responder.
> The simulated DV values (10,000 subjects) had 75% of non-responders (with the
> same proportion at both ages). I had expected 25% because AGE in $MIX is
> supposed to be the AGE on the first obs record i.e. AGE=0. I got identical
> results with NONMEM VI and NONMEM V.
>
> First question: Why is the proportion of simulated subjects different from what
> I expected? It seems like all the values are being simulated with AGE=50
> instead of AGE=0.
>
> Second question: More generally, if we used AGE in other subroutines (e.g.
> $PK, $PRED) then AGE would change depending on the value in the current event
> record. Why doesn't this happen with $MIX?
>
> Third question: Is there a way to know the index of the observation record that
> is being used by $MIX? If I wanted to use AGE like I do in $PK it seems I must
> give the index of the current observation record.
>
> Nick
>
> --
> Nick Holford, Dept Pharmacology & Clinical Pharmacology
> University of Auckland, 85 Park Rd, Private Bag 92019, Auckland, New Zealand
> [EMAIL PROTECTED] tel:+64(9)373-7599x86730 fax:+64(9)373-7090
> www.health.auckland.ac.nz/pharmacology/staff/nholford