| Statistics Toolbox™ | ![]() |
R = corrcov(C)
[R,sigma] = corrcov(C)
R = corrcov(C) computes the correlation matrix R corresponding to the covariance matrix C. C must be square, symmetric, and positive semi-definite.
[R,sigma] = corrcov(C) also computes the vector of standard deviations sigma.
Use cov and corrcoef to compute covariances and correlations, respectively, for sample data on weight and blood pressure (systolic, diastolic) in hospital.mat:
load hospital
X = [hospital.Weight hospital.BloodPressure];
C = cov(X)
C =
706.0404 27.7879 41.0202
27.7879 45.0622 23.8194
41.0202 23.8194 48.0590
R = corrcoef(X)
R =
1.0000 0.1558 0.2227
0.1558 1.0000 0.5118
0.2227 0.5118 1.0000Compare R with the correlation matrix computed from C by corrcov:
corrcov(C)
ans =
1.0000 0.1558 0.2227
0.1558 1.0000 0.5118
0.2227 0.5118 1.0000![]() | corr | coxphfit | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |