PRODUCTS: NONMEM® USER TIPS

These tips are brought to you as information of interest from experiences in using NONMEM. All tips can also be found in the tips folder on the NONMEM Repository@GloboMax.

Tip # 4 - Coding Time After Dose (TAD) with ADDL Dosing:


How would you code to get the correct TAD after ADDL doses? A sample control stream, data file and hint were given.
[Hint: may require an INFN subroutine]

One solution, in fact the only one received, from an anonymous scholar used a replacement INFN Fortran subroutine named TAD.for. The concepts used were:

  1. add an additional column (named TAD) to the datafile filled with zeros as placeholders.
  2. code a solution for calculating TAD in TAD.for using modulus arithmetic:

    C TAD.FOR (INFN ROUTINE FOR COMPUTING TIME AFTER DOSE)
    C wjb 28feb2002 GloboMax LLC
    C data items: C ID TIME DV AMT WT AGE CRCL SMK ADDL II EVID TAD
    C DATREC(3)=TIME DATA ITEM
    C DATREC(10)=ADDL DATA ITEM
    C DATREC(11)=II DATA ITEM
    C DATREC(12)=EVID DATA ITEM
    C DATREC(13)=TAD DATA ITEM
    C
      SUBROUTINE INFN (ICALL,THETA,DATREC,INDXS,NEWIND)
      DIMENSION THETA(*),DATREC(*),INDXS(*)
      DOUBLE PRECISION THETA
      INTEGER IFL
      REAL DATREC, DIV, TDOS
    C call at termination only
      IF (ICALL.EQ.3) THEN
    C INITIALIZE PASS
      MODE=0
      CALL PASS (MODE)
      MODE=2
    C PASS THROUGH DATA
      5 CALL PASS (MODE)
        IF (MODE.EQ.0) GO TO 10
        IF (NEWIND.LT.2) THEN
          DATREC(13)=0.0
          IFL=0
        ENDIF
        IF(DATREC(12).EQ.1.OR.DATREC(12).EQ.4) THEN
          DATREC(13)=0.0
          DIV=DATREC(11)
          TDOS=DATREC(3)
          IFL=1
        ENDIF
        IF(IFL.EQ.1.AND.DATREC(12).NE.1.AND.DATREC(12).NE.4)
      1 DATREC(13)=AMOD(DATREC(3)-TDOS,DIV)
        GO TO 5
      10 ENDIF
      END
  3. modify the control stream to use the modified data file and call the new INFN routine:

    $PROB RUN# 708 nonmem challenge #1 solution wjb 28FEB2000
    $INPUT C ID TIME DV AMT WT AGE CRCL SMK ADDL II EVID TAD
    $DATA 706.csv IGNORE=C
    $SUBROUTINE ADVAN2 TRANS2 INFN=TAD.FOR
    ;no code for TAD in control stream needed

[Note: Verify that this code or any other code you receive from an outside source works with YOUR DATA.]