计算qqp(分位数 - 比较图)图中置信区间(CI)之外的点数

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

我想在qqp(分位数比较图)图中找到计算出的置信区间(CI 95%)以外的点数的函数。

在我的例子中:

require(MASS)
require(car)

模拟60泊松值

Resp<-rpois(60,1)

拟合二项式负分布

nbinom <- fitdistr(Resp, "Negative Binomial")

用qqp绘图

qqp(Resp, "nbinom", size = nbinom$estimate[[1]], mu = nbinom$estimate[[2]])

qqp plot

现在我想使用任何函数来创建一个矢量,其中qqp(分位数比较图)图中的置信区间(CI)之外的点数。这个有可能?谢谢

r performance plot distribution data-fitting
1个回答
-1
投票

qqp()不计算置信区间以外的点数,但它会计算获得此计数所需的信息。如果更改,您可以简单地修改代码(car:::qqPlot.default):

outerpoints <- sum(ord.x > upper |  ord.x < lower)
print(outerpoints)
if (length(outerpoints) > -1) 
    outerpoints
else invisible(NULL)

输出显示置信区间以外的点数。

© www.soinside.com 2019 - 2024. All rights reserved.