.BG
.VE $Header: /usr3/s/current/s/.help/RCS/var,v 1.2 83/12/30 19:36:26 rab Exp $
.FN var
.FN cor
.TL
var cor: Variance, Covariance, and Correlation
.CS
var(x, y, trim)
cor(x, y, trim)
.PP
.AG x
matrix or vector.
.AG y
matrix or vector. If omitted, same as `x'.
.AG trim
the proportion trimmed in the internal calculations. Default
0.
.RT
correlations or variances (covariances), optionally with
trimming.  If `x' or `y' is a matrix, the result is a
correlation or covariance matrix; the `[i,j]' element
corresponds to the `i'th column of `x' and the `j'th column
of `y'.
.PP
Trimmed correlations are computed by the standardized
sums and differences method.
Untrimmed variances are sample variances: `sum((x\-mean(x))^2)/(len(x)\-1)'.
.PP
Trimmed covariances are not yet implemented.
.EX
cor(cbind(longley.x,longley.y))   # correlation matrix for longley data

std.dev <- sqrt(var(x))   # standard deviation of a vector
.KW basic*
.KW summary
.WR
