how to filter variables after Pearson correlation test

1 回表示 (過去 30 日間)
Hugo
Hugo 2022 年 2 月 3 日
編集済み: Enrico Gambini 2022 年 2 月 3 日
Hi,
I am doing the Pearson correlation test to a matrix, using 8 variables. I am getting values from 0.01 to 0.95. How can I filter (eliminate) the variables that have a correlation higher than 0.95 (in pairs)? I am looking to have an array with those variables, like this: [var1 var5 var6 var7]
I thank you in advance,
Best regards,

採用された回答

Enrico Gambini
Enrico Gambini 2022 年 2 月 3 日
編集済み: Enrico Gambini 2022 年 2 月 3 日
I didn' fully get your question.
If you want to delete the variable columns from the matrix you can do the following:
%I will call your matrix "M"
M(:,[2:4,8])=[];% this will delete columns 2,3,4,8
Hope that this could be helpful

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by