Learn R Programming

AccSamplingDesign (version 0.0.4)

optPlan: 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)

Value

Returns a list or data frame with optimal sample size(s) and critical value(s) based on the specified parameters and distribution.

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 "binomial", "normal", or "beta".

sigma_type

Indicates if the standard deviation (sigma) is known or unknown.

theta_type

Indicates if the process parameter (theta) is known or unknown.

sigma

Known standard deviation of the process, if applicable.

theta

Known process parameter (e.g., mean), if applicable.

Author

Ha Truong

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.

Examples

Run this code
# 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)

Run the code above in your browser using DataLab