Correlation between three variables in MATLAB -
in matlab, have following:
a, b, c 1 x 101 row vectors. know 'i' 1 101, a(i), b(i), , c(i) linearly correlated.
how can identify dependence between a, b, , c?
for degree of correlation, can use corrcoef
:
data = [a(:) b(:) c(:)]; correlation = corrcoef(data);
here's test case shows positive/negative correlation degree of correlation,
n = 10000; = randn(n,1); b = 3*a + randn(n,1); c = -2*a + 20*randn(n,1); correlation = 1.0000 0.9473 -0.1005 0.9473 1.0000 -0.0927 -0.1005 -0.0927 1.0000