RE: Generating Cmax at end of infusion
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
________________________________