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

From: Thomas Ludden Date: April 07, 2010 technical Source: mail-archive.com
Historical perspective. This issue was discussed with Stuart Beal. He believed that weighted residuals would be incorrect for an individual that had both continuous dependent variables and a likelihood in the calculation of their contribution to the objective function value, as is the case with his M3 or M4 BQL methods The code for both RES and WRES are intentionally bypassed in these cases. Tom
Quoted reply history
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Sebastien Bihorel Sent: Wednesday, April 07, 2010 1:57 PM To: Martin Bergstrand Cc: 'Sebastien Bihorel'; [email protected] Subject: Re: [NMusers] RES and WRES output with Beal's M3 method Hi Martin, Thanks for your reply. I tend to agree with you this should be considered as a bug. I tried different options to access to the actual RES and WRES inside the $ERROR block. The best I could do so far was to access to PRED values using (COMACT.EQ.1). With this call, I can assign PRED values to a PPRED variable that I used to compute some residuals PRES (DV-PPRED) and some weighted residuals PWRES (RES/W) using your defining of W. This provides some non-zero values for non-BLOQ samples. By checking PRES and PWRES against RES and WRES for patients without BLOQ samples, it appears that PWRES is correct as long as I don't include inter-individual variability in my model (PRES seems to be always correct). Any idea how the formula for PWRES should be altered? Sebastien New code: $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*SIG IF (COMACT.EQ.1) PPRED=F+DFLG PRES=DV-PPRED PWRES=PRES/W ;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 Martin Bergstrand wrote: > 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_fina l.pd > f). > > Best regards, > > Martin Bergstrand, MSc, PhD student > ----------------------------------------------- > Pharmacometrics Research Group, > Department of Pharmaceutical Biosciences, > Uppsala University > ----------------------------------------------- > [email protected] > ----------------------------------------------- > Work: +46 18 471 4639 > Mobile: +46 709 994 396 > Fax: +46 18 471 4003 > > > -----Original Message----- > From: [email protected] [mailto:[email protected]] On > Behalf Of Sebastien Bihorel > Sent: den 7 april 2010 17:31 > To: [email protected] > 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 > >
Apr 07, 2010 Sebastien Bihorel RES and WRES output with Beal's M3 method
Apr 07, 2010 Martin Bergstrand RE: RES and WRES output with Beal's M3 method
Apr 07, 2010 Thomas Ludden RE: RES and WRES output with Beal's M3 method
Apr 07, 2010 Matt Hutmacher RE: RES and WRES output with Beal's M3 method
Apr 08, 2010 Sebastien Bihorel Re: RES and WRES output with Beal's M3 method