as.data.frame.trafo: Data frame with transformed variables

Description Usage Arguments Value See Also Examples

View source: R/print.trafo.R

Description

The data frame that is returned contains the variables that are used in the model and additionally a variable with the transformed dependent variable. To the variable name of the dependent variable a t is added for transformed.

Usage

1
2
3
## S3 method for class 'trafo'
as.data.frame(x, row.names = NULL, optional = FALSE,
  std = FALSE, ...)

Arguments

x

an object of type trafo.

row.names

NULL or a character vector giving the row names for the data frame. Missing values are not allowed.

optional

logical. If TRUE, setting row names and converting column names (to syntactic names: see make.names) is optional. Note that all of R's base package as.data.frame() methods use optional only for column names treatment, basically with the meaning of data.frame(*, check.names = !optional)

std

logical. If TRUE, the data is transformed by the standardized/scaled transformation. Defaults to FALSE.

...

other parameters that can be passed to the function.

Value

A data frame with the original variables and the transformed variable.

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
# Load data
data("cars", package = "datasets")

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

# Transform dependent variable using divergence minimization following
# Kolmogorov-Smirnov
logshiftopt_trafo <- logshiftopt(object = lm_cars, method = "div.ks", 
plotit = FALSE)

# Get a data frame with the added transformed variable
as.data.frame(logshiftopt_trafo)

trafo documentation built on May 2, 2019, 2:13 p.m.