How to adjust the ratio to compare the data in two variables?

2 ビュー (過去 30 日間)
Brian Kim
Brian Kim 2017 年 10 月 18 日
コメント済み: Brian Kim 2017 年 10 月 19 日
There are two different variables.
A=[107.5383 47.4492 36.4819 26.4964];
B=1.0e+03 * [4.1876 3.5687 3.4444 3.4548];
I want to know the correlation between A and B.
But, it is too large difference between A and B.
in that case, how to adjust?
  1 件のコメント
Brian Kim
Brian Kim 2017 年 10 月 18 日
P.S. I tried to plot those variables

サインインしてコメントする。

採用された回答

Jos (10584)
Jos (10584) 2017 年 10 月 18 日
You can transform your data linearly into, for instance, z-scores, to get a "normal" range of values. This does not change the correlation, so the answer by Walter is the one to follow!
A=[107.5383 47.4492 36.4819 26.4964];
B=1.0e+03 * [4.1876 3.5687 3.4444 3.4548];
% z-score transformation
Az = (A - mean(A)) ./ std(A)
Bz = (B - mean(B)) ./ std(B)
plot(Az,Bz,'bo')
corr(Az(:),Bz(:))

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 10 月 18 日
>> corr(A(:),B(:))
ans =
0.991036262555985

カテゴリ

Help Center および File Exchange행렬과 배열 についてさらに検索

Community Treasure Hunt

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

Start Hunting!