trafo_compare: Compares linear models with transformed dependent variable

Description Usage Arguments Value See Also Examples

View source: R/compare_trafo.R

Description

Function trafo_compare compares linear models where the dependent variable is transformed by different transformations.

Usage

1
trafo_compare(object, trafos, std = FALSE)

Arguments

object

an object of type lm

trafos

a list of two trafo objects based on the same model given in object.

std

logical. If TRUE, the transformed models are returned based on the standardized/scaled transformation. Defaults to FALSE.

Value

An object of class trafo_compare. Methods such as diagnostics.trafo_compare, print.trafo_compare, plot.trafo_compare and summary.trafo_compare can be used for this class.

See Also

bickeldoksum, boxcox, dual, glog, gpower, log, logshiftopt, manly, modulus, neglog, sqrtshift, yeojohnson

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Load data
data("cars", package = "datasets")

# Fit linear model
lm_cars <- lm(dist ~ speed, data = cars)

# Transform with Bickel-Doksum transformation
bd_trafo <- bickeldoksum(object = lm_cars, plotit = FALSE)

# Transform with Box-Cox transformation
bc_trafo <- boxcox(object = lm_cars, method = "skew", plotit = FALSE)

# Compare transformed models
trafo_compare(object = lm_cars, trafos = list(bd_trafo, bc_trafo))

akreutzmann/trafo documentation built on Sept. 14, 2020, 9:03 p.m.