I think this CMAX - TMAX code can be simplified significantly, see below
$ABB COMRES=2
$PK
.....
IF(NEWIND.LE.1) THEN ; assign negative Cmax Tmax for the new subject
COM(1)=-1 ; holder of Cmax
COM(2)=-1 ; holder of Tmax
ENDIF
$DES
.....
CT=A(1)/S1 ; (or other expression for concentration)
IF(CT.GT.COM(1)) THEN
COM(1)=CT
COM(2)=T
ENDIF
$ERROR
...
CMAX = COM(1)
TMAX = COM(2)
....
$TABLE ID TIME TMAX CMAX ONEHEADER NOPRINT FILE=mytab
; The individual CMAX and TMAX is found on the last row for each
individual in mytab
--------------------------------------
Leonid Gibiansky, Ph.D.
President, QuantPharm LLC
web: www.quantpharm.com
e-mail: LGibiansky at quantpharm.com
tel: (301) 767 5566
On 4/6/2011 11:00 AM, Martin Bergstrand wrote:
Dear Friederike,
Below are an example of code for obtaining Cmax and Tmax for a simple
PK model (I know there are analytical solutions for this, it is only
intended as a simple example of a general approach). This can easily
be manipulated to instead obtain Cmin and Tmin with another kind of
model (contact me again if you run into any problems with that). This
solution is based on the addition of two compartments (compartment 3
and 4 in the example) and a COMRES variable (COM(1)). One important
thing to consider is that the example code only works if the model
predicts a single peak (or in your case a single trough). If the
model/design predicts several Cmax (or in your case Cmin) the code
needs to be extended to account for that (requires additional
compartments and COMRES variables). Temporary Cmax and Tmax (Cmin and
Tmin) estimates are outputted in a table file and the individual
estimates should be read for the last row of each individual. A good
advise can be to add a dummy row (EVID = 2) for each individual at a
time well past the last observation for any individual in the dataset
and use that for read out.
$ABBREVIATED COMRES=1
$SUBS ADVAN6 TOL=5
$DES
DADT(1) = -KA*A(1) ; Amount in depot compartment
DADT(2) = KA*A(1)-KE*A(2) ; Amount in central compartment
X = KA*A(1)-KE*A(2) ; Derivative for the amount in central
compartment
COM(1)=0
IF(X.GT.0) COM(1)=1 ; A2 increasing
IF(X.EQ.0) COM(1)=2 ; A2 maximum
IF(X.LT.0) COM(1)=3 ; A2 decreasing
IF(COM(1).LT.3)THEN ; Time to Cmax
DADT(3) = 1
ELSE
DADT(3) = 0
ENDIF
IF(COM(1).LT.3)THEN ; Maximum A2
DADT(4) = X
ELSE
DADT(4) = 0
ENDIF
$ERROR
TMAX = A(3)
CMAX = A(4)/V ; Amount divided by the central volume of
distribution => Cmax
$TABLE ID TIME TMAX CMAX ONEHEADER NOPRINT FILE=mytab
; The individual CMAX and TMAX is found on the last row for each
individual in mytab
Kind regards,
Martin Bergstrand
-----------------------------------------------
Pharmacometrics Research Group,
Department of Pharmaceutical Biosciences,
Uppsala University
-----------------------------------------------
[email protected] <mailto:[email protected]>
-----------------------------------------------
*From:*[email protected]
[mailto:[email protected]] *On Behalf Of *Friederike Kanefendt
*Sent:* Wednesday, April 06, 2011 3:05 PM
*To:* Joachim Grevel; [email protected]
*Subject:* AW: [NMusers] Modeling Cmin and Tmin
Dear Joachim,
thank you for your explanations. My plan was not to determine the
typical value or distribution for this parameters (as THETA or ETA)
but to determine the minimum biomarker concentration for each ID with
the appropriate time for further correlation studies with outcome etc.
I tried to use NONMEM to determine Cmin while individual
parameters/profiles are estimated. I read something in NMusers about
Cmax and thought that this is maybe also possible for Cmin and Tmin
http://www.cognigencorp.com/nonmem/current/2008-January/0733.html
http://www.cognigencorp.com/nonmem/current/2007-December/0716.html
If this is not possible I would try this using simulations and R
Thanks
King regards, Friederike
*Von:*[email protected]
[mailto:[email protected]] *Im Auftrag von *Joachim Grevel
*Gesendet:* Mittwoch, 6. April 2011 11:49
*An:* Friederike Kanefendt; [email protected]
*Betreff:* RE: [NMusers] Modeling Cmin and Tmin
Dear Friederike,
Please, step back for one minute and try to understand what you want
to find out: You are applying a nonlinear mixed-effects modelling
program to obtain parameter values for your model. All parameters in
your model are random variables. Some have a mean of zero (ETAs, EPSs)
some should have a mean <> 0 (THETAs). Your results are not point
estimates but distributions. Therefore you should approach the
question of Cmin and Tmin through simulation and report the confidence
interval (or other stats) for your parameters of interest. Thus
construct a simulation data set with dense time points around the
expected Tmin, and run
$SIMULATION (240311) ONLYSIMULATION SUBPROBLEMS=1000
$TABLE ID TIME ...... NOHEADER NOAPPEND NOPRINT FILE=xxxx.tab
with all your final parameter estimates as initial values in your
control file. Then analyse your 100 (or 1000) simulated data files
with R or SAS and report the distribution of the Cmin and Tmin you found.
Please, come back with more questions in case I have confused you,
Joachim
*Joachim Grevel, PhD*
Scientific Director
*BAST Inc Limited*
BioCity Nottingham
Pennyfoot Street
Nottingham, NG1 1GF
Tel: +44 (0)115 8120497
*From:*[email protected]
[mailto:[email protected]] *On Behalf Of *Friederike Kanefendt
*Sent:* 06 April 2011 09:56
*To:* [email protected]
*Subject:* [NMusers] Modeling Cmin and Tmin
Dear NMUser,
I am a beginner in NONMEM and I have a question regarding modeling
Cmin and Tmin.
I have data of a biomarker which decreases after drug intake and I
want to determine the minimum change from baseline (Cmin) as well as
the corresponding time (Tmin). I tried different models but the
estimated values for these parameters are not plausible or always zero.
Has someone experience with this or any idea to solve this problem?
Thanks a lot
Best regards
Friederike
Attached I send you a part of my code:
$SUBROUTINE ADVAN6 TOL=3
...
$DES
...
DADT(5) = KIN*INH-KOUT*A(5) ; Biomarker CMT
IF(TIME.EQ.0) THEN
CMIN = BASE ; Baseline conc also
estimated by NM
TMIN=0
ENDIF
CC=A(5)
IF(CC.LT.CMIN) THEN
CMIN= CC
TMIN= T
ENDIF
REL = CMIN/BASE ; change relative to baseline
...
$ESTIMATION SIG=2 PRINT=1 METHOD=1 INTER MAXEVAL=0 NOABORT
Friederike Kanefendt
Pharmacist, PhD-Student
University of Bonn
-Clinical Pharmacy-
An der Immenburg 4
D-53121 Bonn
Phone: +49 (0)228 73-5781
Fax: +49(0) 228 73-9757
[email protected]