Find Which rows/items have a positive correlation with another item

4 ビュー (過去 30 日間)
Learning
Learning 2022 年 8 月 22 日
編集済み: Torsten 2022 年 8 月 23 日
Hi,
I have a dataset (see below, rows 2 to 6, items A to E). I want to find out which items have a positive correlation with row 3 (item B). The data for each item is contained in columns B to E. Time course for when a measurement was performed is contained in the first row. As you can see, for item B, at 0hrs, it is 0 but them it increases linearly as time goes on. I want to find other items that have this behaviour as item B increases with time.
Any idea on how to use Matlab code to find out which set of items have a positive correlation with item B with time?
Thank you.

回答 (1 件)

Torsten
Torsten 2022 年 8 月 22 日
編集済み: Torsten 2022 年 8 月 23 日
format long
A = [1 2 0 4;0 2 3 4;0 1 2 3;1 3 4 2;0 0.5 1 1.5].';
R = corrcoef(A)
R = 5×5
1.000000000000000 0.485714285714286 0.529150262212918 -0.377964473009227 0.529150262212918 0.485714285714286 1.000000000000000 0.982707629823991 0.529150262212918 0.982707629823991 0.529150262212918 0.982707629823991 1.000000000000000 0.400000000000000 1.000000000000000 -0.377964473009227 0.529150262212918 0.400000000000000 1.000000000000000 0.400000000000000 0.529150262212918 0.982707629823991 1.000000000000000 0.400000000000000 1.000000000000000
  3 件のコメント
Learning
Learning 2022 年 8 月 22 日
I want to compare items A, C, D, and E to that of B and determine which of them has the best positive correlation to item B.
Torsten
Torsten 2022 年 8 月 23 日
編集済み: Torsten 2022 年 8 月 23 日
As you can see from the second column, the correlation between B and C and B and E is greatest (and equal).

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

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by