Dear Users:
I note the Jan 26, 2013 response to Nick Holford's query about results from the use of the $MIX mixture model for simulation. I have created a data set of N=100 subjects using R to randomly distribute their covariates, both continuous and categorical. I then ran the following sim with SUBPOP=1 to generate their corresponding DV values using the following code:
; SIMULATION CTL
$PROBLEM SIM 2COMP
$INPUT ID TIME AMT DV WT HT BMI BSA GFR AGE SEX TOB EVID
$DATA MethodSim1.CSV IGNORE=#
$SUBROUTINES ADVAN4 TRANS4
$SIMULATION (12345) SUBPROBLEMS=1 ONLYSIMULATION
$MIX
NSPOP=2
P(1)=THETA(7)
P(2)=1.0-THETA(7)
$PK
KA=THETA(1)* EXP(ETA(1)); ETA removed in subsequent fitting of data
CL1=THETA(2)*((WT/70)**0.75) ; non-renal clearance of subpop1
CL2=THETA(3)*((WT/70)**0.75); non-renal clearance of subpop1
CLr=(GFR*60/1000)*0.5 ; renal clearance
Z=1
IF(MIXNUM.EQ.2) Z=0
CL=(Z*(CL1 + CLr) + (1.0-Z)*(CL2 + CLr))* EXP(ETA(2))
V2 = THETA(4)*(WT/70)*EXP(ETA(3))
Q = THETA(5)*(WT/70)**0.75
V3 =THETA(6)*(WT/70)
S2=V2
$ERROR
IPRE = F
W1=F
DEL = 0
IF(IPRE.LT.0.001) DEL = 1
IRES = DV-IPRE; NEGATIVE TREND IS OVERESTIMATING IPRED WRT DV
IWRE = IRES/(W1+DEL)
Y=F*(1+ERR(1))
$THETA (2); KAS
$THETA (0.1); CL1
$THETA (5); CL2
$THETA (5); VC
$THETA (12); Q
$THETA (40); VP
$THETA (0.4); FZ
$OMEGA 0 FIXED; IEKA
$OMEGA 0 FIXED; IECL
$OMEGA 0 FIXED; IEV2
$SIGMA 0.03;
$TABLE ID TIME AMT DV WT HT BMI BSA GFR AGE SEX TOB EVID NOPRINT NOHEADER NOAPPEND FILE=SimData.txt
However, when I come back and attempt to model the simulated data set, my ETA1 on CL (note difference from the simulation ctl above) still shows a bimodal distribution. With the incorporation of the $MIXture model , I would expect a unimodal distribution of ETA_CL entered on 0. Can the community please advise?
;FITTED CTL
$MIX
NSPOP=2
P(1)=THETA(7)
P(2)=1.0-THETA(7)
$PK
KA=THETA(1)
CL1=THETA(2)*((WT/70)**0.75)
CL2=THETA(3)*((WT/70)**0.75)
RS=THETA(8)
CLr=(GFR*60/1000)*RS
Z=1
IF(MIXNUM.EQ.2) Z=0
CL=((Z*CL1 + CLr) + ((1.0-Z)*CL2 + CLr))*EXP(ETA(1))
V2 = THETA(4)*(WT/70)*EXP(ETA(2)
Q = THETA(5)*(WT/70)**0.75
V3 =THETA(6)*(WT/70)
Thanks
Paul
--
Paul R. Hutson, Pharm.D.
Associate Professor
UW School of Pharmacy
T: 608.263.2496
F: 608.265.5421
Mixture model simulation
4 messages
4 people
Latest: May 07, 2013
should it be IF(MIXEST.EQ.2) Z=0 for the fitting run?
--------------------------------------
Leonid Gibiansky, Ph.D.
President, QuantPharm LLC
web: www.quantpharm.com
e-mail: LGibiansky at quantpharm.com
tel: (301) 767 5566
Quoted reply history
On 5/7/2013 11:31 AM, Paul Hutson wrote:
> Dear Users:
> I note the Jan 26, 2013 response to Nick Holford's query about results
> from the use of the $MIX mixture model for simulation. I have created a
> data set of N=100 subjects using R to randomly distribute their
> covariates, both continuous and categorical. I then ran the following
> sim with SUBPOP=1 to generate their corresponding DV values using the
> following code:
> ; SIMULATION CTL
> $PROBLEM SIM 2COMP
> $INPUT ID TIME AMT DV WT HT BMI BSA GFR AGE SEX TOB EVID
> $DATA MethodSim1.CSV IGNORE=#
> $SUBROUTINES ADVAN4 TRANS4
> $SIMULATION (12345) SUBPROBLEMS=1 ONLYSIMULATION
>
> $MIX
> NSPOP=2
> P(1)=THETA(7)
> P(2)=1.0-THETA(7)
>
> $PK
> KA=THETA(1)* EXP(ETA(1)); ETA removed in subsequent fitting of data
> CL1=THETA(2)*((WT/70)**0.75) ; non-renal clearance of subpop1
> CL2=THETA(3)*((WT/70)**0.75); non-renal clearance of subpop1
> CLr=(GFR*60/1000)*0.5 ; renal clearance
>
> Z=1
> IF(MIXNUM.EQ.2) Z=0
> CL=(Z*(CL1 + CLr) + (1.0-Z)*(CL2 + CLr))* EXP(ETA(2))
> V2 = THETA(4)*(WT/70)*EXP(ETA(3))
>
> Q = THETA(5)*(WT/70)**0.75
> V3 =THETA(6)*(WT/70)
> S2=V2
>
> $ERROR
> IPRE = F
> W1=F
> DEL = 0
> IF(IPRE.LT.0.001) DEL = 1
> IRES = DV-IPRE; NEGATIVE TREND IS OVERESTIMATING IPRED WRT DV
> IWRE = IRES/(W1+DEL)
> Y=F*(1+ERR(1))
>
> $THETA (2); KAS
> $THETA (0.1); CL1
> $THETA (5); CL2
> $THETA (5); VC
> $THETA (12); Q
> $THETA (40); VP
> $THETA (0.4); FZ
>
> $OMEGA 0 FIXED; IEKA
> $OMEGA 0 FIXED; IECL
> $OMEGA 0 FIXED; IEV2
>
> $SIGMA 0.03;
>
> $TABLE ID TIME AMT DV WT HT BMI BSA GFR AGE SEX TOB EVID NOPRINT
> NOHEADER NOAPPEND FILE=SimData.txt
>
> However, when I come back and attempt to model the simulated data set,
> my ETA1 on CL (note difference from the simulation ctl above) still
> shows a bimodal distribution. With the incorporation of the $MIXture
> model , I would expect a unimodal distribution of ETA_CL entered on 0.
> Can the community please advise?
>
> ;FITTED CTL
> $MIX
> NSPOP=2
> P(1)=THETA(7)
> P(2)=1.0-THETA(7)
>
> $PK
> KA=THETA(1)
> CL1=THETA(2)*((WT/70)**0.75)
> CL2=THETA(3)*((WT/70)**0.75)
> RS=THETA(8)
> CLr=(GFR*60/1000)*RS
> Z=1
> IF(MIXNUM.EQ.2) Z=0
> CL=((Z*CL1 + CLr) + ((1.0-Z)*CL2 + CLr))*EXP(ETA(1))
> V2 = THETA(4)*(WT/70)*EXP(ETA(2)
> Q = THETA(5)*(WT/70)**0.75
> V3 =THETA(6)*(WT/70)
>
> Thanks
> Paul
Dear Paul,
I don't think you should expect the same ETA for CL under the two mixtures,
but estimate two separate ones as shown below.. Note also that the estimate
of ETA you get in the table file is the one from the most probable mixture
component (whereas the contribution from both mixture components for each
subject contributes to the likelihood). To know which the most probably
mixture is for each subject output EST after stating EST=MIXEST.
I would change the estimation model from
CL=(Z*(CL1 + CLr) + (1.0-Z)*(CL2 + CLr))* EXP(ETA(1))
V2 = THETA(4)*(WT/70)*EXP(ETA(2))
To
CL=Z*(CL1 + CLr)* EXP(ETA(1))
CL=(1.0-Z)*(CL2 + CLr)* EXP(ETA(2))
V2 = THETA(4)*(WT/70)*EXP(ETA(3))
(I'm not sure about your ETA variance structure as it is not entirely
provided, but if you use a covariance between CL and V use also separate
ETAs for V between mixtures)
Best regards,
Mats
Mats Karlsson, PhD
Professor of Pharmacometrics
Dept of Pharmaceutical Biosciences
Faculty of Pharmacy
Uppsala University
Box 591
75124 Uppsala
Phone: +46 18 4714105
Fax + 46 18 4714003
Quoted reply history
-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Paul Hutson
Sent: 07 May 2013 17:32
To: [email protected]
Subject: [NMusers] Mixture model simulation
Dear Users:
I note the Jan 26, 2013 response to Nick Holford's query about results from
the use of the $MIX mixture model for simulation. I have created a data set
of N=100 subjects using R to randomly distribute their covariates, both
continuous and categorical. I then ran the following sim with SUBPOP=1 to
generate their corresponding DV values using the following code:
; SIMULATION CTL
$PROBLEM SIM 2COMP
$INPUT ID TIME AMT DV WT HT BMI BSA GFR AGE SEX TOB EVID $DATA
MethodSim1.CSV IGNORE=# $SUBROUTINES ADVAN4 TRANS4 $SIMULATION (12345)
SUBPROBLEMS=1 ONLYSIMULATION
$MIX
NSPOP=2
P(1)=THETA(7)
P(2)=1.0-THETA(7)
$PK
KA=THETA(1)* EXP(ETA(1)); ETA removed in subsequent fitting of data
CL1=THETA(2)*((WT/70)**0.75) ; non-renal clearance of subpop1
CL2=THETA(3)*((WT/70)**0.75); non-renal clearance of subpop1
CLr=(GFR*60/1000)*0.5 ; renal clearance
Z=1
IF(MIXNUM.EQ.2) Z=0
CL=(Z*(CL1 + CLr) + (1.0-Z)*(CL2 + CLr))* EXP(ETA(2))
V2 = THETA(4)*(WT/70)*EXP(ETA(3))
Q = THETA(5)*(WT/70)**0.75
V3 =THETA(6)*(WT/70)
S2=V2
$ERROR
IPRE = F
W1=F
DEL = 0
IF(IPRE.LT.0.001) DEL = 1
IRES = DV-IPRE; NEGATIVE TREND IS OVERESTIMATING IPRED WRT DV
IWRE = IRES/(W1+DEL)
Y=F*(1+ERR(1))
$THETA (2); KAS
$THETA (0.1); CL1
$THETA (5); CL2
$THETA (5); VC
$THETA (12); Q
$THETA (40); VP
$THETA (0.4); FZ
$OMEGA 0 FIXED; IEKA
$OMEGA 0 FIXED; IECL
$OMEGA 0 FIXED; IEV2
$SIGMA 0.03;
$TABLE ID TIME AMT DV WT HT BMI BSA GFR AGE SEX TOB EVID NOPRINT
NOHEADER NOAPPEND FILE=SimData.txt
However, when I come back and attempt to model the simulated data set,
my ETA1 on CL (note difference from the simulation ctl above) still
shows a bimodal distribution. With the incorporation of the $MIXture
model , I would expect a unimodal distribution of ETA_CL entered on 0.
Can the community please advise?
;FITTED CTL
$MIX
NSPOP=2
P(1)=THETA(7)
P(2)=1.0-THETA(7)
$PK
KA=THETA(1)
CL1=THETA(2)*((WT/70)**0.75)
CL2=THETA(3)*((WT/70)**0.75)
RS=THETA(8)
CLr=(GFR*60/1000)*RS
Z=1
IF(MIXNUM.EQ.2) Z=0
CL=((Z*CL1 + CLr) + ((1.0-Z)*CL2 + CLr))*EXP(ETA(1))
V2 = THETA(4)*(WT/70)*EXP(ETA(2)
Q = THETA(5)*(WT/70)**0.75
V3 =THETA(6)*(WT/70)
Thanks
Paul
--
Paul R. Hutson, Pharm.D.
Associate Professor
UW School of Pharmacy
T: 608.263.2496
F: 608.265.5421
Dear Paul,
All OMEGAs are zero during simulation? So I'm thinking about what that would
mean for ETA_CL if is not fixed to zero when fitting; what would happen to
ETA_CL if not all estimated subgroups are equal to the simulated ones, or the
effect of a less than perfect fit on ETA_CL might be different for the
subgroups?
Erik
Quoted reply history
________________________________________
From: [email protected] [[email protected]] on behalf of
Paul Hutson [[email protected]]
Sent: Tuesday, May 07, 2013 5:31 PM
To: [email protected]
Subject: [NMusers] Mixture model simulation
Dear Users:
I note the Jan 26, 2013 response to Nick Holford's query about results
from the use of the $MIX mixture model for simulation. I have created a
data set of N=100 subjects using R to randomly distribute their
covariates, both continuous and categorical. I then ran the following
sim with SUBPOP=1 to generate their corresponding DV values using the
following code:
; SIMULATION CTL
$PROBLEM SIM 2COMP
$INPUT ID TIME AMT DV WT HT BMI BSA GFR AGE SEX TOB EVID
$DATA MethodSim1.CSV IGNORE=#
$SUBROUTINES ADVAN4 TRANS4
$SIMULATION (12345) SUBPROBLEMS=1 ONLYSIMULATION
$MIX
NSPOP=2
P(1)=THETA(7)
P(2)=1.0-THETA(7)
$PK
KA=THETA(1)* EXP(ETA(1)); ETA removed in subsequent fitting of data
CL1=THETA(2)*((WT/70)**0.75) ; non-renal clearance of subpop1
CL2=THETA(3)*((WT/70)**0.75); non-renal clearance of subpop1
CLr=(GFR*60/1000)*0.5 ; renal clearance
Z=1
IF(MIXNUM.EQ.2) Z=0
CL=(Z*(CL1 + CLr) + (1.0-Z)*(CL2 + CLr))* EXP(ETA(2))
V2 = THETA(4)*(WT/70)*EXP(ETA(3))
Q = THETA(5)*(WT/70)**0.75
V3 =THETA(6)*(WT/70)
S2=V2
$ERROR
IPRE = F
W1=F
DEL = 0
IF(IPRE.LT.0.001) DEL = 1
IRES = DV-IPRE; NEGATIVE TREND IS OVERESTIMATING IPRED WRT DV
IWRE = IRES/(W1+DEL)
Y=F*(1+ERR(1))
$THETA (2); KAS
$THETA (0.1); CL1
$THETA (5); CL2
$THETA (5); VC
$THETA (12); Q
$THETA (40); VP
$THETA (0.4); FZ
$OMEGA 0 FIXED; IEKA
$OMEGA 0 FIXED; IECL
$OMEGA 0 FIXED; IEV2
$SIGMA 0.03;
$TABLE ID TIME AMT DV WT HT BMI BSA GFR AGE SEX TOB EVID NOPRINT
NOHEADER NOAPPEND FILE=SimData.txt
However, when I come back and attempt to model the simulated data set,
my ETA1 on CL (note difference from the simulation ctl above) still
shows a bimodal distribution. With the incorporation of the $MIXture
model , I would expect a unimodal distribution of ETA_CL entered on 0.
Can the community please advise?
;FITTED CTL
$MIX
NSPOP=2
P(1)=THETA(7)
P(2)=1.0-THETA(7)
$PK
KA=THETA(1)
CL1=THETA(2)*((WT/70)**0.75)
CL2=THETA(3)*((WT/70)**0.75)
RS=THETA(8)
CLr=(GFR*60/1000)*RS
Z=1
IF(MIXNUM.EQ.2) Z=0
CL=((Z*CL1 + CLr) + ((1.0-Z)*CL2 + CLr))*EXP(ETA(1))
V2 = THETA(4)*(WT/70)*EXP(ETA(2)
Q = THETA(5)*(WT/70)**0.75
V3 =THETA(6)*(WT/70)
Thanks
Paul
--
Paul R. Hutson, Pharm.D.
Associate Professor
UW School of Pharmacy
T: 608.263.2496
F: 608.265.5421