simultaneous PK/PD

5 messages 4 people Latest: Jun 24, 2010

Re: simultaneous PK/PD

From: Ekaterina Gibiansky Date: June 23, 2010 technical
Hi Hauke, You can easily re-write the code to be non-nested, e.g. IF (M1H2.EQ.1.AND. C1.GT.0 ) IPRE = LOG(C1) IF (M1H2.EQ.1) THEN IRES = DV-IPRE W = EPS(1)*THETA(8) Y = IPRE+W ENDIF Regards, Katya Ekaterina Gibiansky, Ph.D. CEO&CSO, QuantPharm LLC Web: www.quantpharm.com Email: EGibiansky at quantpharm.com Tel: (301)-717-7032
Quoted reply history
On 6/23/2010 8:54 AM, Hauke Rühs wrote: 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: 326 RANDOM VARIABLE IS DEFINED IN A NESTED IF STRUCTURE. Leaving out the condition C.GT.0 will also lead to errors. Is there another way to write this? Thanks Hauke $ERROR C1=(A(1)/V1) C3=A(3) IPRE=0 IF (M1H2.EQ.1) THEN IF (C1.GT.0) IPRE = LOG(C1) IRES = DV-IPRE W = EPS(1)*THETA(8) Y = IPRE+W ENDIF IF (M1H2.EQ.2) THEN IF (C3.GT.0) IPRE = LOG(C3) IRES = DV-IPRE W = EPS(1)*THETA(9) Y = IPRE+W ENDIF DEL = 0 IF(W.EQ.0) DEL = 1 IWRE = IRES/(W+DEL) $SIGMA 1 FIX ---- ------------------------- Hauke Rühs Apotheker Pharmazeutisches Institut - Klinische Pharmazie - An der Immenburg 4 53121 Bonn Tel: + 49-(0)228 73-5781 Fax: + 49-(0)228 73-9757 www.klinische-pharmazie.info No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.829 / Virus Database: 271.1.1/2956 - Release Date: 06/22/10 14:36:00 No virus found in this outgoing message. Checked by AVG - www.avg.com Version: 9.0.829 / Virus Database: 271.1.1/2956 - Release Date: 06/22/10 14:36:00

RE: simultaneous PK/PD

From: Brendan Johnson Date: June 23, 2010 technical
Hauke, maybe this would work .... IF (M1H2.EQ.1.AND.C1.GT.0) THEN IPRE = LOG(C1) IRES = DV-IPRE W = EPS(1)*THETA(8) Y = IPRE+W ENDIF .... Repeat for M1H2=2 Brendan
Quoted reply history
From: [email protected] [mailto:[email protected]] On Behalf Of Hauke Rühs Sent: Wednesday, June 23, 2010 8:54 AM To: [email protected] 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: 326 RANDOM VARIABLE IS DEFINED IN A NESTED IF STRUCTURE. Leaving out the condition C.GT.0 will also lead to errors. Is there another way to write this? Thanks Hauke $ERROR C1=(A(1)/V1) C3=A(3) IPRE=0 IF (M1H2.EQ.1) THEN IF (C1.GT.0) IPRE = LOG(C1) IRES = DV-IPRE W = EPS(1)*THETA(8) Y = IPRE+W ENDIF IF (M1H2.EQ.2) THEN IF (C3.GT.0) IPRE = LOG(C3) IRES = DV-IPRE W = EPS(1)*THETA(9) Y = IPRE+W ENDIF DEL = 0 IF(W.EQ.0) DEL = 1 IWRE = IRES/(W+DEL) $SIGMA 1 FIX ----------------------------- Hauke Rühs Apotheker Pharmazeutisches Institut - Klinische Pharmazie - An der Immenburg 4 53121 Bonn Tel: + 49-(0)228 73-5781 Fax: + 49-(0)228 73-9757 http://www.klinische-pharmazie.info/

RE: simultaneous PK/PD

From: Jeroen Elassaiss-Schaap Date: June 24, 2010 technical
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, Jeroen Modeling & Simulation Expert Pharmacokinetics, Pharmacodynamics & Pharmacometrics (P3) - DMPK MSD PO Box 20 - AP1112 5340 BH Oss The Netherlands jeroen.elassaiss T: +31 (0)412 66 9320 F: +31 (0)412 66 2506 www.msd.com
Quoted reply history
________________________________ 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: 326 RANDOM VARIABLE IS DEFINED IN A NESTED IF STRUCTURE. Leaving out the condition C.GT.0 will also lead to errors. Is there another way to write this? Thanks Hauke $ERROR C1=(A(1)/V1) C3=A(3) IPRE=0 IF (M1H2.EQ.1) THEN IF (C1.GT.0) IPRE = LOG(C1) IRES = DV-IPRE W = EPS(1)*THETA(8) Y = IPRE+W ENDIF IF (M1H2.EQ.2) THEN IF (C3.GT.0) IPRE = LOG(C3) IRES = DV-IPRE W = EPS(1)*THETA(9) Y = IPRE+W ENDIF DEL = 0 IF(W.EQ.0) DEL = 1 IWRE = IRES/(W+DEL) $SIGMA 1 FIX ----------------------------- Hauke Rhs Apotheker Pharmazeutisches Institut - Klinische Pharmazie - An der Immenburg 4 53121 Bonn Tel: + 49-(0)228 73-5781 Fax: + 49-(0)228 73-9757 www.klinische-pharmazie.info http://www.klinische-pharmazie.info/ 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.

