lambdaPlot {BHH2} | R Documentation |
Lambda plot: traces the t and F statistics in Box-Cox transformation of the response
Description
Trace regression coefficients' t-values or F-ratios for different values of \lambda
in
the Box-Cox transformation.
Usage
lambdaPlot(mod, lambda = seq(-1, 1, by = 0.1), stat = "F", global = TRUE,
cex = par("cex"), ...)
Arguments
mod |
list. A list of class |
lambda |
numeric. The values of |
stat |
character. Either |
global |
logical. Applied only for |
cex |
numeric. Expansion factor used to label the trace lines. |
... |
additional graphical parameters passed to |
Details
The response is transformed as
Y=(y^{\lambda}-1)/\lambda
for each value of \lambda
(lambda
) and the model refitted.
The t-values or F-ratios of the coefficients are saved for the display.
If global=TRUE
, then the F-ratio of the whole model is
plotted instead.
Value
The function returns an invisible list with components:
lambda |
numeric. Vector of length |
t.lambda |
matrix ( |
f.lambda |
matrix ( |
Note
For each value of \lambda
the model is refitted. Computations can be
done more efficiently and will be incorporated in future versions.
Author(s)
Ernesto Barrios
References
Box, G. E. P. and C. Fung (1995) "The Importance of Data Transformation in Designed Experiments for Life Testing". Quality Engineering, Vol. 7, No. 3, pp. 625-68.
Box G. E. P, Hunter, J. S. and Hunter, W. C. (2005). Statistics for Experimenters II. New York: Wiley.
Examples
library(BHH2)
# Lambda Plot tracing t values.
data(woolen.data)
woolen.lm <- lm(y~x1+x2+x3+I(x1^2)+I(x2^2)+I(x3^2)+
I(x1*x2)+I(x1*x3)+I(x2*x3)+I(x1*x2*x3),data=woolen.data)
lambdaPlot(woolen.lm,cex=.8,stat="t")
# Lambda Plot tracing F values.
woolen2.lm <- lm(y~x1+x2+x3,data=woolen.data)
lambdaPlot(woolen2.lm,lambda=seq(-1,1,length=41),stat="F",global=TRUE)
# Lambda Plot tracing F values.
data(poison.data)
poison.lm <- lm(y~treat*poison,data=poison.data)
lambdaPlot(poison.lm,lambda=seq(-3,1,by=.1),stat="F",global=FALSE)