rmcorr 封装 NaN 与 0 作为输出

问题描述 投票:0回答:0

使用 rmcorr 包,我在使用 rmcorr_mat 时得到 NaN 值。当我使用 rmcorr 函数时,我得到 NaN 但还有一条警告消息

Warning message:
In sqrt(SSFactor/(SSFactor + SSresidual)) : NaNs produced

我可以用 0 代替 NaN 吗? 对于某些人,我也得到了 0 的相关性。

有人可以解释一下 rmcorr 何时返回 NaN 和 0 的相关性吗?

谢谢

> =input_file$A001
 [1]  0  0  5  0  0  0  9  3 10 13  0  0 43 38  8  6 38 11 22  7
> input_file$A002
 [1]  0  0  0  0 11 25  0  0  6 11  0  0  0  0  0  0  0  0  5  6
>rmcorr(participant = factor(subject), measure1 = input_file$A001,measure2 = input_file$A002,CI.level = 0.95,CIs="analytic", dataset = input_file)
Repeated measures correlation

r
NaN

degrees of freedom
9

p-value
1

95% confidence interval
NaN NaN 

Warning message:
In sqrt(SSFactor/(SSFactor + SSresidual)) : NaNs produced

> rmcorr(participant = factor(subject), measure1 = input_file$A003,measure2 = input_file$A004,CI.level = 0.95,CIs="analytic", dataset = input_file)

Repeated measures correlation

r
0

degrees of freedom
9

p-value
1

95% confidence interval
-0.599875 0.599875 

> input_file$A003
 [1] 11  3  2 16  0  0 10  2  0  0  0  0  8 18  0  0  0  0  0  0
> input_file$A004
 [1]   0   0   0   0   0   0   0   0  33 106   0   0   0   0   0  45  48  99   0 151
r nan correlation
© www.soinside.com 2019 - 2024. All rights reserved.