Re: flexible infusion rate model
Tomi,
Thanks for including your data fragment and control stream in your email. I am afraid I missed that you had an attachment. That is the first time I can recall seeing an attachment on nmusers. I thought they were usually censored by the nmusers server.
You have a complex model. This kind of model building process should be approached in steps -- especially with non-linear mixed effect models because all the algorithms are sensitive to initial estimates.
You may have tried the simpler approach I suggested last time of adding a random effect to the observed total infusion duration (don't use the nominal duration if you really observed what the total duration was) - lets call this the ETA on D1 model. That should give you a pretty good estimate of the other PK parameters.
I would also include the obvious covariate of allometrically scaled weight (not BSA!) on the CL and V parameters so that you don't have that kind of misspecification of the PK parameter variability in your model.
You can then fix the other PK parameters to their final values (including the random effect (OMEGA) and residual error parameter(s) (SIGMA)) so you can work on the the piecewise input model.
I see in your code that you have DADT(1) = R1 - K*A(1).
You should set F1=0 in $PK otherwise NONMEM will be also adding a further input with rate of R1 into the compartment. NONMEM normally takes care of input into compartments. You can stop this happening by setting the input bioavailability (F1) to zero. Then you can manage the input in the differential equation yourself.
There may be other logical bugs in your code because this error message
PK PARAMETER FOR RATE IS NON-POSITIVE
means that your code in $PK is calculating a value for R1 that is either 0 or negative.
I would first try to estimate the various MTIME and RB parameters without any random effects. Such a model would just estimate the MTIME and RB fixed effect parameters -- don't try to estimate any OMEGAs yet. Once you get a reasonable fit (which should be comparable or even better to the simple addition of ETA to D1) then try adding in some OMEGAs -- perhaps one at a time. After you have got some OMEGA estimates that work OK you can then try fitting the model again using the final piecewise input parameters as initial estimates along with the final PK parameters you got from the ETA on D1 run.
If you apply this 'Softly softly catchee monkey' approach you should be able to get the full model to work.
Best wishes,
Nick
Quoted reply history
On 19/08/2011 11:05 p.m., tomi hendrayana wrote:
> Hi Nick and all,
> thanks for the quick response, i deeply appreciate.
>
> Patient used ambulatory elastomeric baloon pumps, which was designed can run for 24 hours or 46 hours. But i observed that infusion ran only for approximately 21 hours or 42 hours. And yes...in the practice, i knew also that sometime for some reasons the physicians played around with the infusion rate and unfortunately they didnt make good record of this. In regard with control stream and data set, actually in my last mail i attached also my control file and part of data set...but anyway, here is my data set and control file.
>
> yours,
> -Tomi
> *Structure of data set:*
> #ID
>
> CYC
>
> BSA
>
> SEX
>
> AGE
>
> AMT
>
> EVID
>
> RATE
>
> TIME
>
> DUR
>
> DOS
>
> STUD
>
> DV
>
> LNDV
> 1
>
> 1
>
> 1.79
>
> 1
>
> 68
>
> 8804.07
>
> 1
>
> 76.17
>
> 0
>
> 115.58
>
> 5000
>
> 0
>
> 0
>
> 0
> 1
>
> 1
>
> 1.79
>
> 1
>
> 68
>
> 8804.07
>
> 1
>
> -1
>
> 0
>
> 115.58
>
> 5000
>
> 0
>
> 0
>
> 0
> 1
>
> 1
>
> 1.79
>
> 1
>
> 68
>
> 0
>
> 0
>
> 0
>
> 36
>
> 115.58
>
> 5000
>
> 0
>
> 0.389
>
> -0.944
> 1
>
> 1
>
> 1.79
>
> 1
>
> 68
>
> 0
>
> 0
>
> 0
>
> 48
>
> 115.58
>
> 5000
>
> 0
>
> 0.33
>
> -1.109
> 1
>
> 1
>
> 1.79
>
> 1
>
> 68
>
> 0
>
> 0
>
> 0
>
> 108
>
> 115.58
>
> 5000
>
> 0
>
> 0.027
>
> -3.612
> 1
>
> 1
>
> 1.79
>
> 1
>
> 68
>
> 0
>
> 0
>
> 0
>
> 120.3
>
> 115.58
>
> 5000
>
> 0
>
> 0.018
>
> -4.017
> 2
>
> 1
>
> 1.99
>
> 1
>
> 59
>
> 6342.96
>
> 1
>
> 53.93
>
> 0
>
> 117.61
>
> 3250
>
> 0
>
> 0
>
> 0
> 2
>
> 1
>
> 1.99
>
> 1
>
> 59
>
> 6342.96
>
> 1
>
> -1
>
> 0
>
> 117.61
>
> 3250
>
> 0
>
> 0
>
> 0
> 2
>
> 1
>
> 1.99
>
> 1
>
> 59
>
> 0
>
> 0
>
> 0
>
> 36
>
> 117.61
>
> 3250
>
> 0
>
> 0.116
>
> -2.154
> 2
>
> 1
>
> 1.99
>
> 1
>
> 59
>
> 0
>
> 0
>
> 0
>
> 48
>
> 117.61
>
> 3250
>
> 0
>
> 0.09
>
> -2.408
> 2
>
> 1
>
> 1.99
>
> 1
>
> 59
>
> 0
>
> 0
>
> 0
>
> 108
>
> 117.61
>
> 3250
>
> 0
>
> 0.305
>
> -1.187
> 2
>
> 1
>
> 1.99
>
> 1
>
> 59
>
> 0
>
> 0
>
> 0
>
> 120
>
> 117.61
>
> 3250
>
> 0
>
> 0.042
>
> -3.17
> 2
>
> 1
>
> 1.99
>
> 1
>
> 59
>
> 0
>
> 0
>
> 0
>
> 120.05
>
> 117.61
>
> 3250
>
> 0
>
> 0.026
>
> -3.65
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
> 48
>
> 1
>
> 1.58
>
> 0
>
> 67
>
> 3160
>
> 1
>
> -1
>
> 0
>
> 23
>
> 2000
>
> 1
>
> 0
>
> 0
> 48
>
> 1
>
> 1.58
>
> 0
>
> 67
>
> 3160
>
> 1
>
> 137.39
>
> 0
>
> 23
>
> 2000
>
> 1
>
> 0
>
> 0
> 48
>
> 1
>
> 1.58
>
> 0
>
> 67
>
> 0
>
> 0
>
> 0
>
> 14
>
> 23
>
> 2000
>
> 1
>
> 0.494
>
> -0.705
> 48
>
> 1
>
> 1.55
>
> 0
>
> 67
>
> 3100
>
> 4
>
> -1
>
> 0
>
> 23
>
> 2000
>
> 1
>
> 0
>
> 0
> 48
>
> 1
>
> 1.55
>
> 0
>
> 67
>
> 3100
>
> 4
>
> 134.78
>
> 0
>
> 23
>
> 2000
>
> 1
>
> 0
>
> 0
> 48
>
> 1
>
> 1.55
>
> 0
>
> 67
>
> 0
>
> 0
>
> 0
>
> 12
>
> 23
>
> 2000
>
> 1
>
> 0.653
>
> -0.426
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> *Control stream:*
> $PROBLEM POP-PK ANTICANCER AGENT
> $DATA MODELING.csv
> $INPUT ID CYC BSA SEXAGE AMT EVIDRATE TIME DUR DOS STUD DV LNDV=DROP
> ; IF SEX=0 (FEMALE), 1 (MALE)
> ; UNIT IN USED
> ;BSA=M2
> ;AGE=YEAR
> ;AMT=MG
> ;RATE = MG / H
> ;DUR = H
> ;TIME = H
> ;VOLUME = L
> ;CONC = MG/L
> $SUBROUTINES ADVAN6TOL=7
> $MODELNCOMP = 1
> COMP= CENTRAL
> $PK
> MTIME(1) = THETA(1)
> XRA1= (AMT/DUR)*EXP(ETA(1))
> XRA2= XRA1+THETA(2)*EXP(ETA(2))
> RA1= XRA1*(1-MPAST(1))+XRA2*MPAST(1)
> IF(DUR.GT.25) RA1=0
>
> ;ASSUMED THAT INFUSION RATE CHANGES FROM TH_1 TILL THE END OF INFUSION, FOR CVI 24 HOURS
>
> MTIME(2) = THETA(3)
> XRB1= AMT/DUR*EXP(ETA(3))
> XRB2= XRB1+THETA(4)*EXP(ETA(4))
> RB1= XRB1*(MPAST(1)-MPAST(2))+XRB2*MPAST(2)
> IF(DUR.LT.25.OR.DUR.GT.48) RB1=0
>
> ;ASSUMED THAT INFUSION RATE CHANGES FROM TH_3 TILL THE END OF INFUSION, FOR CVI 46 HOURS
>
> MTIME(3) = THETA(5)
> XRC1= AMT/DUR*EXP(ETA(5))
> XRC2= XRB1+THETA(6)*EXP(ETA(6))
> RC1= XRC1*(MPAST(2)-MPAST(3))+XRB2*MPAST(3)
> IF(DUR.LT.48.OR.DUR.GT.98) RC1=0
>
> ;ASSUMED THAT INFUSION RATE CHANGES FROM TH_5TILL THE END OF INFUSION, FOR CVI 96 HOURS
>
> MTIME(4) = THETA(7)
> XRD1= AMT/DUR*EXP(ETA(7))
> XRD2= XRD1+THETA(8)*EXP(ETA(8))
> RD1= XRD1*(MPAST(3)-MPAST(4))+XRD2*MPAST(4)
> IF(DUR.LT.98) RD1=0
>
> ;ASSUMED THAT INFUSION RATE CHANGES FROM TH_7 TILL THE END OF INFUSION, FOR CVI > 96 HOURS
>
> R1 = RA1 + RB1 + RC1 + RD1
> ;TYPICAL VALUES
> TVCL = THETA(9); TH_CL
> TVV= THETA(10); TH_V
> ;STATISTIC MODEL
> CL= TVCL*EXP(ETA(9))
> V= TVV*EXP(ETA(10))
> S1= V
> K= CL/V
> THL= 0.693/K
> $DES
> DADT(1) = R1 - K*A(1)
> $ERROR
> IPRE = F
> IRES = DV-IPRE
> W= SQRT(IPRE**2*THETA(11)**2+THETA(12)**2);COMB PROP + ADD RES ERROR
> Y= IPRE+W*ERR(1)
> DEL= 0.01
> IF(W.EQ.0) DEL = 1
> IWRE = IRES/(W+DEL)
> $THETA
> 21.6; 1 TH_CHANGE POINT FOR RATE WITH DUR 24 HOURS
> 0.1; 2 TH_DIFF IN RATE FOR DUR 24 HOURS, 10% FASTER
> 41.4; 3 TH_CHANGE POINT FOR RATE WITH DUR 46 HOURS
> 0.1; 4 TH_DIFF IN RATE FOR DUR 46 HOURS, 10% FASTER
> 86.4; 5 TH_CHANGE POINT FOR RATE WITH DUR 96 HOURS
> 0.1; 6 TH_DIFF IN RATE FOR DUR 96 HOURS, 10% FASTER
> 108; 7 TH_CHANGE POINT FOR RATE WITH DUR 120 HOURS
> 0.1; 8 TH_DIFF IN RATE FOR DUR 120 HOURS, 10% FASTER
> 272; 9 TH_CL,
> 38.4; 10 TH_V,
> 0.421; 11 TH_PROP RES ERROR
> 0.0252; 12 TH_ADD RES ERROR
> $OMEGA
> 0.01; 1 OM_VAR IN RATE BETWEEN 0~TH_1, FOR DUR 24 HOURS
> 0.01; 2 OM_VAR IN RATE BERWEEN TH_1~THE END OF INFUSION, FOR DUR 24 HOURS
> 0.01; 3 OM_VAR IN RATE BETWEEN 0~TH_3, FOR DUR 48 HOURS
> 0.01; 4 OM_VAR IN RATE BERWEEN TH_3~THE END OF INFUSION, FOR DUR 48 HOURS
> 0.01; 5 OM_VAR IN RATE BETWEEN 0~TH_5, FOR DUR 96 HOURS
> 0.01; 6 OM_VAR IN RATE BERWEEN TH_5~THE END OF INFUSION, FOR DUR 96 HOURS
> 0.01; 7 OM_VAR IN RATE BETWEEN 0~TH_7, FOR DUR 120 HOURS
> 0.01; 8 OM_VAR IN RATE BERWEEN TH_7~THE END OF INFUSION, FOR DUR 120 HOURS
> 0.169; 9 OM_CL / VARIANCE IN CL
> 0.347; 10 OM_V / VARIANCE IN V
> $SIGMA1 FIX
> $ESTIMATION SIG=5 METHOD=1 INTER MAXEVAL=9999 PRINT=1NOABORT
> $COVMATRIX = S
> $TABLE ID IPRE IWRE NPDE CWRES EVID IRES TIME ONEHEADER NOPRINT FILE=SDTAB
>
> $TABLE ID CL V ETA1 ETA2 ETA3 ETA4 ETA5 ETA6 ETA7 ETA8 ETA9 ETA10 NOAPPEND ONEHEADER NOPRINT FILE=PATAB
>
> $TABLE ID BSA AGE DUR DOS NOAPPEND ONEHEADER NOPRINT FILE=COTAB
> $TABLE ID SEX CYC STUD NOPRINT NOAPPEND ONEHEADER FILE=CATAB
>
> *From:* Nick Holford <[email protected]>
> *To:* nmusers <[email protected]>
> *Sent:* Friday, August 19, 2011 11:51 AM
> *Subject:* Re: [NMusers] flexible infusion rate model
>
> Tomi,
>
> In order to help you it would be useful to have more details of your problem.
>
> It is simple to include different infusion rates for each patient by specifying the AMT and RATE in the data file.
>
> If you really observed that the infusion rate changed ("I observed inconsistent infusion rates (especially at the end of infusion)" then you should code the changed RATEs with the start TIME and AMT infused.
>
> If you mean that you know that the clinical staff played around with the infusion without really keeping any good records then it is more difficult to describe what happened. In this case you can try coding RATE with -2 in the data set and then specify the duration in $PK as D1 and add a random effect e.g.
>
> D1=DUR*EXP(ETA(x))
>
> where DUR is the nominal infusion duration (a data item in the data set) for that patient and ETA(x) is a random effect describing the inability of the clinical staff to do their job.
>
> What do you mean by 'flexible infusion rates' in this context? If you give us details of your code and a sample of the data then it might be possible to help you.
>
> Nick
>
> On 19/08/2011 8:57 p.m., tomi hendrayana wrote:
> > Dear all,
>
> > Here comes a beginner modeler, who wants to share the problem with experts in the Group and looking for good solutions ;-) > I try to model Pop-PK anticancer drug which was delivered by continuous venous infusion with several types of duration time such as 24 hours, 46 hours, 96 hours or 120 hours. Data came from four different studies; some patients were observed on more than 1 cycle; and sampling varied from 1 point/patient to 20 points/patient. Since I observed inconsistent infusion rates (especially at the end of infusion), which might be a potential factor for variability in PK parameter, then i try to include flexible infusion rates into the model. I made a control code but unfortunately NONMEM stopped running and had an error message:
>
> > #METH: First Order Conditional Estimation with Interaction
> > MONITORING OF SEARCH:
> > 0PRED EXIT CODE = 1
>
> > 0INDIVIDUAL NO. 1 ID= 1.00000000000000E+00 (WITHIN-INDIVIDUAL) DATA REC NO. 3
>
> > THETA=
>
> > 1.00E-01 1.00E-01 1.00E-01 1.00E-01 1.00E-01 1.00E-01 1.00E-01 1.00E-01 2.72E+02 3.84E+01
>
> > 4.21E-01 2.52E-02
> > OCCURS DURING SEARCHFOR ETA AT INITIAL VALUE, ETA=0
> > PK PARAMETER FOR RATE IS NON-POSITIVE
> > 0PROGRAM TERMINATED BY OBJ
> > MESSAGE ISSUED FROM ESTIMATION STEP
> > AT INITIAL OBJ. FUNCTION EVALUATION
> > Elapsed estimation time in seconds: 0.28
> > #TERM:
> > #TERE:
> > 1THERE ARE ERROR MESSAGES IN FILE PRDERR
>
> > Hereby i sent you a part of structure data set and my control stream (see attachment). > Could anyone point it out for me what could be a problem and how to handle this? Thanks in advance.
>
> > yours,
> > -Tomi
> > PhD Student
> > Uni Bonn
>
> -- Nick Holford, Professor Clinical Pharmacology
> Dept Pharmacology& Clinical Pharmacology
> University of Auckland,85 Park Rd,Private Bag 92019,Auckland,New Zealand
> tel:+64(9)923-6730 fax:+64(9)373-7090 mobile:+64(21)46 23 53
> email: [email protected] <mailto:[email protected]>
> http://www.fmhs.auckland.ac.nz/sms/pharmacology/holford
--
Nick Holford, Professor Clinical Pharmacology
Dept Pharmacology& Clinical Pharmacology
University of Auckland,85 Park Rd,Private Bag 92019,Auckland,New Zealand
tel:+64(9)923-6730 fax:+64(9)373-7090 mobile:+64(21)46 23 53
email: [email protected]
http://www.fmhs.auckland.ac.nz/sms/pharmacology/holford