Learn R Programming

lindia (version 0.10)

gg_boxcox: Plot boxcox graph in ggplot with suggested lambda transformation

Description

Plot boxcox graph in ggplot with suggested lambda transformation

Usage

gg_boxcox(fitted.lm, showlambda = TRUE, lambdaSF = 3, scale.factor = 0.5)

Value

A ggplot object that contains boxcox graph

Arguments

fitted.lm

a fitted linear model (i.e. lm, glm) that contains fitted regression

showlambda

logical; controls whether lambda value should be displayed on graph. Defaults to TRUE

lambdaSF

numeric; controls to how many significant figure is lambda rounded to. Defaults to 3.

scale.factor

numeric; scales the point size and linewidth to allow customized viewing. Defaults to 0.5.

Examples

Run this code
library(MASS)
data(Cars93)
cars_lm <- lm(Price ~ Passengers + Length + RPM, data = Cars93)
gg_boxcox(cars_lm)

Run the code above in your browser using DataLab