[ top | up ]

Correlation Matrices

Syntax

cor(x, y=x, pairwise=false)

Arguments

x a matrix.
y a matrix.
pairwise logical.

Description

cov computes the correlation between the columns of x and the columns of y.

If pairwise is false (the default), missing values are handled by casewise deletion. If pairwise is true, all cases which are complete for a pair of variables is used to compute the correlation for that pair of variables. This can result in correlation matrices which are not positive semidefinite.