as.data.frame.trafo {trafo} | R Documentation |
Data frame with transformed variables
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
## S3 method for class 'trafo'
as.data.frame(x, row.names = NULL, optional = FALSE,
std = FALSE, ...)
Arguments
x |
an object of type |
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 |
... |
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
# 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)