NONMEM Users Network Archive

Hosted by Cognigen

RE: simultaneous PK/PD

From: Elassaiss - Schaap, J. - <jeroen.elassaiss>
Date: Thu, 24 Jun 2010 07:25:08 +0200

Dear Hauke,
Nonmem cannot handle random variables defined in nested conditions. See =
the help entry on abbreviated code:
"Random variables cannot be defined within nested conditionals, i.e.,
within a conditional structure beginning with an IF and containing
another IF. The use of ELSEIF ... THEN implies a nested conditional."
The usual way of handling this is to define a dummy variable to set the =
condition, but you do not even need this in your case as Brendan and =
Katya pointed out.
Moreover in this case, I would assign a different sigma to PK and PD. =
Your model actually states the belief that the variability in PK and PD =
are 100% correlated (unless they are always measured at different =
times). If you have background support for such a model it is fine, but =
in general I would advice to associate EPS(1) with THETA(8) for PK and =
EPS(2) with THETA(9) for PD.
You may even skip zero testing by request (ONLYOBS) after $ERROR if you =
always have positive predictions of C1 and C3 during observation records =
(e.g., a PK model without lagtime), see nmhelp on $ERROR.
Hope this helps,

Modeling & Simulation Expert
Pharmacokinetics, Pharmacodynamics & Pharmacometrics (P3) - DMPK
PO Box 20 - AP1112
5340 BH Oss
The Netherlands
T: +31 (0)412 66 9320
F: +31 (0)412 66 2506


From: owner-nmusers
On Behalf Of Hauke Rhs
Sent: Wednesday, 23 June, 2010 14:54
To: nmusers
Subject: [NMusers] simultaneous PK/PD

Dear NMusers,


I want to combine my sequential PK and PD model to one simultaneous =
model. In both models I used an exponential error model =
(log-transformation). When I write the model as follows, NONMEM gives me =
this error message:



Leaving out the condition C.GT.0 will also lead to errors. Is there =
another way to write this?













  IF (M1H2.EQ.1) THEN

            IF (C1.GT.0) IPRE = LOG(C1)

            IRES = DV-IPRE

            W = EPS(1)*THETA(8)

            Y = IPRE+W



  IF (M1H2.EQ.2) THEN

            IF (C3.GT.0) IPRE = LOG(C3)


            W = EPS(1)*THETA(9)

            Y = IPRE+W



  DEL = 0

  IF(W.EQ.0) DEL = 1




 1 FIX



Hauke Rhs


Pharmazeutisches Institut

- Klinische Pharmazie -

An der Immenburg 4

53121 Bonn


Tel: + 49-(0)228 73-5781

Fax: + 49-(0)228 73-9757 <>



This message and any attachments are solely for the intended recipient. =
If you are not the intended recipient, disclosure, copying, use or =
distribution of the information included in this message is prohibited =
--- Please immediately and permanently delete.

Received on Thu Jun 24 2010 - 01:25:08 EDT

The NONMEM Users Network is maintained by ICON plc. Requests to subscribe to the network should be sent to:

Once subscribed, you may contribute to the discussion by emailing: