Skip to contents

Box-Cox Transformations

Usage

boxcox_transform(
  model,
  lambda = seq(-2, 2, 1/10),
  showlambda = TRUE,
  lambdaSF = 3,
  showplot = TRUE
)

Arguments

model

Model used for Box-Cox transformation

lambda

sequence of lambda values to consider for plot. Default is seq(-2,2,1/10)

showlambda

Default is TRUE, show lambda values in plot

lambdaSF

Digits to round lambda values shown in plot

showplot

Default is TRUE, if false plot will not be shown and a tibble is returned with a 95% confidence interval for lambda and lambda value which maximizes log-likelihood

Value

Box-Cox transformation plot with 95% confidence interval of lambda values to consider

Examples

model <- lm(s2 ~ (A+B+C+D),data = adapted_epitaxial)
boxcox_transform(model,lambda = seq(-5,5,0.2))

boxcox_transform(model,lambda = seq(-5,5,0.2),showplot=FALSE)
#> # A tibble: 1 × 3
#>   best_lambda lambda_low lambda_high
#>         <dbl>      <dbl>       <dbl>
#> 1       0.253      -3.99        4.70