There are several issues I'd like to comment on. First, Sebastian asks: Is there a similar way to code ETAs using a dynamic variable defined in $PK?As Sebastian writes later, only items listed in $INPUT may be used this way.We have no plans to change this feature.
In cases where it is not possible to modify the dataset, it is easy to append OCC to the data set using $INFN code. Suppose OCC is not listed in the original data set. First append it to the data set: $INPUT .... OCC (There will be many data warnings: THE NUMBER OF DATA ITEMS SPECIFIED IN $INPUT EXCEEDS THE NUMBER OF VALUES IN A RECORD OF THE NM-TRAN DATA FILE. To suppress them, use $WARNINGS DATAMAXIMUM=NONE) Next, compute OCC in an INFN block as you would have done in $PK. The following code is based on Jeroen's code, but other code could be used. The disclaimer is the same: The following code has not been tested. $INFN IF (ICALL.EQ.1) THEN ; Initialization pass thru the data DOWHILE(DATA) ; Sample code for IOCC follows. Modify for your own data set IF (NEWIND < 2) IOCC=1 IF (AMT > 0 .and. TIME > 0) IOCC=IOCC+1 OCC=IOCC ; copy the current IOCC value to the data set ENDDO ENDIF Now it is possible to code (for example): $ABBR REPLACE ETA(OCC_CL)=ETA(3,4) $PK ... CL=TVCL*EXP(ETA(1)+ETA(OCC_CL)) The second issue I'd like to comment on is this code in Jeroen's email: I=1 DOWHILE (I<4) IF(I==IOCC) OCC(I)=1 I=I+1 ENDDO IOCE=OCC(1)*ETA(3) + OCC(2)*ETA(4) + OCC(3)*ETA(5) CL=EXP(THETA(1)+ETA(1)+IOCE) This is exactly the kind of code that is generated in FSUBS when OCC is defined in the data set and replacement with selection by data item is coded as above. Finally, some users may not be aware the original code for IOV is the example in the help/html directory for iov: INTEROCCASION_VARIABILITY EXAMPLE. This is based on work by Karlsson and Sheiner. For example: CL=TVCL*EXP(ETA(3)*OCC+ETA(5)*OCC2+ETA(1)) This code assumes OCC is 0/1 in the data, OCC2=1-OCC and is 1/0. It can be modified easily if OCC takes more values and can also be modified to use $ABBR ... REPLACE. -- Alison Alison Boeckmann alisonboeckm...@fastmail.fm