optPlan {AccSamplingDesign} | R Documentation |
Optimal Acceptance Sampling Plan
Description
Design optimal variable acceptance sampling plans based on specified parameters. Supports different distributions (binomial, normal, beta) and accommodates known or unknown standard deviation and process parameters.
Usage
optPlan(PRQ, CRQ, alpha = 0.05, beta = 0.10, USL = NULL, LSL = NULL,
distribution = c("binomial", "poisson", "normal", "beta"),
sigma_type = c("known", "unknown"),
theta_type = c("known", "unknown"),
sigma = NULL, theta = NULL)
Arguments
PRQ |
Producer's risk quality level (e.g., acceptable quality level). |
CRQ |
Consumer's risk quality level (e.g., rejectable quality level). |
alpha |
Producer's risk (Type I error), default is 0.05. |
beta |
Consumer's risk (Type II error), default is 0.10. |
USL |
Upper Specification Limit. Required for variable sampling plans. |
LSL |
Lower Specification Limit. Required for variable sampling plans. |
distribution |
Distribution type used in the plan. Can be |
sigma_type |
Indicates if the standard deviation ( |
theta_type |
Indicates if the process parameter ( |
sigma |
Known standard deviation of the process, if applicable. |
theta |
Known process parameter (e.g., mean), if applicable. |
Details
This function designs optimal acceptance sampling plans by balancing producer's and consumer's risks under specified quality levels. It supports plans for attributes (binomial) and variables (normal or beta distributions), including cases with unknown standard deviation or distributional parameters.
Value
Returns a list or data frame with optimal sample size(s) and critical value(s) based on the specified parameters and distribution.
Author(s)
Ha Truong
Examples
# Example usage (normal distribution, known sigma):
optPlan(PRQ = 0.005, CRQ = 0.03, alpha = 0.05, beta = 0.10,
distribution = "normal", sigma_type = "known")
# Example usage (beta distribution, unknown theta):
optPlan(PRQ = 0.025, CRQ = 0.10, alpha = 0.05, beta = 0.10,
distribution = "beta", theta = 6.6e8,
theta_type = "unknown", LSL = 5.65e-6)