how to get Pearson coefficient in the single vector not in the matrix

5 ビュー (過去 30 日間)
shagun chaudhary
shagun chaudhary 2022 年 1 月 20 日
回答済み: Prince Kumar 2022 年 1 月 25 日
Hi,
is there any possible where i can get pearson cofficient in the single vector? i have tried with the [R,P] = corrcoef(___) but it gives in matrix form
please help

回答 (1 件)

Prince Kumar
Prince Kumar 2022 年 1 月 25 日
Hi,
Pearson coefficient measures the strength and direction of a linear relationship between two variables.
For example :
x = randn(6,1);
y = randn(6,1);
A = [x y 2*y+3];
R = corrcoef(A)
R = 3×3
1.0000 -0.7991 -0.7991 -0.7991 1.0000 1.0000 -0.7991 1.0000 1.0000
As you can see that there is a linear relation between second and third element of the A, this is information is given by "corrcoef" function.
Thus, it is not possible to capture this relation in a single vector.

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by