From: "Bachman, William"
Subject: [NMusers] "Tip of the Week #10 - May 13, 2002" log-transformed data and DV= 0 records [avoiding log(0)]???
Date: Mon, 13 May 2002 12:26:16 -0400
As a follow up to the last tip and some recent discussion on nmusers, this
tip will address "what do I do with DV=0 records in data sets when
log-transforming my data?"
In the previous tip (#9), the data came from an IV study (actually the
phenobarbital data that is distributed with NONMEM was ln-transformed) with
no zero observations (fortuitously and by design). In that situation, the
following code can be used to provide individual predictions (and avoid the
ln(DV)=log(0) which would occur for the dosing records):
$ERROR
IPRED=0
IF(F.GT.0) IPRED=LOG(F)
Y=IPRED+ERR(1)
However, in the situation where one has data with observations with DV=0,
you have to decide how you are going to treat those records. As an example,
I have ln-transformed the theopp data that is distributed with NONMEM. In
preparing the transformed data set, a column was added with ln(DV). For
ln(0) records, 0 was entered as the ln(DV). Now, how do you handle the
model code?
1. Suggestions were proposed to set the ln(0) equal to some "small value":
A.
$ERROR
CALLFL=0
IPRED = -3 ;similar to above code but ipred=-3 instead of ipred=0
IF(F.GT.0) IPRED = LOG(F)
Y = IPRED + EPS(1)
or
B.
$ERROR
CALLFL=0
IPRED=F
IF(IPRED.EQ.0) IPRED=EXP(-9)
Y=LOG(IPRED)+EPS(1)
2. Another suggestion is to simply delete the observations records with DV=0
if they occur right after the dose and there are not "a lot" of them. An
argument can be made that these are BQL's and could be deleted.
3. Use the "double-exponential" residual error model:
Y=LOG((F)+THETA(n))+(F*ERR(1))/(F+THETA(n))+(THETA(n)*ERR(2))/(F+THETA(n))
;code does not require log(0) protection except if IPRED wanted
IPRED=0
IF(F.GT.0) IPRED=LOG(F)
For the log transformed theophylline data, the "best" fit to the data was
obtained using option 2. and 3. Both gave an equivalent fit and parameter
estimates. Options 1.A. and 1.B, gave fits with significantly higher
objective function values and bias for this data. The arbitrary selection
of the "small" value had a significant effect on the fit. With option 3.,
the value of m, the "positively constrained variance parameter" (THETA(n),
here), was about 0.2, presumably near the LOQ. The difference in objective
function between 2. and 3. was ~6.4 (lower for 3. but with two more
parameters in the model). This again suggests, why not remove the DV=0
observation records? What are YOUR THOUGHTS?
[errors may be reported to the author and are welcomed.]
[Generic Disclaimer: Verify that this code or any other code you receive
from an outside source works with YOUR DATA.]
Previous tips may be found in the NONMEM Repository@GloboMax:
ftp://ftp.globomaxnm.com/Public/nonmem/tips/
*****************************************************************
If you have a "tip" or a better way to do things, by all means, feel free to
post them! One of the reasons for doing this (other than good PR for
GloboMax), is to stimulate discussion. We at GloboMax can learn from your
experience as well.
Do you have a "tip" you would like to share, but would prefer to remain
anonymous? If so, you may forward it to us and your identity will be
withheld. Distribution as a "Tip of the Week" will be at the discretion of
nmconsult@globomaxnm.com.
*****************************************************************
nmconsult@globomaxnm.com
GloboMax LLC
7250 Parkway Drive, Suite 430
Hanover, MD 21076
Voice: (410) 782-2205
FAX: (410) 712-0737