RE: simultaneous PK/PD

From: Jeroen Elassaiss-Schaap Date: June 24, 2010 technical
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, Jeroen Modeling & Simulation Expert Pharmacokinetics, Pharmacodynamics & Pharmacometrics (P3) - DMPK MSD PO Box 20 - AP1112 5340 BH Oss The Netherlands [email protected] T: +31 (0)412 66 9320 F: +31 (0)412 66 2506 www.msd.com
Quoted reply history
________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of Hauke Rühs Sent: Wednesday, 23 June, 2010 14:54 To: [email protected] 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: 326 RANDOM VARIABLE IS DEFINED IN A NESTED IF STRUCTURE. Leaving out the condition C.GT.0 will also lead to errors. Is there another way to write this? Thanks Hauke $ERROR C1=(A(1)/V1) C3=A(3) IPRE=0 IF (M1H2.EQ.1) THEN IF (C1.GT.0) IPRE = LOG(C1) IRES = DV-IPRE W = EPS(1)*THETA(8) Y = IPRE+W ENDIF IF (M1H2.EQ.2) THEN IF (C3.GT.0) IPRE = LOG(C3) IRES = DV-IPRE W = EPS(1)*THETA(9) Y = IPRE+W ENDIF DEL = 0 IF(W.EQ.0) DEL = 1 IWRE = IRES/(W+DEL) $SIGMA 1 FIX ----------------------------- Hauke Rühs Apotheker Pharmazeutisches Institut - Klinische Pharmazie - An der Immenburg 4 53121 Bonn Tel: + 49-(0)228 73-5781 Fax: + 49-(0)228 73-9757 www.klinische-pharmazie.info http://www.klinische-pharmazie.info/ 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.

Re: simultaneous PK/PD

From: Nick Holford Date: June 24, 2010 technical
Jeroen, There is no need to defined a different EPS for PK and PD. Every observation record has a new random instance of EPS associated with it. So if there is only one random residual error parameter (PK or PD) then only one EPS is needed. In this particular case EPS(1) is always mean 0 and variance 1 but it is scaled by THETA(8) for PK and THETA(9) for PD so that the residual error is appropriate for the type of observation. There is no implied correlation between the random residual error. Nick Elassaiss - Schaap, J. (Jeroen) wrote: > Dear Hauke, > > 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. Hope this helps, > > Jeroen > > Modeling & Simulation Expert > Pharmacokinetics, Pharmacodynamics & Pharmacometrics (P3) - DMPK > *MSD* > PO Box 20 - AP1112 > 5340 BH Oss > The Netherlands > [email protected] > T: +31 (0)412 66 9320 > F: +31 (0)412 66 2506 > www.msd.com > > ------------------------------------------------------------------------ > > *From:* [email protected] [ mailto: [email protected] ] *On Behalf Of *Hauke Rühs > > *Sent:* Wednesday, 23 June, 2010 14:54 > *To:* [email protected] > *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: > > 326 RANDOM VARIABLE IS DEFINED IN A NESTED IF STRUCTURE. > > Leaving out the condition C.GT.0 will also lead to errors. Is there another way to write this? > > Thanks > > Hauke > > $ERROR > > C1=(A(1)/V1) > > C3=A(3) > > IPRE=0 > > IF (M1H2.EQ.1) THEN > > IF (C1.GT.0) IPRE = LOG(C1) > > IRES = DV-IPRE > > W = EPS(1)*THETA(8) > > Y = IPRE+W > > ENDIF > > IF (M1H2.EQ.2) THEN > > IF (C3.GT.0) IPRE = LOG(C3) > > IRES = DV-IPRE > > W = EPS(1)*THETA(9) > > Y = IPRE+W > > ENDIF > > DEL = 0 > > IF(W.EQ.0) DEL = 1 > > IWRE = IRES/(W+DEL) > > $SIGMA > > 1 FIX > > ----------------------------- > > Hauke Rühs > > Apotheker > > Pharmazeutisches Institut > > - Klinische Pharmazie - > > An der Immenburg 4 > > 53121 Bonn > > Tel: + 49-(0)228 73-5781 > > Fax: + 49-(0)228 73-9757 > > www.klinische-pharmazie.info http://www.klinische-pharmazie.info/ > > ------------------------------------------------------------------------ > > 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. > > ------------------------------------------------------------------------ -- 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