Re: help on problem with baseline estimation

From: Nick Holford Date: October 18, 2011 technical Source: mail-archive.com
Pete, I haven't got to grips with all of your code but I think the problem may lie here: IF (TIME .EQ. 0 .AND. CMT .EQ. 3 .AND. EVID .EQ. 0) BASE2 = Y IF (TIME .LT. 24) DELTA = 0 IF (TIME .EQ. 24) DELTA = Y - BASE2 You are relying on computing values of BASE2 and DELTA in one record and retaining those value for a subsequent record. Because BASE2 and DELTA involve random variables (i.e. variables associated with ETAs) the value of BASE 2 and DELTA is set to zero for each new record unless you explicitly assign it with every record with this trick. IF (NEWIND.LE.1) THEN ; this is 'safer' than NEWIND.EQ.1 because it explicitly assigns BASE2 andd DELTA for the first record for the data set. NEWIND is 0 for the first record of the first subject. BASE2=0 DELTA=0 ENDIF IF (TIME .EQ. 0 .AND. CMT .EQ. 3 .AND. EVID .EQ. 0) THEN BASE2 = Y ELSE BASE2=BASE2 ENDIF IF (TIME .EQ. 24) THEN DELTA = Y - BASE2 ELSE DELTA=DELTA ENDIF Best wishes, Nick
Quoted reply history
On 19/10/2011 8:31 a.m., Bonate, Peter wrote: > I am really struggling with something. I am trying to do an adaptive dosing problem. I have a PKPD model with 2-compartment IV pharmacokinetic model (compartment 1 and 2) and an indirect response model for Compartment 3. What I need is a way to get the observed baseline 24 h after dosing and then make a dosing recommendation based on the observed value. > > I thought this would work > > $INPUT ID AGE WGT GEN CLO V1O QO V2O EVID MDV CMT TIME AMT RATE NSIM GRP DV TRT > > $SUB ADVAN8 TOL=5 > > $MODEL COMP= (CENTRAL) COMP= (PER) COMP= (RESPONSE, DEFOBS) > > $PK ;PD parameters (IDR model, Elimination-Inhibition) > > CALLFL= -1 > > IF (NEWIND .EQ. 1) DELTA=0 > > CL= CLO > > V1= V1O > > Q= QO > > V2= V2O > > K= CL/V1 > > K12= Q/V1 > > K21= Q/V2 > > PLA= -THETA(3)*EXP(ETA(3))*TIME > > KIN= THETA(1) > > BASE= THETA(4)+ETA(2) > > KOUT= KIN/BASE > > IMAX= 1 > > IC50= THETA(2)*EXP(ETA(1)) > > A_0(3)= BASE > > F1 = 0 > > IF (CMT .EQ. 1 .AND. EVID .EQ. 1) F1 = 1 > > IF (CMT .EQ. 1 .AND. EVID .EQ. 1 .AND. TIME .EQ. 24 .AND. DELTA .LE. 4) F1 = 1 > > IF (CMT .EQ. 1 .AND. EVID .EQ. 1 .AND. TIME .EQ. 36 .AND. DELTA .LE. 4) F1 = 1 > > IF (CMT .EQ. 1 .AND. EVID .EQ. 1 .AND. TIME .EQ. 24 .AND. DELTA .GT. 4 .AND. DELTA .LE. 8) F1 = 1 > > IF (CMT .EQ. 1 .AND. EVID .EQ. 1 .AND. TIME .EQ. 36 .AND. DELTA .GT. 4 .AND. DELTA .LE. 8) F1 = 0 > > IF (CMT .EQ. 1 .AND. EVID .EQ. 1 .AND. TIME .EQ. 24 .AND. DELTA .GE. 8) F1 = 0 > > IF (CMT .EQ. 1 .AND. EVID .EQ. 1 .AND. TIME .EQ. 36 .AND. DELTA .GE. 8) F1 = 0 > > $DES > > DADT(1)=-K12*A(1) +K21*A(2) -K*A(1) > > DADT(2)= K12*A(1) -K21*A(2) > > DADT(3)= KIN+PLA -KOUT*A(3)*(1-IMAX*(A(1)/V1)/(IC50+(A(1)/V1))) > > $ERROR > > IPRE= F > > Y= F + EPS(1) > > IF (TIME .EQ. 0 .AND. CMT .EQ. 3 .AND. EVID .EQ. 0) BASE2 = Y > > IF (TIME .LT. 24) DELTA = 0 > > IF (TIME .EQ. 24) DELTA = Y - BASE2 > > My thought was that I could use F1 to turn on and off a dose. > > But this did not work. What I need is for BASE2 to be retained in subsequent records so that it can be used to calculate DELTA. > > Here are the first couple of observations for Patient 10001 > > TABLE NO. 1 > > ID EVID MDV CMT TIME IPRE DV BASE2 DELTA BASE AMT F1 NSIM > > 1.0001E+04 1.0000E+00 1.0000E+00 1.0000E+00 0.0000E+00 1.1433E+02 0.0000E+00 0.0000E+00 0.0000E+00 1.1433E+02 2.7150E+00 1.0000E+00 0.0000E+00 > > 1.0001E+04 1.0000E+00 1.0000E+00 3.0000E+00 0.0000E+00 1.1533E+02 0.0000E+00 0.0000E+00 0.0000E+00 1.1433E+02 1.0000E+00 0.0000E+00 0.0000E+00 > > 1.0001E+04 0.0000E+00 0.0000E+00 3.0000E+00 0.0000E+00 1.1533E+02 1.1769E+02 1.1769E+02 0.0000E+00 1.1433E+02 0.0000E+00 0.0000E+00 0.0000E+00 > > 1.0001E+04 0.0000E+00 0.0000E+00 3.0000E+00 5.0000E-01 1.1546E+02 1.1359E+02 0.0000E+00 0.0000E+00 1.1433E+02 0.0000E+00 0.0000E+00 0.0000E+00 > > 1.0001E+04 0.0000E+00 0.0000E+00 3.0000E+00 1.0000E+00 1.1567E+02 1.1713E+02 0.0000E+00 0.0000E+00 1.1433E+02 0.0000E+00 0.0000E+00 0.0000E+00 > > 1.0001E+04 0.0000E+00 0.0000E+00 3.0000E+00 2.0000E+00 1.1593E+02 1.1454E+02 0.0000E+00 0.0000E+00 1.1433E+02 0.0000E+00 0.0000E+00 0.0000E+00 > > 1.0001E+04 0.0000E+00 0.0000E+00 3.0000E+00 4.0000E+00 1.1616E+02 1.1740E+02 0.0000E+00 0.0000E+00 1.1433E+02 0.0000E+00 0.0000E+00 0.0000E+00 > > 1.0001E+04 0.0000E+00 0.0000E+00 3.0000E+00 6.0000E+00 1.1628E+02 1.1775E+02 0.0000E+00 0.0000E+00 1.1433E+02 0.0000E+00 0.0000E+00 0.0000E+00 > > 1.0001E+04 0.0000E+00 0.0000E+00 3.0000E+00 1.2000E+01 1.1640E+02 1.1497E+02 0.0000E+00 0.0000E+00 1.1433E+02 0.0000E+00 0.0000E+00 0.0000E+00 > > 1.0001E+04 0.0000E+00 0.0000E+00 3.0000E+00 2.3900E+01 1.1611E+02 1.2103E+02 0.0000E+00 0.0000E+00 1.1433E+02 0.0000E+00 0.0000E+00 0.0000E+00 > > 1.0001E+04 1.0000E+00 1.0000E+00 1.0000E+00 2.4000E+01 1.1610E+02 0.0000E+00 0.0000E+00 1.1656E+02 1.1433E+02 2.7150E+00 1.0000E+00 0.0000E+00 > > 1.0001E+04 0.0000E+00 0.0000E+00 3.0000E+00 2.4500E+01 1.1623E+02 1.1715E+02 0.0000E+00 1.1656E+02 1.1433E+02 0.0000E+00 0.0000E+00 0.0000E+00 > > 1.0001E+04 0.0000E+00 0.0000E+00 3.0000E+00 2.8000E+01 1.1688E+02 1.1774E+02 0.0000E+00 1.1656E+02 1.1433E+02 0.0000E+00 0.0000E+00 0.0000E+00 > > 1.0001E+04 0.0000E+00 0.0000E+00 3.0000E+00 3.6000E+01 1.1697E+02 1.1702E+02 0.0000E+00 1.1656E+02 1.1433E+02 0.0000E+00 0.0000E+00 0.0000E+00 > > 1.0001E+04 1.0000E+00 1.0000E+00 1.0000E+00 3.6000E+01 1.1697E+02 0.0000E+00 0.0000E+00 1.1656E+02 1.1433E+02 2.7150E+00 0.0000E+00 0.0000E+00 > > 1.0001E+04 0.0000E+00 0.0000E+00 3.0000E+00 3.6500E+01 1.1697E+02 1.1600E+02 0.0000E+00 1.1656E+02 1.1433E+02 0.0000E+00 0.0000E+00 0.0000E+00 > > 1.0001E+04 0.0000E+00 0.0000E+00 3.0000E+00 4.0000E+01 1.1687E+02 1.1249E+02 0.0000E+00 1.1656E+02 1.1433E+02 0.0000E+00 0.0000E+00 0.0000E+00 > > 1.0001E+04 0.0000E+00 0.0000E+00 3.0000E+00 4.8000E+01 1.1645E+02 1.1227E+02 0.0000E+00 1.1656E+02 1.1433E+02 0.0000E+00 0.0000E+00 0.0000E+00 > > 1.0001E+04 0.0000E+00 0.0000E+00 3.0000E+00 6.0000E+01 1.1556E+02 1.1372E+02 0.0000E+00 1.1656E+02 1.1433E+02 0.0000E+00 0.0000E+00 0.0000E+00 > > 1.0001E+04 0.0000E+00 0.0000E+00 3.0000E+00 7.2000E+01 1.1460E+02 1.1265E+02 0.0000E+00 1.1656E+02 1.1433E+02 0.0000E+00 0.0000E+00 0.0000E+00 > > 1.0001E+04 0.0000E+00 0.0000E+00 3.0000E+00 8.4000E+01 1.1367E+02 1.1345E+02 0.0000E+00 1.1656E+02 1.1433E+02 0.0000E+00 0.0000E+00 0.0000E+00 > > 1.0001E+04 0.0000E+00 0.0000E+00 3.0000E+00 9.6000E+01 1.1283E+02 1.1508E+02 0.0000E+00 1.1656E+02 1.1433E+02 0.0000E+00 0.0000E+00 0.0000E+00 > > The baseline is 117.7 but DELTA has values of 116.6. I cannot figure out what NONMEM is doing. > > Can anyone offer any suggestions. Thanks, pete bonate > > Peter L. Bonate, PhD > > Senior Director > > Global Head - Pharmacokinetics, Modeling, and Simulation > > Global Clinical Pharmacology & Exploratory Development > > Astellas Pharma Global Development > > Three Parkway North > > Deerfield, IL 60015 > > phone: (847) 282-5855 > > cell: 224-619-4901 > > email: [email protected] > > "Confidence is what you have before you understand the problem" - Woody Allen > >
Oct 18, 2011 Peter Bonate help on problem with baseline estimation
Oct 18, 2011 Nick Holford Re: help on problem with baseline estimation
Oct 18, 2011 Ron Keizer Re: help on problem with baseline estimation