我正在尝试使用来自'leaps'的逐步回归函数'regsubsets'进行cis-eQTL分析,该分析同时考虑了两个SNP。但出现以下错误。
> dim(datas)
[1] 271 314
> datas[1:5,1:5]
y mark_1 mark_2 mark_3 mark_4
c_1 -1.1392173 0.9443526 0.5833727 0.5833727 0.857006
c_2 -0.1954784 0.9443526 0.5833727 0.5833727 0.857006
c_3 0.2143703 -1.0550190 0.5833727 0.5833727 -1.162547
c_4 1.1392173 -1.0550190 -1.7078447 -1.7078447 -1.162547
c_5 -1.6117743 -1.0550190 -1.7078447 -1.7078447 -1.162547
> models <- regsubsets(y ~., data = datas, nvmax = 2, method = "seqrep")
Error in leaps.setup(x, y, wt = wt, nbest = nbest, nvmax = nvmax, force.in = force.in, :
NA/NaN/Inf in foreign function call (arg 3)
当我使用这些数据的子集时,可能是可行的。
> models <- regsubsets(y ~., data = datas[,1:100], nvmax = 2, method = "seqrep", really.big=T)
Reordering variables and trying again:
Warning message:
In leaps.setup(x, y, wt = wt, nbest = nbest, nvmax = nvmax, force.in = force.in, :
42 linear dependencies found
>
> models <- regsubsets(y ~., data = datas[,c(1,100:200)], nvmax = 2, method = "seqrep", really.big=T)
Reordering variables and trying again:
Warning message:
In leaps.setup(x, y, wt = wt, nbest = nbest, nvmax = nvmax, force.in = force.in, :
34 linear dependencies found
>
> models <- regsubsets(y ~., data = datas[,1:200], nvmax = 2, method = "seqrep", really.big=T)
Error in leaps.setup(x, y, wt = wt, nbest = nbest, nvmax = nvmax, force.in = force.in, :
NA/NaN/Inf in foreign function call (arg 3)
可能是什么问题?此外,还有更好的方法来做这些事情。 可以在https://docs.google.com/spreadsheets/d/1DXH3iVRAh-KFCgXDe4D4xpyBni6FSFj6K3YpqVWUBE4/edit?usp=sharing
中找到示例数据