필터 지우기
필터 지우기

Fisher's z transform with atanh() to rho goes to infinity

조회 수: 82 (최근 30일)
Alba Peris
Alba Peris 2023년 10월 31일
편집: MByk 2024년 5월 13일
I have run Spearman's correlations usign the following:
[rho, pval] = corr(A,B, 'type', 'Spearman', 'rows', 'complete');
I would like to conduct a fisher's z transform on my rho values so that I can compare them later on.
Doing
atanh(rho)
sometimes outputs Inf or -Inf (particularly when the output of rho is 1 / -1). In cases where the output of rho is 1.000 or -1.000 this doesn't occur.
I'm not entirely sure what I have missed or how I could fix this issue. Any help will be very much appreciated.

채택된 답변

Sam Chak
Sam Chak 2023년 10월 31일
이동: Sam Chak 2023년 10월 31일
Hi @Alba Peris, If you make sure that rho stays in the range , then will be finite.
rho = -0.999:0.001:0.999;
y = atanh(rho);
plot(rho, y), grid on, xlabel('\rho'), ylabel('y')
  댓글 수: 7
Sam Chak
Sam Chak 2024년 5월 13일
@MByk, Try this:
idx = find(abs(yOut - 1) < eps) % find the position
yOut(idx) = 0.9999
MByk
MByk 2024년 5월 13일
Thank you very much.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Genomics and Next Generation Sequencing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by