Hello, I am doing a simple regression using lm(Y~X). As my response and my predictor seemed to be skewed and I can't meet the model assumptions. Therefore I need to transform my variables. I wanted to ask what is the preferred way to find out if predictor and/or response needs to be transformed and if yes how (log-transform?). I found a procedure in "A modern approach to Regressoin in R" (Sheather, 2009): There they suggest an approach with the function bctrans from alr3...but it seems that it is deprecated. So what is the best way (box-cox test) find the best transformation for predictor and response simultaneously? AFAIK boxcox from MASS is used only used for transformation of the predictor? Thank you very much Johannes --
See the acepack package or the transace function in Hmisc for ACE or AVAS. -- Bert On Thu, Nov 3, 2011 at 8:55 AM, Johannes Radinger <JRadinger@gmx.at> wrote:> Hello, > > I am doing a simple regression using lm(Y~X). > As my response and my predictor seemed to be skewed > and I can't meet the model assumptions. Therefore > I need to transform my variables. > > I wanted to ask what is the preferred way to find out > if predictor and/or response needs to be transformed > and if yes how (log-transform?). > > I found a procedure in "A modern approach to Regressoin > in R" (Sheather, 2009): There they suggest an approach > with the function bctrans from alr3...but it seems that it > is deprecated. So what is the best way (box-cox test) find the best > transformation for predictor and response simultaneously? > AFAIK boxcox from MASS is used only used for transformation > of the predictor? > > Thank you very much > Johannes > > -- > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm [[alternative HTML version deleted]]
On Nov 3, 2011, at 11:55 AM, "Johannes Radinger" <JRadinger at gmx.at> wrote:> Hello, > > I am doing a simple regression using lm(Y~X). > As my response and my predictor seemed to be skewed > and I can't meet the model assumptions. Therefore > I need to transform my variables.The presence of skewness in either or both the response or predictors does NOT imply failure to meet model assumptions. The assumptions of linear regression regarding normality only apply to the residuals after the estimation of the model. -- David.> > I wanted to ask what is the preferred way to find out > if predictor and/or response needs to be transformed > and if yes how (log-transform?). > > I found a procedure in "A modern approach to Regressoin > in R" (Sheather, 2009): There they suggest an approach > with the function bctrans from alr3...but it seems that it > is deprecated. So what is the best way (box-cox test) find the best > transformation for predictor and response simultaneously? > AFAIK boxcox from MASS is used only used for transformation > of the predictor? > > Thank you very much > Johannes > > -- > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Apparently Analagous Threads
- bctrans: Box-Cox Transformation Problem
- Argument validation within functions
- Assigning objects to variable and variable to list in a for loop
- Extracting information from lm results (multiple model runs)
- Remove columns from dataframe based on their statistics