Re: [NMusers] Easier IOV modeling

From: Alison Boeckmann <alisonboeckmann_at_fastmail.fm>
Date: Thu, 17 Jan 2019 11:25:57 -0800

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


On Thu, Jan 17, 2019, at 2:27 AM, Jeroen Elassaiss-Schaap (PD-value) wrote:=
> Hi Sebastien,
>
> Ok that settles it than: NMTRAN does not accept subscripts to ETA. I
> clearly misread the nm73 guide: ”Subscripts may be used with user-
> defined variables that are declared to be arrays using the $ABBR
> DECLARE record, and also with certain reserved variables such as
> THETA”. It would be great if Bob Bauer or Alison Boeckman could
> revisit this for a next version.>
> One can get a bit of that behavior using the following code (now
> tested):>
> $ABBR DECLARE OCC(3)


> $ABBR DECLARE DOWHILE I


> $ABBR DECLARE INTEGER IOCC


> $PK


> CALLFL=-2


> IF(NEWIND<2)IOCC=1


> IF(AMT>0 .and. TIME>0) IOCC=IOCC+1


>


> 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)


>


> But this is not very elegant unfortunately. For a long number of
> occasions it might perhaps be worthwhile.>
> Best,
> Jeroen
>
> http://pd-value.com[1] jeroen_at_pd-value.com _at_PD_value +31 6 23118438[2]
> -- More value out of your data!>
> Op 16 jan. 2019 om 14:14 heeft Sebastien Bihorel
> <sebastien.bihorel_at_cognigencorp.com> het volgende geschreven:>> Hi Jeroen,
>>
>> In NONMEM 7.3, I actually tried a couple of variants using DECLARE
>> and REPLACE before posting to NMusers and got error messages (see
>> below; assumed that there were 3 ETAs for IIV in various PK
>> parameters).>>
>> There might a trick though... at least I hope
>>
>>
>> $ABBREVIATED REPLACE ETA(OCC_CL)=ETA(4,5,6)
>>
>> $PK
>>
>> CALLFL = -2
>> OCC = 1
>> ; some if conditions defining alternative values of OCC between 1
>> ; and 3>> ;...
>>
>> ETAOCC = OCC + 3
>> CL = THETA(1)*EXP(ETA(1) + ETA(OCC_CL))
>>
>>
>> AN ERROR WAS FOUND ON LINE 45 AT THE APPROXIMATE POSITION NOTED:
>> $ABBREVIATED REPLACE ETA(OCC_CL)=ETA(4,5,6)
>> X
>> 635 $ABBR: IMPLIED SELECT VARIABLE IS NOT A DATA ITEM.
>>
>>
>> ------------------------
>>
>> $ABBR DECLARE INTEGER OCC
>> $ABBR DECLARE INTEGER ETAOCC
>>
>> $PK
>>
>> CALLFL = -2
>> IF (NEWIND < 2) NDOSE = 0
>> IF (AMT > 0 .AND. CMT == 1) THEN
>> NDOSE = NDOSE + 1
>> ENDIF
>>
>> OCC = 1
>> ; some if conditions defining alternative values of OCC between 1
>> ; and 3>> ;...
>>
>> ETAOCC = OCC + 3
>> CL = THETA(1)*EXP(ETA(1) + ETA(ETAOCC))
>>
>>
>> AN ERROR WAS FOUND ON LINE 76 AT THE APPROXIMATE POSITION NOTED:
>> CL = TVCL*EXP(ETA(1) + ETA(ETAOCC))
>> X
>> THE CHARACTERS IN ERROR ARE: ETA
>> 484 SUBSCRIPT MUST BE AN INTEGER CONSTANT.
>>
>>
>> ----- Original Message -----
>> From: "Jeroen Elassaiss-Schaap (PD-value B.V.)" <jeroen_at_pd-value.com>>> =
To: "Sebastien Bihorel" <sebastien.bihorel_at_cognigencorp.com>,
>> nmusers_at_globomaxnm.com>> Sent: Wednesday, January 16, 2019 3:14:53 AM
>> Subject: Re: [NMusers] Easier IOV modeling
>>
>> Hi Sebastien,
>>
>> Interesting notion, thanks. It should be possible from NM7.3 onwards>> u=
sing MOD or DECLARE as described in the sections just below the
>> one you>> referenced.
>>
>> With DECLARE it could look like this:
>>
>> $ABBR DECLARE INTEGER IOCC
>> $PK
>> CALLFL=-2
>> IF (NEWIND < 2) IOCC=0
>> IF (AMT > 0 .and. CMT==1) THEN
>> IOCC = IOCC + 1
>> ENDIF
>> IF (IOCC>MAXOCC) IOCC = MAXOCC ; define MAXOCC in the dataset or
>> in code>> to prevent referencing more than defined in $OMEGA
>> ...
>> IOVCL = ETA( 1 + IOCC*3 ) ; first dose occasion will get
>> assigned eta(4)>> as below, than 7, 10 etc...
>> CL = TVCL * EXP( ETA(1) + IOVCL )
>>
>>
>> And using MOD on TIME, assuming regular nominal daily dosing,
>> it could>> look like:
>>
>> $ABBR DECLARE INTEGER IOCC
>> $PK
>> IOCC = ( TIME - MOD( TIME, 24) )/24 + 1 ; assume TIME in hours and>>=
 starting at zero
>> IOVCL = ETA( 3 + IOCC*3 ) ; first day will get assigned eta(4)
>> as below,>> than 7, 10 etc...
>> CL = TVCL * EXP( ETA(1) + IOVCL )
>>
>>
>> And therefore I think it could be possible indeed. I however do not>> th=
ink it is easier, and I see OCC coding in the dataset as more
>> robust.>> But in cases where it is not possible to modify the dataset, s=
uch an>> approach might be an option. As a reclaimer: the above code
>> snippets are>> heavily leaning on the userguide examples and completely =
untested.
>> Please test before use.
>>
>> Hope this helps,
>>
>> Jeroen
>>
>> http://pd-value.com
>> jeroen_at_pd-value.com
>> _at_PD_value
>> +31 6 23118438
>> -- More value out of your data!
>>
>> On 16-01-19 04:06, Sebastien Bihorel wrote:
>>> Hi
>>>
>>> The Introduction to NONMEM 7.x documents include a section entitled
>>> "Easier Inter-occasion variability modeling" which describes a
>>> quicker way to code IOV.
>>>
>>> $ABBR REPLACE ETA(OCC_CL)=ETA(4,7,10) ;when OCC=1, eta(4) to be
>>> used: when OCC=2, eta(7) to be used, etc.
>>>
>>> ...
>>>
>>> $PK CL=TVCL*EXP(ETA(1)+ETA(OCC_CL))
>>>
>>> When this approach is used, OCC must be a data item defined in
>>> $INPUT.
>>>
>>> Is there a similar way to code ETAs using a dynamic variable defined
>>> in $PK?
>>>
>>> Thanks
>>>
>>> Sebastien
>>>
>>>>>

--
  Alison Boeckmann
  alisonboeckmann_at_fastmail.fm



Links:

  1. http://pd-value.com/
  2. tel:+31%206%2023118438



Received on Thu Jan 17 2019 - 14:25:57 EST

This archive was generated by hypermail 2.3.0 : Fri Sep 27 2019 - 17:02:22 EDT