필터 지우기
필터 지우기

How to extract a matrix from correlation matrix where r is positive and p-value significant

조회 수: 2 (최근 30일)
Hello, From a certain correlation matrix accompanied by p-values [r, p], I need to extract a new matrix where all those correlation co-efficients which are positive and significant at some predefined level (e.g., p<0.01) are set to 1 and all the rest are set to zero. Hence, the new matrix will be in binary form.
Could anyone help?
BR, Muhammad

채택된 답변

the cyclist
the cyclist 2011년 6월 19일
>> [r p] = corr(randn(10)); % Your actual r and p would go here instead.
>> new_r = zeros(size(r))
>> new_r(r>0 & p<0.01) = 1;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by