AccSamplingDesign
An R package for designing and analyzing acceptance sampling plans.
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.6%) to scientific vocabulary
Repository
An R package for designing and analyzing acceptance sampling plans.
Basic Info
- Host: GitHub
- Owner: vietha
- License: gpl-3.0
- Language: R
- Default Branch: main
- Size: 260 KB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 2
Metadata Files
README.md
AccSamplingDesign 
An R package for designing and analyzing acceptance sampling plans
📦 Now available on
CRAN! 🎉 —
Overview
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.
Key Features
- 🔍 Attribute Sampling (Binomial, Poisson): Decisions based on
defect counts
- 📈 Variable Sampling (Normal, Beta): Including compositional
data
- ⚙️ Risk-Based Optimization: Minimize sample size under
alphaandbetaconstraints - 📊 OC Curve Visualization: Plot Operating Characteristic curves
- 🔄 Custom Plan Comparison: Evaluate user-defined vs. optimized plans
Installation
``` r
Install from CRAN
install.packages("AccSamplingDesign")
Or install development version from GitHub
devtools::install_github("vietha/AccSamplingDesign")
Load the package
library(AccSamplingDesign) ```
Examples
📌 Attribute Sampling (Binomial)
``` r plan_attr <- optPlan( 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(planattr) accProb(planattr, 0.03) # P(accept) if 3% defective plot(plan_attr) # OC curve ```
📌 Variable Sampling (Normal, Known Sigma)
``` r planvar <- optPlan( PRQ = 0.025, CRQ = 0.1, alpha = 0.05, beta = 0.10, distribution = "normal", sigmatype = "known" )
summary(planvar) plot(planvar) ```
📌 Variable Sampling (Normal, Unknown Sigma)
``` r planvar2 <- optPlan( PRQ = 0.025, CRQ = 0.1, alpha = 0.05, beta = 0.10, distribution = "normal", sigmatype = "unknown" )
summary(plan_var2) ```
📌 Variable Sampling (Beta, Known Theta)
``` r planbeta <- optPlan( PRQ = 0.05, CRQ = 0.2, alpha = 0.05, beta = 0.10, distribution = "beta", theta = 44000000, thetatype = "known", LSL = 0.00001 # Lower Specification Limit )
summary(planbeta) plot(planbeta) # By defect level plot(plan_beta, by = "mean") # By mean value ```
📌 Variable Sampling (Beta, Unknown Theta)
``` r planbeta <- optPlan( PRQ = 0.05, CRQ = 0.2, alpha = 0.05, beta = 0.10, distribution = "beta", theta = 44000000, thetatype = "unknown", LSL = 0.00001 )
summary(planbeta) plot(planbeta) # By defect level plot(plan_beta, by = "mean") # By mean value ```
📌 Compare Custom vs. Optimal Plans
``` r pd <- seq(0, 0.15, by = 0.001)
ocopt <- OCdata(plan = planattr, pd = pd)
mplan1 <- manualPlan(n = planattr$n, c = planattr$c - 1, distribution = "binomial") oc_alt1 <- OCdata(plan = mplan1, pd = pd)
plot(pd, ocopt$paccept, type = "l", col = "blue", lwd = 2, xlab = "Proportion Defective", ylab = "Probability of Acceptance", main = "OC Curves Comparison for Attributes Sampling Plan") lines(pd, ocalt1$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) ```
Additional Notes
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:
- Schilling, E.G., & Neubauer, D.V. (2017). Acceptance Sampling in
Quality Control (3rd ed.). CRC Press.
- Wilrich, P.T. (2004). In Frontiers in Statistical Quality Control
7.
- Govindaraju, K., & Kissling, R. (2015). Quality Engineering, 27(1), 1–13.
Contributing
Contributions, suggestions, and bug reports are welcome!
Please use GitHub
Issues or submit a
pull request.
Owner
- Name: Truong Viet Ha
- Login: vietha
- Kind: user
- Location: Viet Nam
- Company: DSV JSC
- Website: http://tisme.org/
- Repositories: 23
- Profile: https://github.com/vietha
GitHub Events
Total
- Release event: 2
- Public event: 1
- Push event: 59
- Create event: 1
Last Year
- Release event: 2
- Public event: 1
- Push event: 59
- Create event: 1
Packages
- Total packages: 1
-
Total downloads:
- cran 320 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 6
- Total maintainers: 1
cran.r-project.org: AccSamplingDesign
Acceptance Sampling Plans Design
- Homepage: https://github.com/vietha/AccSamplingDesign
- Documentation: http://cran.r-project.org/web/packages/AccSamplingDesign/AccSamplingDesign.pdf
- License: GPL-3
-
Latest release: 0.0.6
published about 1 year ago
Rankings
Maintainers (1)
Dependencies
- methods * imports
- stats * imports
- knitr * suggests
- rmarkdown * suggests