Description Usage Arguments Value See Also Examples
View source: R/compare_trafo.R
Function trafo_compare
compares linear models where the dependent
variable is transformed by different transformations.
1 | trafo_compare(object, trafos, std = FALSE)
|
object |
an object of type lm |
trafos |
a list of two |
std |
logical. If |
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.
bickeldoksum
, boxcox
, dual
,
glog
, gpower
, log
,
logshiftopt
, manly
, modulus
,
neglog
, sqrtshift
, yeojohnson
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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.