Title: Paul R
G'day.
I would like to generate a concentration at the end of an infusion of
duration DUR.
I am using ADVAN3 TRANS4 with log transformed data. Here is what I
have tried, but I am getting an error that the parameter 'T' that I
understood to be the machine time is undefined. Can anyone suggest a
proper way to give set Cmax=exp(Y) at the end of the infusion of length
DUR?
Many thanks in advance.
Paul
$PK
...
TT=TIME
$ERROR
;I've also tried
;TT=TIME
;TT=T
IPRE=F
EDV=EXP(DV)
W=1
IF(F.GT.0) W=F
IRES=F-EDV
IWRE=IRES/W
LOGF=LOG(0.0001)
IF (F.GT.0) LOGF=LOG(F)
Y=LOGF+EPS(1)
;GENERATE CMAX AT END OF INFUSION (DUR)
IF(DUR.EQ.TT) CMAX=EXP(Y)
--
Paul R.
Hutson, Pharm.D.
Associate
Professor
UW School
of Pharmacy
777
Highland Avenue
Madison
WI 53705-2222
Tel 608.263.2496
Fax
608.265.5421
Pager
608.265.7000, p7856
Generating Cmax at end of infusion
9 messages
7 people
Latest: Apr 07, 2010
Hi Paul,
You cannot use T in ADVAN3. ADVAN3 uses the exact solution to advance between TIME points. If you include the end of infusion as EVID=2 time point, you can get it there. Otherwise, I am not sure how to get hold on the solution at that specific time. It could be possible, because the end-of infusion should be (at least internally) the point to which the system is advanced, but I do not know how to get data at that (internal) point.
An easier way would be to rewrite the system in differential equations (ADVAN6). Then you can get the solution at any time point T (in he $DES block) but you will have to output it on the next TIME point.
Hope this helps
Leonid
--------------------------------------
Leonid Gibiansky, Ph.D.
President, QuantPharm LLC
web: www.quantpharm.com
e-mail: LGibiansky at quantpharm.com
tel: (301) 767 5566
Paul Hutson wrote:
> G'day.
>
> I would like to generate a concentration at the end of an infusion of duration DUR. I am using ADVAN3 TRANS4 with log transformed data. Here is what I have tried, but I am getting an error that the parameter 'T' that I understood to be the machine time is undefined. Can anyone suggest a proper way to give set Cmax=exp(Y) at the end of the infusion of length DUR?
>
> Many thanks in advance.
> Paul
> $PK
> ...
> TT=TIME
>
> $ERROR
> ;I've also tried
> ;TT=TIME
> ;TT=T
> IPRE=F
> EDV=EXP(DV)
> W=1
> IF(F.GT.0) W=F
> IRES=F-EDV
> IWRE=IRES/W
> LOGF=LOG(0.0001)
> IF (F.GT.0) LOGF=LOG(F)
> Y=LOGF+EPS(1)
> ;GENERATE CMAX AT END OF INFUSION (DUR)
> IF(DUR.EQ.TT) CMAX=EXP(Y)
> --
>
> Paul R. Hutson, Pharm.D.
>
> Associate Professor
>
> UW School of Pharmacy
>
> 777 Highland Avenue
>
> Madison WI 53705-2222
>
> Tel 608.263.2496
>
> Fax 608.265.5421
>
> Pager 608.265.7000, p7856
Hi Paul,
If you have a row in your data file at TIME == DUR, then something like
the following should work (you would need to have DUR on each row for
this; there are other ways to do it that you don't have to have DUR on
each row):
$ERROR
CMAX = 0
IPRE=F
EDV=EXP(DV)
W=1
IF(F.GT.0) W=F
IRES=F-EDV
IWRE=IRES/W
LOGF=LOG(0.0001)
IF (F.GT.0) LOGF=LOG(F)
Y=LOGF+EPS(1)
;GENERATE CMAX AT END OF INFUSION (DUR)
IF(DUR.EQ.TIME) CMAX=EXP(Y)
Thanks,
Bill
Quoted reply history
________________________________
From: [email protected] [mailto:[email protected]]
On Behalf Of Paul Hutson
Sent: Tuesday, April 06, 2010 12:12 PM
To: [email protected]
Subject: [NMusers] Generating Cmax at end of infusion
G'day.
I would like to generate a concentration at the end of an infusion of
duration DUR.
I am using ADVAN3 TRANS4 with log transformed data. Here is what I
have tried, but I am getting an error that the parameter 'T' that I
understood to be the machine time is undefined. Can anyone suggest a
proper way to give set Cmax=exp(Y) at the end of the infusion of length
DUR?
Many thanks in advance.
Paul
$PK
...
TT=TIME
$ERROR
;I've also tried
;TT=TIME
;TT=T
IPRE=F
EDV=EXP(DV)
W=1
IF(F.GT.0) W=F
IRES=F-EDV
IWRE=IRES/W
LOGF=LOG(0.0001)
IF (F.GT.0) LOGF=LOG(F)
Y=LOGF+EPS(1)
;GENERATE CMAX AT END OF INFUSION (DUR)
IF(DUR.EQ.TT) CMAX=EXP(Y)
--
Paul R. Hutson, Pharm.D.
Associate Professor
UW School of Pharmacy
777 Highland Avenue
Madison WI 53705-2222
Tel 608.263.2496
Fax 608.265.5421
Pager 608.265.7000, p7856
Notice: This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New
Jersey, USA 08889), and/or its affiliates Direct contact information for
affiliates is available at http://www.merck.com/contact/contacts.html) that may
be confidential, proprietary copyrighted and/or legally privileged. It is
intended solely for the use of the individual or entity named on this message.
If you are not the intended recipient, and have received this message in error,
please notify us immediately by reply e-mail and then delete it from your
system.
Hi Paul,
Is DUR modeled or explicit? If explicit then it seems as easy approach would be
to include an EVID=2 record at the stated end of infusion and calculate the
anti-log as you and Nick indicate.
Steve
Stephen C. Olson
[email protected]
734 268 6867
www.clinpharmres.com
From: [email protected] [mailto:[email protected]] On
Behalf Of Nick Holford
Sent: Tuesday, April 06, 2010 1:03 PM
Cc: [email protected]
Subject: Re: [NMusers] Generating Cmax at end of infusion
Paul,
TIME is the data record time in $PK and $ERROR.
T is the time between record TIMEs in $DES.
In order to use your method you need to have a record with TIME in your data
set that is equal to DUR.
In that case you can use this code which also sets CMAX to 0 if an individual
does not have DUR.EQ.TIME. If you don't do this then you will get the CMAX from
the last individual who did have DUR.EQ.TIME.
IF (DUR.EQ.TIME) THEN
CMAX=EXP(Y)
ELSE
CMAX=0
ENDIF
Paul Hutson wrote:
G'day.
I would like to generate a concentration at the end of an infusion of duration
DUR.
I am using ADVAN3 TRANS4 with log transformed data. Here is what I have
tried, but I am getting an error that the parameter 'T' that I understood to be
the machine time is undefined. Can anyone suggest a proper way to give set
Cmax=exp(Y) at the end of the infusion of length DUR?
Many thanks in advance.
Paul
$PK
...
TT=TIME
$ERROR
;I've also tried
;TT=TIME
;TT=T
IPRE=F
EDV=EXP(DV)
W=1
IF(F.GT.0) W=F
IRES=F-EDV
IWRE=IRES/W
LOGF=LOG(0.0001)
IF (F.GT.0) LOGF=LOG(F)
Y=LOGF+EPS(1)
;GENERATE CMAX AT END OF INFUSION (DUR)
IF(DUR.EQ.TT) CMAX=EXP(Y)
--
Paul R. Hutson, Pharm.D.
Associate Professor
UW School of Pharmacy
777 Highland Avenue
Madison WI 53705-2222
Tel 608.263.2496
Fax 608.265.5421
Pager 608.265.7000, p7856
--
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
Paul,
TIME is the data record time in $PK and $ERROR.
T is the time between record TIMEs in $DES.
In order to use your method you need to have a record with TIME in your data set that is equal to DUR.
In that case you can use this code which also sets CMAX to 0 if an individual does not have DUR.EQ.TIME. If you don't do this then you will get the CMAX from the last individual who did have DUR.EQ.TIME.
IF (DUR.EQ.TIME) THEN
CMAX=EXP(Y)
ELSE
CMAX=0
ENDIF
Paul Hutson wrote:
> G'day.
>
> I would like to generate a concentration at the end of an infusion of duration DUR. I am using ADVAN3 TRANS4 with log transformed data. Here is what I have tried, but I am getting an error that the parameter 'T' that I understood to be the machine time is undefined. Can anyone suggest a proper way to give set Cmax=exp(Y) at the end of the infusion of length DUR?
>
> Many thanks in advance.
> Paul
> $PK
> ...
> TT=TIME
>
> $ERROR
> ;I've also tried
> ;TT=TIME
> ;TT=T
> IPRE=F
> EDV=EXP(DV)
> W=1
> IF(F.GT.0) W=F
> IRES=F-EDV
> IWRE=IRES/W
> LOGF=LOG(0.0001)
> IF (F.GT.0) LOGF=LOG(F)
> Y=LOGF+EPS(1)
> ;GENERATE CMAX AT END OF INFUSION (DUR)
> IF(DUR.EQ.TT) CMAX=EXP(Y)
> --
>
> Paul R. Hutson, Pharm.D.
>
> Associate Professor
>
> UW School of Pharmacy
>
> 777 Highland Avenue
>
> Madison WI 53705-2222
>
> Tel 608.263.2496
>
> Fax 608.265.5421
>
> Pager 608.265.7000, p7856
--
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
Hi,
As others have suggested making an additional record at the known desired time
is probably the most straightforward manner to get what you want. So this
should probably be a preferred solution.
If you for some reason you cant to add a record (maybe you dont know the time
beforehand), I think you can achieve what you want using MTIME(). This has the
added advantage of working without going the $DES route and the associated
slower run-times. I'll see if I can get something like that to work tomorrow,
just as an excercise.
Can the experts give an opinion as to whether MTIME() should work or not?
Regards,
Douglas Eleveld
Quoted reply history
-----Original Message-----
From: [email protected] on behalf of Paul Hutson
Sent: Tue 4/6/2010 6:11 PM
To: [email protected]
Subject: [NMusers] Generating Cmax at end of infusion
G'day.
I would like to generate a concentration at the end of an infusion of duration
DUR.
I am using ADVAN3 TRANS4 with log transformed data. Here is what I have
tried, but I am getting an error that the parameter 'T' that I understood to be
the machine time is undefined. Can anyone suggest a proper way to give set
Cmax=exp(Y) at the end of the infusion of length DUR?
Many thanks in advance.
Paul
$PK
...
TT=TIME
$ERROR
;I've also tried
;TT=TIME
;TT=T
IPRE=F
EDV=EXP(DV)
W=1
IF(F.GT.0) W=F
IRES=F-EDV
IWRE=IRES/W
LOGF=LOG(0.0001)
IF (F.GT.0) LOGF=LOG(F)
Y=LOGF+EPS(1)
;GENERATE CMAX AT END OF INFUSION (DUR)
IF(DUR.EQ.TT) CMAX=EXP(Y)
--
Paul R. Hutson, Pharm.D.
Associate Professor
UW School of Pharmacy
777 Highland Avenue
Madison WI 53705-2222
Tel 608.263.2496
Fax 608.265.5421
Pager 608.265.7000, p7856
Hi Douglas, Paul,
The help on mtime suggests that it should work.
" When the time is reached, indicator variables
are set and a call to PK is made. At this call (and/or subsequent to
this call) PK or DES or AES or ERROR can use the indicator variables
to change some aspect of the system, e.g., a term in a differential
equation, or the rate of an infusion. This feature may be used with
any ADVAN routine. "
The following code (tested with nm6.2.0) however does not work in the $ERROR block, where the model predictions are available. As one can see, CP is only set at the data time event, not at the MTIME. CP2 is not set at all. So it seems $ERROR is not called upon the MTIME event.
An indicator in $PK works properly (tested, not shown).
Can anyone confirm this behavior? If so, this looks like a bug to me.
Best regards,
Jeroen
____model____
$PROB structural model 1comp.rep single subject
$INPUT ID TIME DV AMT EVID TRT
$DATA iv_ss.csv IGN=I
$SUBR ADVAN1 TRANS2
$PK
TVCL=THETA(1)
CL=TVCL
TVV=THETA(2)
V=TVV
S1=V/1000
;mtime piece
MTIME(1)=.075 ; .075 h not in dataset
MTIME(2)=.5 ; .5 h not in dataset
IF(TIME.EQ.0)CP=0
IF(TIME.EQ.0)CP2=0
$ERROR
IPRED=F
Y=F+F*ERR(1)
IF(TIME.EQ.0)MYFLAG=0 ; 0 h IN dataset
IF(MPAST(1).EQ.1.AND.MYFLAG.EQ.0)THEN
CP=F
MYFLAG=1
ENDIF
CP2=CP2+MNEXT(2)*F
$THETA
(0,10)
(0,1)
$OMEGA
.05
$SIM (123456789)
$EST PRINT=1 MAXEVAL90 SIG=3 NOABORT METHOD=0
;$COV PRINT=E
$TABLE ID TIME CP CP2 IPRED
NOPRINT ONEHEADER FILEmp.txt
____dataset___
ID,time h,conc nM,amt,evid,dose mol
1,0,.,30,1,10
1,0.05,0,.,0,10
1,0.166666667,0,.,0,10
1,0.333333333,0,.,0,10
1,0.683,0,.,0,10
1,1,0,.,0,10
1,2,0,.,0,10
1,4,0,.,0,10
1,8,0,.,0,10
____table file_____
TABLE NO. 1
ID TIME CP CP2 IPRE DV
1.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 3.2044E+04 0.0000E+00
1.0000E+00 5.0000E-02 0.0000E+00 0.0000E+00 1.9459E+04 1.6272E+04
1.0000E+00 1.6667E-01 6.0768E+03 0.0000E+00 6.0768E+03 7.7936E+03
1.0000E+00 3.3333E-01 6.0768E+03 0.0000E+00 1.1524E+03 1.0149E+03
1.0000E+00 6.8300E-01 6.0768E+03 0.0000E+00 3.5213E+01 2.8321E+01
1.0000E+00 1.0000E+00 6.0768E+03 0.0000E+00 1.4905E+00 1.5249E+00
1.0000E+00 2.0000E+00 6.0768E+03 0.0000E+00 6.9328E-05 7.8605E-05
1.0000E+00 4.0000E+00 6.0768E+03 0.0000E+00 1.4999E-13 1.5736E-13
1.0000E+00 8.0000E+00 6.0768E+03 0.0000E+00 7.0211E-31 6.9514E-31
Quoted reply history
________________________________
From: owner-nmusers
On Behalf Of Eleveld, DJ
Sent: Tuesday, 06 April, 2010 20:22
To: prhutson
Subject: RE: [NMusers] Generating Cmax at end of infusion
Hi,
As others have suggested making an additional record at the known desired time is probably the most straightforward manner to get what you want. So this should probably be a preferred solution.
If you for some reason you cant to add a record (maybe you dont know the time beforehand), I think you can achieve what you want using MTIME(). This has the added advantage of working without going the $DES route and the associated slower run-times. I'll see if I can get something like that to work tomorrow, just as an excercise.
Can the experts give an opinion as to whether MTIME() should work or not?
Regards,
Douglas Eleveld
-----Original Message-----
From: owner-nmusers
Sent: Tue 4/6/2010 6:11 PM
To: NMUSERS
Subject: [NMusers] Generating Cmax at end of infusion
G'day.
I would like to generate a concentration at the end of an infusion of duration DUR.
I am using ADVAN3 TRANS4 with log transformed data. Here is what I have tried, but I am getting an error that the parameter 'T' that I understood to be the machine time is undefined. Can anyone suggest a proper way to give set Cmax=exp(Y) at the end of the infusion of length DUR?
Many thanks in advance.
Paul
$PK
...
TT=TIME
$ERROR
;I've also tried
;TT=TIME
;TT=T
IPRE=F
EDV=EXP(DV)
W=1
IF(F.GT.0) W=F
IRES=F-EDV
IWRE=IRES/W
LOGF=LOG(0.0001)
IF (F.GT.0) LOGF=LOG(F)
Y=LOGF+EPS(1)
;GENERATE CMAX AT END OF INFUSION (DUR)
IF(DUR.EQ.TT) CMAX=EXP(Y)
--
Paul R. Hutson, Pharm.D.
Associate Professor
UW School of Pharmacy
777 Highland Avenue
Madison WI 53705-2222
Tel 608.263.2496
Fax 608.265.5421
Pager 608.265.7000, p7856
________________________________
Hi Douglas, Paul,
The help on mtime suggests that it should work.
" When the time is reached, indicator variables
are set and a call to PK is made. At this call (and/or subsequent to
this call) PK or DES or AES or ERROR can use the indicator variables
to change some aspect of the system, e.g., a term in a differential
equation, or the rate of an infusion. This feature may be used with
any ADVAN routine. "
The following code (tested with nm6.2.0) however does not work in the $ERROR
block, where the model predictions are available. As one can see, CP is only
set at the data time event, not at the MTIME. CP2 is not set at all. So it
seems $ERROR is not called upon the MTIME event.
An indicator in $PK works properly (tested, not shown).
Can anyone confirm this behavior? If so, this looks like a bug to me.
Best regards,
Jeroen
____model____
$PROB structural model 1comp.rep single subject
$INPUT ID TIME DV AMT EVID TRT
$DATA iv_ss.csv IGN=I
$SUBR ADVAN1 TRANS2
$PK
TVCL=THETA(1)
CL=TVCL
TVV=THETA(2)
V=TVV
S1=V/1000
;mtime piece
MTIME(1)=.075 ; .075 h not in dataset
MTIME(2)=.5 ; .5 h not in dataset
IF(TIME.EQ.0)CP=0
IF(TIME.EQ.0)CP2=0
$ERROR
IPRED=F
Y=F+F*ERR(1)
IF(TIME.EQ.0)MYFLAG=0 ; 0 h IN dataset
IF(MPAST(1).EQ.1.AND.MYFLAG.EQ.0)THEN
CP=F
MYFLAG=1
ENDIF
CP2=CP2+MNEXT(2)*F
$THETA
(0,10)
(0,1)
$OMEGA
.05
$SIM (123456789)
$EST PRINT=1 MAXEVAL=9990 SIG=3 NOABORT METHOD=0
;$COV PRINT=E
$TABLE ID TIME CP CP2 IPRED
NOPRINT ONEHEADER FILE=1cmp.txt
____dataset___
ID,time h,conc nM,amt,evid,dose æmol
1,0,.,30,1,10
1,0.05,0,.,0,10
1,0.166666667,0,.,0,10
1,0.333333333,0,.,0,10
1,0.683,0,.,0,10
1,1,0,.,0,10
1,2,0,.,0,10
1,4,0,.,0,10
1,8,0,.,0,10
____table file_____
TABLE NO. 1
ID TIME CP CP2 IPRE DV
1.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 3.2044E+04 0.0000E+00
1.0000E+00 5.0000E-02 0.0000E+00 0.0000E+00 1.9459E+04 1.6272E+04
1.0000E+00 1.6667E-01 6.0768E+03 0.0000E+00 6.0768E+03 7.7936E+03
1.0000E+00 3.3333E-01 6.0768E+03 0.0000E+00 1.1524E+03 1.0149E+03
1.0000E+00 6.8300E-01 6.0768E+03 0.0000E+00 3.5213E+01 2.8321E+01
1.0000E+00 1.0000E+00 6.0768E+03 0.0000E+00 1.4905E+00 1.5249E+00
1.0000E+00 2.0000E+00 6.0768E+03 0.0000E+00 6.9328E-05 7.8605E-05
1.0000E+00 4.0000E+00 6.0768E+03 0.0000E+00 1.4999E-13 1.5736E-13
1.0000E+00 8.0000E+00 6.0768E+03 0.0000E+00 7.0211E-31 6.9514E-31
Quoted reply history
________________________________
From: [email protected] [mailto:[email protected]] On
Behalf Of Eleveld, DJ
Sent: Tuesday, 06 April, 2010 20:22
To: [email protected]; [email protected]
Subject: RE: [NMusers] Generating Cmax at end of infusion
Hi,
As others have suggested making an additional record at the known desired time
is probably the most straightforward manner to get what you want. So this
should probably be a preferred solution.
If you for some reason you cant to add a record (maybe you dont know the time
beforehand), I think you can achieve what you want using MTIME(). This has the
added advantage of working without going the $DES route and the associated
slower run-times. I'll see if I can get something like that to work tomorrow,
just as an excercise.
Can the experts give an opinion as to whether MTIME() should work or not?
Regards,
Douglas Eleveld
-----Original Message-----
From: [email protected] on behalf of Paul Hutson
Sent: Tue 4/6/2010 6:11 PM
To: [email protected]
Subject: [NMusers] Generating Cmax at end of infusion
G'day.
I would like to generate a concentration at the end of an infusion of duration
DUR.
I am using ADVAN3 TRANS4 with log transformed data. Here is what I have
tried, but I am getting an error that the parameter 'T' that I understood to be
the machine time is undefined. Can anyone suggest a proper way to give set
Cmax=exp(Y) at the end of the infusion of length DUR?
Many thanks in advance.
Paul
$PK
...
TT=TIME
$ERROR
;I've also tried
;TT=TIME
;TT=T
IPRE=F
EDV=EXP(DV)
W=1
IF(F.GT.0) W=F
IRES=F-EDV
IWRE=IRES/W
LOGF=LOG(0.0001)
IF (F.GT.0) LOGF=LOG(F)
Y=LOGF+EPS(1)
;GENERATE CMAX AT END OF INFUSION (DUR)
IF(DUR.EQ.TT) CMAX=EXP(Y)
--
Paul R. Hutson, Pharm.D.
Associate Professor
UW School of Pharmacy
777 Highland Avenue
Madison WI 53705-2222
Tel 608.263.2496
Fax 608.265.5421
Pager 608.265.7000, p7856
________________________________
Hi Jeroen,
The part of the manual that you described did not mention that the call to ERROR is done. And indeed, you can use MTIME in any subsequent calls to ERROR (that are made at event times). So I do not think this is a bug.
Since call to PK is done, you can try to get A() value in the PK block, something like
$PK
...
C=A(*)/V1
IF(C.GE.CMAX) THEN
TMAX=TSTATE
CMAX=C
ENDIF
...
If the end-of-infusion concentration is CMAX, this code may get it out (and TMAX should point to the end-of-infusion; both of them should be taken from the first event record following the end-of-infusion) but I have not tried it.
-----------
Here is the part of the manual that discussed use of A(*) in the PK block:
A(n) TSTATE
A(n) are the latest computed compartment amounts, and TSTATE is the
time at which they were computed. That is, A(n) are the amounts at
the previous event time, or if at a later time, but before the time
for which PK is being called, a lagged or additional dose was given,
or a regular infusion was terminated, or a modeled event occurred,
then A(n) are the amounts at the latest such time. If there are
population etas, and A(n) are used in the $PK abbreviated code, then
any $OMEGA records referring to etas explicitly used in this code
should precede the $PK record, or if an $MSFI record is used, it
should precede the $PK record and include the option NPOP=m.
-------------------
Could someone explain why
"If there are
population etas, and A(n) are used in the $PK abbreviated code, then
any $OMEGA records referring to etas explicitly used in this code
should precede the $PK record"
Thanks
Leonid
--------------------------------------
Leonid Gibiansky, Ph.D.
President, QuantPharm LLC
web: www.quantpharm.com
e-mail: LGibiansky at quantpharm.com
tel: (301) 767 5566
Elassaiss - Schaap, J. (Jeroen) wrote:
> Hi Douglas, Paul,
>
> The help on mtime suggests that it should work.
>
> " When the time is reached, indicator variables
> are set and a call to PK is made. At this call (and/or subsequent to
> this call) PK or DES or AES or ERROR can use the indicator variables
> to change some aspect of the system, e.g., a term in a differential
> equation, or the rate of an infusion. This feature may be used with
> any ADVAN routine. "
>
> The following code (tested with nm6.2.0) however does not work in the $ERROR block, where the model predictions are available. As one can see, CP is only set at the data time event, not at the MTIME. CP2 is not set at all. So it seems $ERROR is not called upon the MTIME event. An indicator in $PK works properly (tested, not shown). Can anyone confirm this behavior? If so, this looks like a bug to me. Best regards,
>
> Jeroen
>
> ____model____
>
> $PROB structural model 1comp.rep single subject
> $INPUT ID TIME DV AMT EVID TRT
> $DATA iv_ss.csv IGN=I
> $SUBR ADVAN1 TRANS2
>
> $PK
>
> TVCL=THETA(1)
> CL=TVCL
> TVV=THETA(2)
> V=TVV
>
> S1=V/1000 ;mtime piece
>
> MTIME(1)=.075 ; .075 h not in dataset
> MTIME(2)=.5 ; .5 h not in dataset
> IF(TIME.EQ.0)CP=0
> IF(TIME.EQ.0)CP2=0
>
> $ERROR
>
> IPRED=F
> Y=F+F*ERR(1)
> IF(TIME.EQ.0)MYFLAG=0 ; 0 h IN dataset
> IF(MPAST(1).EQ.1.AND.MYFLAG.EQ.0)THEN
> CP=F
> MYFLAG=1
> ENDIF
>
> CP2=CP2+MNEXT(2)*F $THETA
>
> (0,10)
> (0,1)
>
> $OMEGA
>
> .05
>
> $SIM (123456789)
>
> $EST PRINT=1 MAXEVAL=9990 SIG=3 NOABORT METHOD=0
> ;$COV PRINT=E
> $TABLE ID TIME CP CP2 IPRED
> NOPRINT ONEHEADER FILE=1cmp.txt
>
> ____dataset___
>
> ID,time h,conc nM,amt,evid,dose æmol
> 1,0,.,30,1,10
> 1,0.05,0,.,0,10
> 1,0.166666667,0,.,0,10
> 1,0.333333333,0,.,0,10
> 1,0.683,0,.,0,10
> 1,1,0,.,0,10
> 1,2,0,.,0,10
> 1,4,0,.,0,10
> 1,8,0,.,0,10
> ____table file_____
>
> TABLE NO. 1 ID TIME CP CP2 IPRE DV 1.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 3.2044E+04 0.0000E+00 1.0000E+00 5.0000E-02 0.0000E+00 0.0000E+00 1.9459E+04 1.6272E+04 1.0000E+00 1.6667E-01 6.0768E+03 0.0000E+00 6.0768E+03 7.7936E+03 1.0000E+00 3.3333E-01 6.0768E+03 0.0000E+00 1.1524E+03 1.0149E+03 1.0000E+00 6.8300E-01 6.0768E+03 0.0000E+00 3.5213E+01 2.8321E+01 1.0000E+00 1.0000E+00 6.0768E+03 0.0000E+00 1.4905E+00 1.5249E+00 1.0000E+00 2.0000E+00 6.0768E+03 0.0000E+00 6.9328E-05 7.8605E-05 1.0000E+00 4.0000E+00 6.0768E+03 0.0000E+00 1.4999E-13 1.5736E-13 1.0000E+00 8.0000E+00 6.0768E+03 0.0000E+00 7.0211E-31 6.9514E-31
>
> ------------------------------------------------------------------------
>
> *From:* [email protected] [ mailto: [email protected] ] *On Behalf Of *Eleveld, DJ
>
> *Sent:* Tuesday, 06 April, 2010 20:22
> *To:* [email protected]; [email protected]
> *Subject:* RE: [NMusers] Generating Cmax at end of infusion
>
> Hi,
>
> As others have suggested making an additional record at the known desired time is probably the most straightforward manner to get what you want. So this should probably be a preferred solution.
>
> If you for some reason you cant to add a record (maybe you dont know the time beforehand), I think you can achieve what you want using MTIME(). This has the added advantage of working without going the $DES route and the associated slower run-times. I'll see if I can get something like that to work tomorrow, just as an excercise. Can the experts give an opinion as to whether MTIME() should work or not?
>
> Regards,
>
> Douglas Eleveld
>
Quoted reply history
> -----Original Message-----
> From: [email protected] on behalf of Paul Hutson
> Sent: Tue 4/6/2010 6:11 PM
> To: [email protected]
> Subject: [NMusers] Generating Cmax at end of infusion
>
> G'day.
>
> I would like to generate a concentration at the end of an infusion of duration DUR. I am using ADVAN3 TRANS4 with log transformed data. Here is what I have tried, but I am getting an error that the parameter 'T' that I understood to be the machine time is undefined. Can anyone suggest a proper way to give set Cmax=exp(Y) at the end of the infusion of length DUR?
>
> Many thanks in advance.
> Paul
> $PK
> ...
> TT=TIME
>
> $ERROR
> ;I've also tried
> ;TT=TIME
> ;TT=T
> IPRE=F
> EDV=EXP(DV)
> W=1
> IF(F.GT.0) W=F
> IRES=F-EDV
> IWRE=IRES/W
> LOGF=LOG(0.0001)
> IF (F.GT.0) LOGF=LOG(F)
> Y=LOGF+EPS(1)
> ;GENERATE CMAX AT END OF INFUSION (DUR)
> IF(DUR.EQ.TT) CMAX=EXP(Y)
>
> --
>
> Paul R. Hutson, Pharm.D.
>
> Associate Professor
>
> UW School of Pharmacy
>
> 777 Highland Avenue
>
> Madison WI 53705-2222
>
> Tel 608.263.2496
>
> Fax 608.265.5421
>
> Pager 608.265.7000, p7856
>
> ------------------------------------------------------------------------
>
>