This function is used by the VIM
GUI for transformation and
standardization of the data.
prepare (x, scaling = c("none","classical","MCD","robust","onestep"),
transformation = c("none","minus","reciprocal","logarithm",
"exponential","boxcox","clr","ilr","alr"),
alpha = NULL, powers = NULL, start = 0, alrVar)# S3 method for data.frame
prepare(
x,
scaling = c("none", "classical", "MCD", "robust", "onestep"),
transformation = c("none", "minus", "reciprocal", "logarithm", "exponential",
"boxcox", "clr", "ilr", "alr"),
alpha = NULL,
powers = NULL,
start = 0,
alrVar
)
# S3 method for survey.design
prepare(
x,
scaling = c("none", "classical", "MCD", "robust", "onestep"),
transformation = c("none", "minus", "reciprocal", "logarithm", "exponential",
"boxcox", "clr", "ilr", "alr"),
alpha = NULL,
powers = NULL,
start = 0,
alrVar
)
# S3 method for default
prepare(
x,
scaling = c("none", "classical", "MCD", "robust", "onestep"),
transformation = c("none", "minus", "reciprocal", "logarithm", "exponential",
"boxcox", "clr", "ilr", "alr"),
alpha = NULL,
powers = NULL,
start = 0,
alrVar
)
a vector, matrix or data.frame
.
the scaling to be applied to the data. Possible values are
"none"
, "classical"
, MCD
, "robust"
and
"onestep"
.
the transformation of the data. Possible values are
"none"
, "minus"
, "reciprocal"
, "logarithm"
,
"exponential"
, "boxcox"
, "clr"
, "ilr"
and
"alr"
.
a numeric parameter controlling the size of the subset for the
MCD (if scaling="MCD"
). See covMcd
.
a numeric vector giving the powers to be used in the Box-Cox
transformation (if transformation="boxcox"
). If NULL
, the
powers are calculated with function powerTransform
.
a constant to be added prior to Box-Cox transformation (if
transformation="boxcox"
).
variable to be used as denominator in the additive logratio
transformation (if transformation="alr"
).
Transformed and standardized data.
Transformation:
"none"
: no transformation is used.
"logarithm"
: compute the the logarithm (to the base 10).
"boxcox"
: apply a Box-Cox transformation. Powers may be specified or
calculated with the function powerTransform
.
Standardization:
"none"
: no standardization is used.
"classical"
: apply a z-Transformation on each variable by
using function scale
.
"robust"
: apply a robustified z-Transformation by using median
and MAD.
# NOT RUN {
data(sleep, package = "VIM")
x <- sleep[, c("BodyWgt", "BrainWgt")]
prepare(x, scaling = "robust", transformation = "logarithm")
# }
Run the code above in your browser using DataLab