The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.
An R package for designing and analyzing acceptance sampling
plans
π¦ Now available on CRAN! π
β
The AccSamplingDesign package provides flexible tools to create and evaluate acceptance sampling plans in quality control, for both attributes (pass/fail) and variables (measurable) data. It supports optimization using nonlinear programming (NLP) to meet specified risks while minimizing the required sample size.
alpha
and beta
constraints# Install from CRAN
install.packages("AccSamplingDesign")
# Or install development version from GitHub
::install_github("vietha/AccSamplingDesign")
devtools
# Load the package
library(AccSamplingDesign)
<- optPlan(
plan_attr PRQ = 0.01, # Acceptable quality
CRQ = 0.05, # Rejectable quality
alpha = 0.02, # Producer's risk
beta = 0.15, # Consumer's risk
distribution = "binomial"
)
summary(plan_attr)
accProb(plan_attr, 0.03) # P(accept) if 3% defective
plot(plan_attr) # OC curve
<- optPlan(
plan_var PRQ = 0.025,
CRQ = 0.1,
alpha = 0.05,
beta = 0.10,
distribution = "normal",
sigma_type = "known"
)
summary(plan_var)
plot(plan_var)
<- optPlan(
plan_var2 PRQ = 0.025,
CRQ = 0.1,
alpha = 0.05,
beta = 0.10,
distribution = "normal",
sigma_type = "unknown"
)
summary(plan_var2)
<- optPlan(
plan_beta PRQ = 0.05,
CRQ = 0.2,
alpha = 0.05,
beta = 0.10,
distribution = "beta",
theta = 44000000,
theta_type = "known",
LSL = 0.00001 # Lower Specification Limit
)
summary(plan_beta)
plot(plan_beta) # By defect level
plot(plan_beta, by = "mean") # By mean value
<- optPlan(
plan_beta PRQ = 0.05,
CRQ = 0.2,
alpha = 0.05,
beta = 0.10,
distribution = "beta",
theta = 44000000,
theta_type = "unknown",
LSL = 0.00001
)
summary(plan_beta)
plot(plan_beta) # By defect level
plot(plan_beta, by = "mean") # By mean value
<- seq(0, 0.15, by = 0.001)
pd
<- OCdata(plan = plan_attr, pd = pd)
oc_opt
<- manualPlan(n = plan_attr$n, c = plan_attr$c - 1, distribution = "binomial")
mplan1 <- OCdata(plan = mplan1, pd = pd)
oc_alt1
plot(pd, oc_opt$paccept, type = "l", col = "blue", lwd = 2,
xlab = "Proportion Defective", ylab = "Probability of Acceptance",
main = "OC Curves Comparison for Attributes Sampling Plan")
lines(pd, oc_alt1$paccept, col = "red", lwd = 2, lty = 2)
legend("topright", legend = c("Optimal Plan", "Manual Plan (c - 1)"),
col = c("blue", "red"), lty = c(1, 2), lwd = 2)
This README provides a quick start for using the AccSamplingDesign package. For a full discussion of the statistical foundations, models, and optimization methods used, please refer to the foundation sources such as:
Contributions, suggestions, and bug reports are welcome!
Please use GitHub
Issues or submit a pull request.
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.