Dear Alison, I have always considered the time-after-dose variable to provide values related to when the dose was administered, not that time plus any ALAG. If I read your code right, you propose to do it as administration time + ALAG. I would argue that it is more valuable to have the former.
Best regards, Mats -----Original Message----- From: owner-nmus...@globomaxnm.com <owner-nmus...@globomaxnm.com> On Behalf Of Alison Boeckmann Sent: den 27 november 2018 19:59 To: nmusers@globomaxnm.com; ajbf <alisonboeckm...@fastmail.fm> Subject: [NMusers] Time After Dose example in help/html Time after dose (TAD) is useful to some NONMEM and PDxPop users. PREDPP does not compute it. It has to be computed by the user and listed in the table file. Depending on the kinds of doses, this may be difficult. There are several sources of advice: (1) tip3 and tip4 and tip4update in the Nonmem tip directory https://nonmem.iconplc.com/nonmem/tips These were revised in 01-31-18. All the tips should work correctly with NONMEM 7, but are of limited usefulness because they are not general. (2) Over the years, users have asked for help or volunteered their own solutions to the problem via nmusers email. The code is not consistent, and some users may still find it difficult to write the code for some kinds of doses. (3) With nonmem 7.4.2, there is a new example TADEXA in the help/html directories. It is code that can compute TAD with both ALAG and multiple dosing using ADDL. It also contains notes that discuss the tips. An improved version of tadexa is included in this email. It has improved comments and notes, and more consistent use of the data files. The abbreviated code is not changed. I am writing to encourage users to help improve tadexa in hopes that TAD can be computed identically by all users, using standard code which is documented in the help/html files. If you have code that computes TAD for your data, can you try the code from tadexa and see if the values of TAD match? Please send an email to nmcons...@globomaxnm.com to report a match, or to report a discrepancy in values of TAD. We will try to resolve the discrepancy. Alison Boeckmann Nov 18, 2018 =========== +--------------------------------------------------------------------+ | | | TIME AFTER DOSE (TAD) EXAMPLE | | | +--------------------------------------------------------------------+ This fully-worked out example shows how Time After Dose (TAD) may be computed in $PK abbreviated code. It works with transient and steady- state doses, and also with additional and lagged doses. It is based on suggestions from the NONMEM tips directory but is not identical to any of them. See Note 8 for a discussion of the tips. $PROB Based on RUN# 705 nonmem coding challenge #1 ; As of Nov. 1, 2018 $INPUT C ID TIME DV AMT WT AGE CRCL SMK ADDL II EVID DROP $DATA 706.csv IGNORE=C $SUBROUTINE ADVAN2 TRANS2 $PK ; initialize for new individual or reset record IF (NEWIND.LT.2.OR.EVID.EQ.3) THEN TDOS=-999 ; Time of most recent dose. -999 if no previous dose. TAD=0 ; Time After Dose ENDIF ; ALAG1=0 ; ALAG1 is 0 for this example, but could be set to some other value ; ; Save TDOS (time of last dose) and compute TAD (time after dose) ; General case: ADDL doses and ALAG may be modelled IF (EVID.EQ.1.and.ALAG1.EQ.0.OR.EVID.EQ.4.and.ALAG1.EQ.0) TDOS=TIME IF (DOSTIM.GT.0) TDOS=DOSTIM IF (TDOS.GT.-999) TAD=TIME-TDOS ; If no ALAG or ADDL doses, the above three lines become: ; IF (EVID.EQ.1.OR.EVID.EQ.4) TDOS=TIME ; IF (TDOS.GT.-999) TAD=TIME-TDOS CL=THETA(1)*EXP(ETA(1)) TVV=THETA(2) V=TVV*EXP(ETA(2)) TVKA=THETA(3) KA=TVKA*EXP(ETA(3)) S2=V $THETA (0, 10) (0, 100) (0, 0.5) $ERROR Y=F+ERR(1) IPRED=F $OMEGA 0.04 ;[P] INTERIND VAR IN CL 0.04 ;[P] INTERIND VAR IN V 0.04 ;[P] INTERIND VAR IN KA $SIGMA 0.2 ;[A] ADDITIVE COMPONENT $EST MAXEVAL=0 PRINT=2 NOABORT ;POSTHOC $TABLE ID TIME EVID TDOS TAD IPRED NOAPPEND NOPRINT ONEHEADER FILE=tadexa.tab FORMAT=SF11.7 The data for the first subject in 706.csv is: C,Data Desc: test of TAD for ADDL,,,,,,,,,, C,ID,TIME,DV,AMT,WT,AGE,CRCL,SMK,ADDL,II,EVID,TAD 0,1,0,0,0,58.4,51,4.49,1,0,0,2,0 0,1,0.1,0,500,58.4,51,4.49,1,1,24,1,0 0,1,1.1,1.67538,0,58.4,51,4.49,1,0,0,0,0 0,1,4.1,2.79283,0,58.4,51,4.49,1,0,0,0,0 0,1,10.1,0.583263,0,58.4,51,4.49,1,0,0,0,0 0,1,24.1,0.146255,0,58.4,51,4.49,1,0,0,0,0 0,1,25.1,1.67538,0,58.4,51,4.49,1,0,0,0,0 The original data set 704.csv is embedded in tip3-2-25-02.txt. Data set 706.csv can be found in the tips directory. It was created from 704.csv by appending an extra column, TAD, whose values are zero. $INFN code in the tips assign values to the TAD data item (see Note 8). The code in the present example does not use the TAD data item (DROP is listed in $INPUT). Instead, TAD is a user-defined variable listed in MODULE NMPRD4 from which its values may be displayed in a table file. Note 1. It is assumed that TAD is displayed in tables for the purpose of graphical display of the data. It is not a random variable, and is not intended to be part of the prediction model. Note 2. If there are non-dose records prior to the first dose record of the Individual record, TAD is set to zero for these records. This is an arbitrary convention; the user could use different values, especially if these conditions might signal an error in the data set. Note 3. ALAG1 is used in the example, but a different dosing compartment could be used, e.g., ALAG2 for doses into compartment 2. The code would need modification to compute TAD for doses into two or more compartments. Note 4. This code can handle random DOSTIM (Eta on ALAG or ETA on mod- elled duration or rate.) Note 5. The code does not use INFN. The information is developed with passes through the data set at ICALL=2, in which NONMEM calls PREDPP. During a pass in which INFN is called, PREDPP is not called. The abbreviated code would have to account for additional and lagged dose times. Note 6. TDOS=-999 until the first dose. TDOS=0 when the first dose is at TIME 0. This makes it possible to dispense with a flag variable whose only function is to say "a dose has occurred". If there are negative time values in the data set and any time value is smaller than -999, then Note 7. The code is intended to compute TAD for multiple individual doses or one initiating dose. (An initiating dose has ADDL>0,II>0). Note 8. Changes were made to tip3, tip4, and tip4update in the NONMEM tips directory. See tips in https://nonmem.iconplc.com/nonmem/tips In each case, the name of the revised tip contains 01-31-18 and supercedes the original. Although the tips were revised as part of the nonmem 7.4.2 release they apply to previous versions of nonmem. tip3-revised-01-31-18.txt The original version, tip3-2-25-02.txt, provides a data file 704.csv and a simple model. The revised version provides improved code, similar to the code in tadexa.exa. tip4-revised-01-31-18.txt Uses Fortran suboutine INFN and equivalent $INFN code. The datafile is 706.csv. tip4update-revised-01-31-18.txt Uses DOSTIM. The original versions are still in the tips directory with new names that include the original dates. tip3-2-25-02.txt tip4-3-04-02.txt tip4update-10-11-13.txt REFERENCES: None -- Alison Boeckmann alisonboeckm...@fastmail.fm När du har kontakt med oss på Uppsala universitet med e-post så innebär det att vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan du läsa här: http://www.uu.se/om-uu/dataskydd-personuppgifter/ E-mailing Uppsala University means that we will process your personal data. For more information on how this is performed, please read here: http://www.uu.se/en/about-uu/data-protection-policy