我对pvalue使用了fdrtool,但我有一个错误:
if (max(x) >1| min(x) < 0) stop(“输入p值必须都在0到1的范围内!”)出错:缺少需要TRUE/FALSE的值
P值不小于0,大于1,p值范围为1,0。代码是:
n=40000
pval1<-vector(length=n)
pval1[1:n]= pv1list[["Pvalue"]]
fdr<-fdrtool(pval1,statistic="pvalue")发布于 2014-04-21 05:22:50
我运行你的代码没有问题(虽然我不能重现它,因为我没有对象"pvlist")。
由于你有一个缺失值错误,我的猜测是你在将csv文件读入R时遇到了问题。我推荐使用"read.table“函数,因为根据我的经验,它通常会从csv文件中读取数据而不会出错:
pvlist<- read.table("c:/pvslit.csv", header=TRUE,
sep=",", row.names="id")现在,您需要检查行数和错失率:
nrow(pvlist) # is this what you expect?
nrow(na.omit(pvlist)) # how many non-missing rows are there?此外,您还需要确保"p-value“列不是字符或因子:
str(pvlist) # examining the structure of the dataframe
pvlist[,2] <- as.numeric(pvlist[,2]) # assuming the 2nd column is the pvalue简而言之,您很可能在读取数据帧中的数据或数据类时遇到问题。
https://stackoverflow.com/questions/23187218
复制相似问题