Next: facanal() Up: Multivariate Macros Help File Previous: discrimquad()   Contents


distcomp(y), REAL matrix y with no MISSING values

Keywords: covariance, descriptive statistics
distcomp(y) computes the generalized distances of each row of REAL
matrix y from the mean of all the rows.  y must not have any missing

When y is n by p, the result is the length nrows(y) vector
        d = diag((y - ybar') ' %*% solve(s) %*% (y - ybar'),
where ybar is the vector of column means and s is the sample covariance
matrix of y.  The individual elements of d[i] are

   d[i] = (y[i,]' - ybar)' %*% solve(s) %*% (y[i,]' - ybar),

Very commonly matrix y is the matrix RESIDUALS computed by manova().

See also chiqqplot().

Gary Oehlert 2003-01-15