trafo_back: Back-transforms vectors with used transformation in trafo_lm

Description Usage Arguments Value Examples

View source: R/trafo_back.R

Description

The function transforms vectors as the prediction or confidence intervals naively back to the original scale of the used transformation in trafo_lm.

Usage

1
trafo_back(object, prediction)

Arguments

object

an object of type trafo_lm.

prediction

the return of the predict.lm method.

Value

The backtransformed prediction.

Examples

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

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

# Compare untransformed and transformed model
trafo_cars <- trafo_lm(object = lm_cars, trafo = "bickeldoksum", method = "skew", 
lambdarange = c(1e-11, 2))

# Back-transform prediction and confidence interval
trafo_back(trafo_cars, predict(trafo_cars$trafo_mod, interval = "confidence"))

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