Reputation: 906
I'm using the following R code:
library(AcceptanceSampling)
x <- OC2c(50, 2, type="hypergeom", N=4000)
plot(x, xlim=c(0,0.2))
which generates the plot:
I will like to find the proportion when P(accept)
(Y-axis) is 0.1. Is there a way to do this in R? I have a feeling this package does not allow direct computation of that according to its documentation at https://cran.r-project.org/web/packages/AcceptanceSampling/AcceptanceSampling.pdf.
Upvotes: 0
Views: 29
Reputation: 16930
As far as I know, you can't get this exactly, but you can get close. x
is an S4 object, and the slots you're interested in here are paccept
and pd
. We can get the pd
value with the paccept
value closest to 0.1 of all the paccept
values:
idx <- which.min(abs(x@paccept - 0.1))
round(cbind(paccept = x@paccept[idx], pd = x@pd[idx]), 3)
# paccept pd
# [1,] 0.11 0.1
Upvotes: 1