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]]

