Re: Easier IOV modeling
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
[email protected]
@PD_value
+31 6 23118438
-- More value out of your data!
Quoted reply history
> Op 16 jan. 2019 om 14:14 heeft Sebastien Bihorel
> <[email protected]> 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.)" <[email protected]>
> To: "Sebastien Bihorel" <[email protected]>,
> [email protected]
> 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
> using 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
> think 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, such 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
> [email protected]
> @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
>>
>>
>