Learn R Programming

AccSamplingDesign (version 0.0.4)

OCdata-accessors: Accessor Functions for OCdata Objects

Description

Accessor functions to retrieve components from OCdata objects, such as the acceptance probabilities, proportions nonconforming, and process mean estimates.

Usage

paccept(x)
pd(x)
process_means(x)

Value

A numeric vector corresponding to the requested OCdata component.

Arguments

x

An object of class OCdata as returned by OCdata.

Author

Ha Truong

Details

These functions provide a clean interface to access key components of OCdata objects.

  • paccept(x) returns the vector of probabilities of acceptance.

  • pd(x) returns the vector of proportions nonconforming (defective).

  • process_means(x) returns the estimated process means (only applicable for variable sampling plans).

Examples

Run this code
pdata <- OCdata(n = 125, c = 4, distribution = "binomial", 
               pd = seq(0, 0.15, by = 0.005))
paccept(pdata)
pd(pdata)

# Variable plan with process means
vpdata <- OCdata(n = 50, k = 1.5, distribution = "normal", USL = 10,
                sigma = 2, pd = seq(0.01, 0.1, by = 0.01))
process_means(vpdata)

Run the code above in your browser using DataLab