NONMEM Users Network Archive

Hosted by Cognigen

RE: RES and WRES output with Beal's M3 method

From: Martin Bergstrand <martin.bergstrand>
Date: Wed, 7 Apr 2010 19:02:09 +0200

Dear Sebastien and NONMEM users,

It is correct that NONMEM doesn't return any RES or WRES for individuals who
have at least one observation with F_FLAG=1. It is understandable that
NONMEM can't return residuals for the BQL observations (F_FLAG=1) since PRED
is a likelihood in this case and not a prediction (furthermore the
observation is an interval and can neither be used to calculate a residual).
However, I don't understand why it doesn't do so for the observations for
which F_FLAG=0? Can this be considered a bug?

You can of course always get out individual residuals (IRES) and individual
weighted residuals (IWRES) (below this paragraph you can see my definition
of IWRES). What you can do if you really want to get RES and WRES is to run
a MAXEVAL=0 run with your final estimates. The BQL data should in this case
be omitted (or set to a fix value) and all M3 code taken out. Remember in
this case that the IRES and IWRES and other EBE dependent variables will not
be correct following the MAXEVAL=0 run (i.e. use only the PRED, RES and WRES
out of this run and the rest from your original fit with the M3 code). In
case you are using the FOCE estimation method you would preferably want to
look at conditional weighted residuals (CWRES) rather than WRES. However I
have yet not seen any example of a workaround to get these when using the M3
method (Obs! CWRES will not be correctly calculated with the MAXEVAL=0
trick).

$ERROR
IPRED = F
W = THETA(11) ; SD for additive
residual error
; W = THETA(11) * IPRED ; SD for proportional
residual error
; W = SQRT(THEATA(11)**2+THETA(12)**2*IPRED**2) ; SD for combined
residual error
Y = IPRED + W*EPS(1)
IRES = DV - IPRED
IWRES = IRES/W

$SIGMA 1 FIX

If you use Xpose to do your diagnostic plots it can be good to know that
Xpose by default omits all rows with WRES=0 (this is done to omit
information on dosing row from being plotted). You can change this setting
in Xpose by using the command inclZeroWRES=TRUE (you should then enter some
other subset to omit the dose rows e.g. subset="EVID==0").

My favorite type of diagnostics are VPCs (I think I share this with Prof.
Nick Holford). VPCs can easily be adopted to handle the presence of BQL
data. How to do this with PsN and Xpose is explained in a PAGE poster from
2009
(http://www.page-meeting.org/pdf_assets/7002-Poster_PAGE_VPC_090618_final.pd
f).

Best regards,

Martin Bergstrand, MSc, PhD student
-----------------------------------------------
Pharmacometrics Research Group,
Department of Pharmaceutical Biosciences,
Uppsala University
-----------------------------------------------
martin.bergstrand
-----------------------------------------------
Work: +46 18 471 4639
Mobile: +46 709 994 396
Fax: +46 18 471 4003


-----Original Message-----
From: owner-nmusers
Behalf Of Sebastien Bihorel
Sent: den 7 april 2010 17:31
To: nmusers
Subject: [NMusers] RES and WRES output with Beal's M3 method

Dear NONMEM users,

We have noticed some problems with the table outputs of RES and WRES,
when we implemented Beal's M3 method as proposed by Ahn and colleagues
(J Pharmacokinet Pharmacodyn (2008) 35:401-421). While RES and WRES are
correctly calculated and reported for patients without BLOQ records,
these metrics are reported as being 0 for patients with at least one
BLOQ sample, even for the records that were not flagged as BLOQ. This
behavior seems to be common to NONMEM 6 and 7.

Does anybody know about an NONMEM option or a workaround that would
allow the user to access to the actual RES and WRES for the non-BLQ records?

Any feedback would be greatly appreciated.

Sebastien Bihorel

PS: this is the $ERROR block code we used for a simple proportional RV model

$ERROR (ONLY OBSERVATIONS)

;Information needed for BLQF and > BLQF samples
LOQ=5
SIG = THETA(3)

DFLG=0 ;create a dose record flag
IF(AMT.NE.0) DFLG=1

IPRED=F+DFLG
W=IPRED

;Computations for samples with DV > LOQ (BLQF=0)
IF (BLQF.LT.0.25) THEN
F_FLAG=0
FFLG=0
IRES=DV-IPRED
IWRES=IRES/W
Y=IPRED+W*SIG*EPS(1) ;NOTE: Prediction is a concentration
ENDIF

;Computations for samples with DV <= LOQ (BLQF=1)
IF (BLQF.GE.0.25) THEN
F_FLAG=1
FFLG=1
DUM=(LOQ-IPRED)/(W*SIG)
IPRED=PHI(DUM)
Y=IPRED ;NOTE: prediction is a *probability*
ENDIF
Received on Wed Apr 07 2010 - 13:02:09 EDT

The NONMEM Users Network is maintained by ICON plc. Requests to subscribe to the network should be sent to: nmusers-request@iconplc.com.

Once subscribed, you may contribute to the discussion by emailing: nmusers@globomaxnm.com.