科学的数字处理
我正在使用包 qvalue,它具有以下预处理步骤,
if(min(p)<0 || max(p)>1) {
print("ERROR: p-values not in valid range"); return(0)
}
if(length(lambda)>1 && length(lambda)<4) {
print("ERROR: If length of lambda greater than 1, you need at least 4 values."); return(0)
}
m <- length(p)
我有 6000 个值,如下所示: 由于溢出的字符限制,我可以显示它们
[1] 0.3671178710 0.9360140780 0.2428194940 0.5185496048 0.3280692392
[6] 0.4681617243 0.3654880576 0.3121728291 0.6357866236 0.2576397417
[11] 0.7224965457 0.4020649535 0.1359902232 0.4313780172 0.7543924642
[16] 0.1915732183 0.4359938726 0.2705147307 0.5155629834 0.4446611542
[21] 0.6636414268 0.4666097886 0.5121170670 0.7911474854 0.0662147755
[26] 0.8659648750 0.0307181717 0.0910574293 0.7331402271 0.3078877515
[31] 0.8331673742 0.4992904913 0.0773711040 0.6134791426 0.6714738843
[36] 0.6620106441 0.3944466498 0.3330491388 0.7726571107 0.5989331217
[41] 0.4429749257 0.7650029317 0.7608016901 0.3642432987 0.1672484189
[46] 0.4305554981 0.4308085746 0.7999056710 0.8117493501 0.3325086551
[51] 0.7233274303 0.4939756680 0.7763859166 0.8281922847 0.5195117763
[56] 0.6581468025 0.7082172344 0.7201224910 0.8420571108 0.3118079731
[5996] 0.3066819785 0.6066206806 0.7524323861 0.6815655815 0.7105895186
每当我为该变量使用函数时: fdrq = qvalue(as.numeric( nd[,3]), fdr.level = 0.05 )
我收到错误:
[1] "ERROR: p-values not in valid range"
我试图查看最大值和最小值,看起来它在范围内。
> max(nd[,3])
[1] 1
> min(nd[,3])
[1] 0.0001641695
请提供可能存在问题的建议!这是处理十进制数的特殊方法吗……或者这是一个错误……
谢谢;
I am using package qvalue which has the following pre-processing step
if(min(p)<0 || max(p)>1) {
print("ERROR: p-values not in valid range"); return(0)
}
if(length(lambda)>1 && length(lambda)<4) {
print("ERROR: If length of lambda greater than 1, you need at least 4 values."); return(0)
}
m <- length(p)
I have 6000 values like the following: I could show them due to character limit of the overflow
[1] 0.3671178710 0.9360140780 0.2428194940 0.5185496048 0.3280692392
[6] 0.4681617243 0.3654880576 0.3121728291 0.6357866236 0.2576397417
[11] 0.7224965457 0.4020649535 0.1359902232 0.4313780172 0.7543924642
[16] 0.1915732183 0.4359938726 0.2705147307 0.5155629834 0.4446611542
[21] 0.6636414268 0.4666097886 0.5121170670 0.7911474854 0.0662147755
[26] 0.8659648750 0.0307181717 0.0910574293 0.7331402271 0.3078877515
[31] 0.8331673742 0.4992904913 0.0773711040 0.6134791426 0.6714738843
[36] 0.6620106441 0.3944466498 0.3330491388 0.7726571107 0.5989331217
[41] 0.4429749257 0.7650029317 0.7608016901 0.3642432987 0.1672484189
[46] 0.4305554981 0.4308085746 0.7999056710 0.8117493501 0.3325086551
[51] 0.7233274303 0.4939756680 0.7763859166 0.8281922847 0.5195117763
[56] 0.6581468025 0.7082172344 0.7201224910 0.8420571108 0.3118079731
[5996] 0.3066819785 0.6066206806 0.7524323861 0.6815655815 0.7105895186
Whenever I fun the function for this variable:
fdrq = qvalue(as.numeric( nd[,3]), fdr.level = 0.05 )
I am getting error:
[1] "ERROR: p-values not in valid range"
I tried to see the maximum and minimum, looks like it is in range.
> max(nd[,3])
[1] 1
> min(nd[,3])
[1] 0.0001641695
Please provide suggestion on what might be wrong ! is this something special on handling of decimal numbers ..... or this is a bug ...
Thanks;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我怀疑您有一个比 1 稍大一点的值,但它被打印为“1”:
您可以配置 R 以显示更多数字:
一个简单的解决方法可能是强制所有大于 1 的值恰好为 1.0:
< strong>我不知道这种解决方法对于您的情况是否明智。
I suspect that you have a value that's a tiny bit greater than 1, but that gets printed as "1":
You can configure R to display more digits:
A simple workaround might be to force all values greater than 1 to exactly 1.0:
Whether this workaround is a sensible thing to do in your case, I don't know.