File: prepare.Rd

package info (click to toggle)
r-cran-vim 6.2.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,556 kB
  • sloc: cpp: 141; sh: 12; makefile: 2
file content (83 lines) | stat: -rw-r--r-- 2,591 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/prepare.R
\name{prepare}
\alias{prepare}
\title{Transformation and standardization}
\usage{
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
)
}
\arguments{
\item{x}{a vector, matrix or \code{data.frame}.}

\item{scaling}{the scaling to be applied to the data.  Possible values are
\code{"none"}, \code{"classical"}, \code{MCD}, \code{"robust"} and
\code{"onestep"}.}

\item{transformation}{the transformation of the data.  Possible values are
\code{"none"}, \code{"minus"}, \code{"reciprocal"}, \code{"logarithm"},
\code{"exponential"}, \code{"boxcox"}, \code{"clr"}, \code{"ilr"} and
\code{"alr"}.}

\item{alpha}{a numeric parameter controlling the size of the subset for the
\emph{MCD} (if \code{scaling="MCD"}). See \code{\link[robustbase:covMcd]{robustbase::covMcd()}}.}

\item{powers}{a numeric vector giving the powers to be used in the Box-Cox
transformation (if \code{transformation="boxcox"}).  If \code{NULL}, the
powers are calculated with function \code{\link[car:powerTransform]{car::powerTransform()}}.}

\item{start}{a constant to be added prior to Box-Cox transformation (if
\code{transformation="boxcox"}).}

\item{alrVar}{variable to be used as denominator in the additive logratio
transformation (if \code{transformation="alr"}).}
}
\value{
Transformed and standardized data.
}
\description{
This function is used by the \code{VIM} GUI for transformation and
standardization of the data.
}
\details{
\strong{Transformation}:

\code{"none"}: no transformation is used.

\code{"logarithm"}: compute the the logarithm (to the base 10).

\code{"boxcox"}: apply a Box-Cox transformation. Powers may be specified or
calculated with the function \code{\link[car:powerTransform]{car::powerTransform()}}.

\strong{Standardization}:

\code{"none"}: no standardization is used.

\code{"classical"}: apply a \emph{z}-Transformation on each variable by
using function \code{\link[=scale]{scale()}}.

\code{"robust"}: apply a robustified \emph{z}-Transformation by using median
and MAD.
}
\examples{

data(sleep, package = "VIM")
x <- sleep[, c("BodyWgt", "BrainWgt")]
prepare(x, scaling = "robust", transformation = "logarithm")

}
\seealso{
\code{\link[=scale]{scale()}}, \code{\link[car:powerTransform]{car::powerTransform()}}
}
\author{
Matthias Templ, modifications by Andreas Alfons
}
\keyword{manip}