Re: $MIX and $CONTR
Hi Nick,
I fully agree with #1. It is a very reasonable model biologically, but the mixture model is not an appropriate tool to describe this model. You may want to describe it with the different procedure: describe probability (not jump, but continuous function of age or something else) of being a responder, and on top of it define different conditional probability of a response for responders and non responders.
P(AGE): probability of being a responder
Presp: probability of response for responders
Pnresp: probability of response for non-responders
Y=P*Presp+(1-P)Pnresp
Of course, each of P, Presp, Pnresp should be expressed via THETAs, ETAs, whatever we need; may depend on gene expression if you like.
I am not sure that I agree with #2: this is not a nonmem implementation deficiency. The biological problem that you describe simply does not fit in the framework of the mixture model, it should be described differently, may be as above (this was only a quick sketch, may not work for you), may be in a more complicated way, but not as a mixture model.
Alternatively, you may assign different IDs to the same subject at age 10 and 50 (it is naive to expect that we stay unchanged for a lifetime): if the person changes so much that it jumps from responders to non-responders, you may expect other changes as well.
Please, let us know if you come up with NONMEM description of your problem.
Leonid
Nick Holford wrote:
> Leonid,
>
> Thanks for your thoughtful comments.
>
> I think there are two things to keep separate:
>
> 1. Imagine a drug response can be described by a bi-modal distribution when one
> examines a sample of subjects who are all children. A mixture model can be used
> to identify the parameters of this mixed distribution. One can then categorize
> people as being more likely to be in distribution ('responders') than in the
> other distribution ('non-responders').
>
> Supposing that we now observe that in a different sample of older subjects that
> the mixing probability is different but the two distributions have similar
> parameters. We would therefore conclude that the mixing probability changes
> with age.
>
> The underlying basis for the distinction between responder and non-responder
> may be due to the expression of a gene. The expression of some genes is well
> known to vary during human development. Imagine that this gene is either turned
> on ('responder') or is turned off ('non-responder'). This would be a biological
> explanation of the age dependence of the mixing parameter. If the genotype is
> unknown then we would need to use a mixture model to try to decide which
> genotype is most likely in an individual. But because the probability of
> expression of the gene is also unknown but varies with age then a mixture model
> with age as a covariate seems reasonable. If we observed the same subjects as
> children and later as adults then we should be able to describe the age related
> shift in the probability of being a 'responder' or a 'non-responder'.
>
> It is this kind of situation that I tried to describe using the NM-TRAN code.
>
> 2. NONMEM is a particular implementation of a method for describing and estimating the parameters of mixture model. It seems that NONMEM may only have a rather simple view of mixtures i.e. an individual always belongs to the same distribution and this cannot change.
>
> I am not sure yet if it is true that NONMEM assumes a fixed (life long) within
> subject assignment to a distribution but I dont see any a priori reason why an
> individual should not shift from one distribution to another (as explained in
> the example above).
>
> Nick
>
> Leonid Gibiansky wrote:
>
> > Nick,
> >
> > I think you are reading it incorrectly. I would guess that for a long-term
> > study you may relate
> > probability of response to either baseline age or to the end-of-study age, or
> > to any other age in
> > between, but this value should be one per subject, not one per record.
> > Probability of a subject be
> > in one group is assigned based on the entire data set for this subject, and not
> > extracted from one
> > record. Probability of being a responder may depend on age, but it should be 1
> > value for a subject,
> > not 1 value for a record. If you want to simulate subject with same covariates
> > but different age,
> > give them separate IDs. You may need to simulate ETAs separately (if you want
> > patients with the same
> > random effects but different ages).
> >
> > I do not have sufficient experience or knowledge of the nonmem code to be more
> > assertive. This is my
> > guess only, but guess confirmed by a special treatment of a time dependency in
> > the $MIX block (as
> > you described).
> >
> > Leonid
> >
> > Nick Holford wrote:
> >
> > > Leonid,
> > >
> > > I dont see why a proportion should not change with time. The documentation for
> > > $MIX says this:
> > >
> > > "Then AGE may be used on the right in $MIX. ...
> > > AGE(i) refers to the value of AGE on the i-th. observation record of the
> > > individual record."
> > >
> > > This clearly shows that it was anticipated that one might wish to use AGE from
> > > any observation record in the individual record. If the records represent a
> > > time series (which is 100% necessary if AGE varies!) then this implies that a
> > > time varying covariate can be used to model the mixing probability.
> > >
> > > In my example I propose that the probability of being a responder changes with
> > > age. E.g. children tend to respond to amphetamine like drugs by being less
> > > active while adults tend to be stimulated.
> > >
> > > This seems like a very plausible way to describe the response in a population.
> > > I dont think there is any a priori reason why there should not be a within
> > > subject variation in a mixing fraction.
> > >
> > > My view of a mixing fraction is that it is a substitute for a missing
> > > covariate. If one has a time varying covariate then the mixing fraction would
> > > be time varying. In the example proposed in the NONMEM help the covariate
> > > proposed for use in $MIX is AGE. If AGE is properly recorded in the data set
> > > then AGE is guaranteed to be a time varying covariate!
> > >
> > > Nick
> > >
> > > Leonid Gibiansky wrote:
> > >
> > > > 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
> > >
> > > --
> > > 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
>
> --
> 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