Next: stepgls() Up: Multivariate Macros Help File Previous: rmvnorm()   Contents

standardize()

Usage:
ynew <- standardize(y [,locs [,scales]]), n by p REAL matrix y, locs and
  scales REAL scalars or row or column vectors of length p, defaults
  mean and standard deviations



Keywords: transformations
                                  Usage
ynew <- standardize(y), where y is a n by p REAL matrix, creates a n by
p REAL matrix ynew with ynew[i,j] = (y[i,j] - ybar[j])/sd[j], where ybar
and sd are vectors of column means and standard deviations of y.  ynew
will have column means = 0 and column standard deviations = 1.

ynew <- standardize(y,locs), where locs is a REAL row or column vector
of length p, does the same except ynew[i,j] = (y[i,j] - locs[j])/sd[j].

ynew <- standardize(y,locs,scales), where scales is a REAL row or column
vector of length p, does the same except ynew[i,j] = (y[i,j] -
locs[j])/scales[j].

                          Scalar locs or scales
If locs is a scalar, it is expanded to rep(locs, p).

If scales is a scalar, it is expanded to rep(scales, p).

                             Missing values
Any means or standard deviations needed are computed by describe(y).
MISSING elements are ignored except for a warning message.

If any elements of locs are MISSING, they are replaced by the mean of
the corresponding columns of y.

If any elements of scales are MISSING, they are replaced by the standard
deviations of the corresponding columns of y.

                             Cross reference
See also describe().


Gary Oehlert 2005-08-12