# Re: [R] boxcox transformation

From: Greg Snow <Greg.Snow_at_intermountainmail.org>
Date: Tue 01 Aug 2006 - 00:06:46 EST

boxcox from MASS and bct from TeachingDemos do different things. The boxcox function does not return the transformed y values, it returns log-likelihood values for various values of lambda, these values can be used to decide which value of lambda to use (generally it is used by giving a sequence of lambda values then looking at the plot (see the plotit argument)).

It is generally not a good idea to just take the lambda with the highest log-likelihood, rather look for values of lambda within the confidence interval that make scientific sense.

Once you have decided on a value of lambda to use then you can use the bct function from TeachingDemos (or other ways) to compute the transformed y values.

Hope this helps,

-----Original Message-----
From: r-help-bounces@stat.math.ethz.ch on behalf of Torsten Mathies Sent: Sat 7/29/2006 12:52 AM
To: r-help@stat.math.ethz.ch
Subject: [R] boxcox transformation

I've got a vector of data (hours to drive from a to b) y.

After a qqplot I know, that they don't fit the normal probability.

I would like to transform these data with the boxcox transformation (MASS), that they fit the model.

When I try

ybx<-boxcox(y~1,0)
qqnorm(ybx)

the plot is different from

library (TeachingDemos)
ybct<-bct(y,0) //
qqnorm(ybct)

How can I transform y to fit with the normal probability model?

Yours
Torsten

R-help@stat.math.ethz.ch 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.

[[alternative HTML version deleted]]

R-help@stat.math.ethz.ch 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. Received on Tue Aug 01 01:31:59 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 01 Aug 2006 - 02:17:01 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.