From: "atul"Subject: [NMusers] When to do transformation of data? Date: Tue, April 23, 2002 2:27 am Hello All Is there any reference paper which discusses the various methods for transformation of data and its implication in NONMEM analysis? Could the group share their experience on data transformations? Especially what aspects of nontransformed data should be looked into before selecting the suitable transformation of data. In one of the analysis I was observing that log transformation of data helps in getting better estimates and the analysis is more stable. The data is after infusion studies in patients who are also on several concomitant medications. However, I was able to fit the data of healthy subjects data with out any transformation. What could be the possible reasons for these type of observations? Thanks in advance for your time Venkatesh Atul Bhattaram Post-doctoral Fellow University of Florida Gainesville ******* From: Steve_Charnick@vpharm.com Subject: Re: [NMusers] When to do transformation of data? Date: Tue, 23 Apr 2002 06:49:38 -0400 Atkinson's "Plots, Transformations, and Regression" is an excellent and small text that you could use. ******* From: Leonid Gibiansky Subject: Re: [NMusers] When to do transformation of data? Date: Tue, 23 Apr 2002 09:16:52 -0400 I had an example recently where I exhausted all my options in improving the model, and it still was not good enough (FO was giving too high estimates for omegas and biased PRED vs. DV plots, FOCE with interaction OF was strongly dependent on the number of significant digits that I requested and on the initial guess). Then I was advised to do log-transformation for DV, and it worked like a miracle and stabilized the model. The main thing (at least, on the paper, I am not so sure about internal details of the NONMEM algorithm; any thoughts why it could be so helpful ?) is to provide true exponential error model: ln(Y)=ln(F) + EPS is equivalent to Y=F EXP(EPS) whereas Y=F EXP(EPS) is approximated by NONMEM as Y=F(1+EPS) So if EPS (SIGMA) is large enough, EXP(EPS) is not equal to (1+EPS), and the log-transformed approximation could be better. On the other hand, I do not know how to code the error model Y=F*exp(EPS1) + EPS2 in log-transformed variables. Any advices on this one ? Thanks, Leonid ******* From: "Hu, Chuanpu" Subject: RE: [NMusers] When to do transformation of data? Date: Tue, 23 Apr 2002 10:12:31 -0400 Leonid, A few years ago I had a similar example, and I made exactly the same conclusion as yours. For your question, I do not think it is possible to link the additive + exponential error to the log-transformed structure, because the former allows negative Y's whereas the latter does not. Chuanpu ---------------------------------------------------------------- Chuanpu Hu, Ph.D. Research Modeling and Simulation Clinical Pharmacology Discovery Medicine GlaxoSmithKline Tel: 919-483-8205 Fax: 919-483-6380 ---------------------------------------------------------------- ******* From: "Lewis B. Sheiner" Subject: Re: [NMusers] When to do transformation of data? Date: Tue, 23 Apr 2002 08:00:34 -0700 But there is a reasonable equivalent model in the log space that Stu Beal discusses in the intermediate NONMEM course & by cc of this mail, I am asking him to share it with nmusers ... LBS. _/ _/ _/_/ _/_/_/ _/_/_/ Lewis B Sheiner, MD (lewis@c255.ucsf.edu) _/ _/ _/ _/ _/ Professor: Lab. Med., Biophmct. Sci. _/ _/ _/ _/_/_/ _/_/ Mail: Box 0626, UCSF, SF,CA,94143 _/ _/ _/ _/ _/ Courier: Rm C255, 521 Parnassus,SF,CA,94122 _/_/ _/_/ _/_/_/ _/ 415-476-1965 (v), 415-476-2796 (fax) ******* From: Leonid Gibiansky Subject: RE: [NMusers] When to do transformation of data? Date: Tue, 23 Apr 2002 11:21:59 -0400 Chuanpu I thought about something like the model ln(Y)=ln(F+EPS1) + EPS2 then Y=F EPS(2) + EPS1*EXP(EPS2) I checked that for SD(EPS2) < 0.2 the distribution of EPS1*EXP(EPS2) is almost normal. For SD(EPS2) = 0.3 the distribution of EPS1*EXP(EPS2) is very close to normal. For SD(EPS2) = 0.5 the distribution of EPS1*EXP(EPS2) differs from normal on the tails: deletion of 0.5% of the highest and 0.5% of the lowest values makes it sufficiently similar to normal. I have not tried this approach, but this might be useful in some cases, at least to test the presence of additive errors. So what would you say about NONMEM code ( Y=LOG(DV) ) : F1=F+EPS1 IF(F1 < 0.001) F1= 0.001 Y=LOG(F1)+EPS2 Will it work and will it be reasonable? Leonid ******* From:William Bachman Subject: RE: [NMusers] When to do transformation of data? Date: Tue, 23 Apr 2002 11:25 am Leonid, don't use F1 or Fn for that matter (reserved words in NONMEM). Bill ******* From: Leonid Gibiansky Subject: RE: [NMusers] When to do transformation of data? Date: Tue, 23 Apr 2002 11:29:47 -0400 Thanks, Bill, Lets try FFF=F+EPS1 IF(FFF < 0.001) FFF= 0.001 Y=LOG(FFF)+EPS2 Leonid ******* From: "Bachman, William" Subject: [NMusers] reasonable equivalent model in the log space Date: Tue, 23 Apr 2002 11:47:30 -0400 Lewis Sheiner writes: >But there is a reasonable equivalent model in the log space that Stu >Beal discusses >in the intermediate NONMEM course & by cc of this mail, >I am asking him to share it with nmusers ... For a description, see "Ways to Fit a PK Model with Some Data Below the Quantification Limit", S.L. Beal, JPP, 28, 2001, 481-504. ******* From: "Hu, Chuanpu" Subject: RE: [NMusers] When to do transformation of data? Date: Tue, 23 Apr 2002 13:03:34 -0400 Leonid, I am skeptical about the properties of this proprosed model. It does not behave well when F is small, as you surely know. However I thought the purpose of having the EPS1 term is to allow some error when F is small. In other words, I am not sure in what cases this approach will be useful. I guess I should look at Stu's paper first before continuing on this... Chuanpu ******* From: Leonid Gibiansky Subject: RE: [NMusers] When to do transformation of data? Date: Tue, 23 Apr 2002 13:45:04 -0400 Chuanpu, In fact, I am not sure that this model behaves badly when F is small. We always should assume that Y=F+eps is positive (can you imagine negative concentration ?). Under this assumption I cannot see obvious flows in the logic. Note however, that I have not tried this model, and thus would not recommend this model to anyone. Leonid ******* From: Unknown Subject: RE: [NMusers] When to do transformation of data? Date: Tue, 23 Apr 2002 16:47:24 -0500 Chuanpu and Leonid, Ken Kowalski and I have been advocating the "log-transform both sides" approach for a while. I have found it to do a nice job stabilizing the residual variability (in epsilon) as assessed by plots of the absolute value of IWRES versus IPRED. Also, I have found that the transformation helps provide better (more reasonable) estimates of the OMEGA matrix, better estimates of the absorption rate, and I can get convergence of models that failed with the Y=F*(1+EPS) or Y=F*EXP(EPS) models. A bonus with the log-transformation is that you no longer have to worry about invoking the INTERACTION option. This is because the transformation orthogonalizes the individual predictions and the residual error. Two down sides are as follows: 1) You have to back transform the results which can require post-processing 2) Occasionally the estimation of ALAG can become problematic with standard first order absorption models. I believe that the log-transform has not been frequently used by this audience, because in some instances, models have observed that a NONMEM run will "lock-up" or fail to iterate at some point. I believe that this happens primarily when the observed (apparent) lag-time (ALAG) is greater in some individuals than their first PK sampling time point. If this phenomenon occurs in a sufficient number of subjects and the ALAG parameter is not bounded above by the first sampling time, then interaction can estimate the typical ALAG value greater than the first time point, which can result in a zero prediction, a problem when taking the log. If the upper bound is fixed to the first sampling time point, then the ALAG estimate can iterate to the bound - this is also unsatisfactory. In these cases, I have found that a two-site first order absorption model can circumvent this problem and perhaps even improve the model's ability to capture Cmax! In other words, don't discount the transformation because it cause trouble in estimation. It is precisely these issues that could be an indication that the standard absorption model is unsatisfactory! Of course, not discounting that the sampling design may also not be sufficient. Matt ******* From: Peter Wright Subject: RE: [NMusers] When to do transformation of data? Date: Wed, 24 Apr 2002 10:51:21 -0700 On the topic of data transformation I have a quick question for the group If I want to fit a model to data transformed to natural log can I do this just in the error block e.g. Y1 = LOG(F) + EPS(1) Y = EXP(Y1) IPRE = F IRES = DV-IPRE IWRE = IRES/IPRE or must I actually transform the data? Peter Wright UCSF ******* From: Mats Karlsson Subject: Re: [NMusers] When to do transformation of data? Date: Mon, 29 Apr 2002 06:03:48 +0200 Hi, To get the same error structure for log-transformed data as the additive+proportional on the normal scale, I use Y=LOG(F)+SQRT(THETA(x)**2+THETA(y)**2/F**2)*EPS(1) with $SIGMA 1 FIX THETA(x) and THETA(y) will have the same meaning as on the untransformed scale with Y=F+SQRT(THETA(y)**2+THETA(x)**2*F**2)*EPS(1) with $SIGMA 1 FIX As for zero predictions with lag-time models, you would have to condition this LOG(F)-variance model. Alternatively, compared to a lag-time model, I have not seen worse behaviour with a chain of transit compartments (all with the same rate constant) and often better (lower OFV, more stable). A chain of transit compartments will not predict a zero concentration. The only drawback is sometimes longer runtimes. I usually use 3-5 compartments in the chain. If you want really lag-time like behaviour (still without zero predictions), you could increase that further. In general with log-transformation, I have found that run-times can be both considerably longer and considerably shorter than without transformation. I have not seen a pattern that allows me to make a prediction which will happen. Maybe someone has an explanation. Best regards, Mats Mats Karlsson, PhD Professor of Pharmacometrics Div. of Pharmacokinetics and Drug Therapy Dept. of Pharmaceutical Biosciences Faculty of Pharmacy Uppsala University Box 591 SE-751 24 Uppsala Sweden phone +46 18 471 4105 fax +46 18 471 4003 mats.karlsson@farmbio.uu.se ******* From: "atul" Subject: [NMusers] When to do transformation of data? Date: April 29, 2002 Dr Karlsson/nmusers What aspects of non-transformed data runs do you look into before deciding to transform the data? I am trying to look into literature if anybody has discussed this specifically while doing analysis in NONMEM? Could you suggest to me any reference which has looked into these aspects and compared the results? How does this impact any model validation or qualification? Thanks in advance for your time Atul ******* From: Mats Karlsson [Mats.Karlsson@farmbio.uu.se] Subject: Re: [NMusers] When to do transformation of data? Sent: Monday, April 29, 2002 2:38 PM Dear ATul, I would often try it regardless of diagnostics, but a skewed distribution of WRES (more high outliers than low) is usually a sign that transformation will improve things. Best regards, Mats Mats Karlsson, PhD Professor of Pharmacometrics Div. of Pharmacokinetics and Drug Therapy Dept. of Pharmaceutical Biosciences Faculty of Pharmacy Uppsala University Box 591 SE-751 24 Uppsala Sweden phone +46 18 471 4105 fax +46 18 471 4003 mats.karlsson@farmbio.uu.se ******* From: "Kowalski, Ken" Subject: RE: [NMusers] When to do transformation of data? Date: Mon, 29 Apr 2002 16:16:15 -0400 Atul, To add further to Mats' comments regarding skewness in WRES, another diagnostic that might suggest the need for a log-transformation is when a concordance plot of PRED vs OBS shows bias but a plot of IPRED vs OBS does not. You can think of the log-transformation as providing a geometric mean prediction rather than an arithmetic mean prediction. The geometric mean is a better measure of central tendency when the data are right-skewed. A good discussion on this topic can be found in Carroll & Ruppert, Transformations and Weighting in Regression, Chapman & Hall, NY (1988). They devote a whole chapter to the "transform-both-sides" approach. Although the text is devoted to linear and nonlinear fixed effects models, many of the results are relevant for mixed effects models as well. Ken