フィルターのクリア

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 Center および File ExchangeGenomics 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