Log transformation of both sides

3 messages 3 people Latest: Jul 05, 2012

Log transformation of both sides

From: Norman Z Date: June 27, 2012 technical
Dear NMusers, I am working on a one compartment model with additive and proportional error model. Y = F*(1+EPROP*EPS(1))+EADDS*EPS(2) When I performed VPC, I found some 2.5% percentile of the concentration CI is negative. I guess it may be due to the concentration is very low after several t1/2, and the additive error on top of the low DV values causes the negative values. So I'd like to take "log transformation both sides" approach to avoid the issue. I wonder if any one can comment on the differences of the following methods: 1. Generate a ln(DV) column in the dataset, and use Y =LOG(F*(1+EPROP*EPS(1))+EADDS*EPS(2)) in the $ERROR block. 2. Use DV in the model, and code the $ERROR block Y1=LOG(F*(1+EPROP*EPS(1))+EADDS*EPS(2)) Y=EXP(Y1) Are these two methods equivalent to achieve log transformation of both sides, or they are different? Thanks for your help. Norman

Re: Log transformation of both sides

From: Paolo Denti Date: June 28, 2012 technical
Dear Norman, if you log-transform the data, you will change the error structure of your model, so if all you want is preventing negative values in your VPC, I would use something like this: IF (ICALL.EQ.4.AND.IPRED.LE.10) Y=5 ICALL==4 is used only in the simulation step, so it does not interfere with the estimation. My code lets the model work normally, and if any predicted value, after the addition of the error is lower than 10, it imputes 5. You should obviously use numbers that are reasonable for your problem, I would maybe use as a threshold the limit of quantification of your assay. If instead you want to use the log-transformation of the data, which will actually change your model, I believe you have to actually log-transform the data and add it in the dataset (although I remember Mats had a trick to do it online without modifying the data file) and then your prediction should be logged. I seem to remember that NONMEM linearises the relationship between Y and EPS, so if you use a log there, NONMEM will linearise and will see only a plain proportional error. Maybe some of the gurus will correct me on this one. Keep in mind that if you use the log-transformation, you will have to use an approximation to implement an additive component to your model, which I believe is significant, since you are getting negative values. I would recommend using the log-transformation only if you do mean to use an exponential error structure. If all you are worried about are the negative values in the VPC (which I agree look pretty ugly), my code should do the trick. I hope this helps. Greeting from Cape Town, Paolo
Quoted reply history
On 2012/06/27 23:25, Norman Z wrote: > Dear NMusers, > > I am working on a one compartment model with additive and proportional error model. > > Y = F*(1+EPROP*EPS(1))+EADDS*EPS(2) > > When I performed VPC, I found some 2.5% percentile of the concentration CI is negative. I guess it may be due to the concentration is very low after several t1/2, and the additive error on top of the low DV values causes the negative values. So I'd like to take "log transformation both sides" approach to avoid the issue. I wonder if any one can comment on the differences of the following methods: > > 1. Generate a ln(DV) column in the dataset, and use > Y =LOG(F*(1+EPROP*EPS(1))+EADDS*EPS(2)) > in the $ERROR block. > > 2. Use DV in the model, and code the $ERROR block > Y1=LOG(F*(1+EPROP*EPS(1))+EADDS*EPS(2)) > Y=EXP(Y1) > > Are these two methods equivalent to achieve log transformation of both sides, or they are different? > > Thanks for your help. > > Norman -- ------------------------------------------------ Paolo Denti, PhD Junior Lecturer Division of Clinical Pharmacology Department of Medicine University of Cape Town K45 Old Main Building Groote Schuur Hospital Observatory, Cape Town 7925 South Africa phone: +27 21 404 7719 fax: +27 21 448 1989 email: [email protected]

Re: Log transformation of both sides

From: Leonid Gibiansky Date: July 05, 2012 technical
Norman, I think both variants are not correct. If you worry only about VPC, you can use your current model output, and just replace negative values with zeros. If you would like to change the model using transformation from both sides, you need to work in the log-transformed domain, with DV=log(concentration). If you denote the model prediction as TY, then the error model can be presented as Y = LOG(TY) + EPS(1) ; exponential model or W = SQRT(THETA()/TY**2+THETA()) ; something like combined model Y = LOG(TY) + W*EPS(1) ; $SIGMA 1 FIXED If there is a chance that TY=0 (e.g., on the first dosing record or if you use the lag time), you may put some protection W = 1 LOGTY=0 ; or some other number, e.g., LOG(LLOQ/2) IF(TY.GT.0) LOGTY = LOG(TY) IF(TY.GT.0) W = SQRT(THETA()/TY**2+THETA() ; similar to combined model Y = LOGTY + W*EPS(1) Sometimes this error model inflates variance too strongly (at low TY values). Then something like EMAX error model in logs can help: W = THETA() - THETA()*TY/(THETA()+TY) Y = LOG(TY) + W*EPS(1) ; $SIGMA 1 FIXED Leonid -------------------------------------- Leonid Gibiansky, Ph.D. President, QuantPharm LLC web: www.quantpharm.com e-mail: LGibiansky at quantpharm.com tel: (301) 767 5566
Quoted reply history
On 6/27/2012 5:25 PM, Norman Z wrote: > Dear NMusers, > > I am working on a one compartment model with additive and proportional > error model. > Y = F*(1+EPROP*EPS(1))+EADDS*EPS(2) > > When I performed VPC, I found some 2.5% percentile of the concentration > CI is negative. I guess it may be due to the concentration is very low > after several t1/2, and the additive error on top of the low DV values > causes the negative values. > So I'd like to take "log transformation both sides" approach to avoid > the issue. I wonder if any one can comment on the differences of the > following methods: > 1. Generate a ln(DV) column in the dataset, and use > Y =LOG(F*(1+EPROP*EPS(1))+EADDS*EPS(2)) > in the $ERROR block. > > 2. Use DV in the model, and code the $ERROR block > Y1=LOG(F*(1+EPROP*EPS(1))+EADDS*EPS(2)) > Y=EXP(Y1) > > Are these two methods equivalent to achieve log transformation of both > sides, or they are different? > > Thanks for your help. > > Norman > > No virus found in this message. > Checked by AVG - www.avg.com http://www.avg.com > Version: 2012.0.2180 / Virus Database: 2437/5096 - Release Date: 06/27/12