boxcoxplot {s20x} | R Documentation |
Draws a plot of the Box-Cox profile likelihood for the powers in the vector p. Used for selecting a power transformation for symmetrising a single batch (if the argument "group" is missing), or normalising the data (if the argument "group" is present). The most suitable p value is given by the minimum of the Box-Cox plot.
boxcoxplot(x, group, p = seq(-1, 2, length = 20),...)
x |
a vector containing the data from which the boxcoxplots are to be produced. |
group |
a vector containing the group labels. |
p |
gives the set of values of p over which the plot should range. The default takes 20 equally-spaced values over the range p=-1 to p=2. Use a different range if, for example, the minimum of the Box-Cox plot isn't in the interval [-1,2]. |
... |
plotting arguments such as axis labels (xlab,ylab) and titles (main). |
Returns no value but draws the plot.
Studies indicate that the Box-Cox plot is the best for choosing the power, followed by the skewness power plot; "skewpowerplot": aims to eliminate skewness, "sympowerplot": aims for a symmetrising transformation.
##Income data: data(incomes) attach(incomes) boxcoxplot(incomes) detach(incomes) ##Sentence Length data: p120,156 1995 Data Analysis-an introduction based on R sentence.lengths<-c(26,10,13,8,9,13,20,13,5,9,14,18,24,7,5,7,14,25,9,2,5,10,33, 7,11,10,10,17,5,8,10,16,12,23,11,13,8,17,10,31,9,27,5,6,12,21,7,41,9,5,19,3,9, 14,33,14,7,9,14,11,24,30,6,9,3,8,21,16,14,7,10,31,15,4,20,16,17,12,24,20) book<-rep(c("IF","BDB","BG","CG"),c(20,20,20,20)) boxcoxplot(sentence.lengths,book)