\HeaderA{prepare}{Transformation and standardization}{prepare}
\keyword{manip}{prepare}
%
\begin{Description}\relax
This function is used by the \code{VIM} GUI for transformation and 
standardization of the data.
\end{Description}
%
\begin{Usage}
\begin{verbatim}
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)
\end{verbatim}
\end{Usage}
%
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a vector, matrix or \code{data.frame}.
\item[\code{scaling}] the scaling to be applied to the data.  Possible values 
are \code{"none"}, \code{"classical"}, \code{MCD}, \code{"robust"} and 
\code{"onestep"}.
\item[\code{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[\code{alpha}] a numeric parameter controlling the size of the 
subset for the \emph{MCD} (if \code{scaling="MCD"}). See 
\code{\LinkA{covMcd}{covMcd}}.
\item[\code{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{\LinkA{box.cox.powers}{box.cox.powers}}.
\item[\code{start}] a constant to be added prior to Box-Cox  transformation 
(if \code{transformation="boxcox"}).
\item[\code{alrVar}] variable to be used as denominator in the additive
logratio transformation (if \code{transformation="alr"}).
\end{ldescription}
\end{Arguments}
%
\begin{Details}\relax

\bold{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{\LinkA{box.cox.powers}{box.cox.powers}}.

\bold{Standardization}:

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

\code{"classical"}: apply a \emph{z}-Transformation on each variable 
by using function \code{\LinkA{scale}{scale}}.

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

\end{Details}
%
\begin{Value}
Transformed and standardized data.
\end{Value}
%
\begin{Author}\relax
Matthias Templ, modifications by Andreas Alfons
\end{Author}
%
\begin{SeeAlso}\relax
\code{\LinkA{scale}{scale}}, \code{\LinkA{box.cox.powers}{box.cox.powers}}
\end{SeeAlso}
%
\begin{Examples}
\begin{ExampleCode}
data(sleep, package = "VIM")
x <- sleep[, c("BodyWgt", "BrainWgt")]
prepare(x, scaling = "robust", transformation = "logarithm")
\end{ExampleCode}
\end{Examples}
