Learn R Programming

lmSupport (version 2.9.13)

modelBoxCox: Calculates lambda for Box-Cox power transformation

Description

Calcluates and plots log-liklihoods lambda for power transformation of response variable. Reports chi-square test of lambda <> 1. All values of Y must > 0 or function will crash. Add offset to Y if necessary (see example). Default lambda range is -2 to 2. Uses boxCox() from car package.

Usage

modelBoxCox(Model, Lambdas = seq(-2, 2, by = 0.1))

Arguments

Model

an unweighted linear model, produced by lm.

Lambdas

a vector of lambda values to plot. Default is seq(-2,2,by=0.1)

References

Box, G. E. P. & Cox, D. R. (1964). An analysis of transformations (with discussion). Journal of the Royal Statistical Society, 26, 211-252.

See Also

boxCox(), boxcox()

Examples

Run this code
# NOT RUN {
##Not run
##m = lm(FPS + 99 ~ BAC+TA, data=BAC)
##modelBoxCox(m)
# }

Run the code above in your browser using DataLab