Learn R Programming

AccSamplingDesign (version 0.0.4)

plot.AttrPlan: Plot the OC Curve for Attribute Sampling Plans

Description

Plots the Operating Characteristic (OC) curve for an attribute sampling plan object of class AttrPlan.

Usage

# S3 method for AttrPlan
plot(x, pd = NULL, ...)

Value

A plot showing the OC curve for the given attribute sampling plan.

Arguments

x

An object of class AttrPlan representing an attribute acceptance sampling plan.

pd

Optional vector of proportions of nonconforming items. If NULL (default), a range is automatically generated.

...

Additional graphical parameters passed to plot().

Author

Ha Truong

Details

This method computes and visualizes the probability of acceptance (P(accept)) as a function of the proportion of nonconforming items in the population, based on the attribute sampling plan.

The plot also includes reference lines at the plan's producer and consumer quality levels (PRQ, CRQ) and their corresponding acceptance probabilities.

See Also

optAttrPlan, accProb, OCdata

Examples

Run this code
# Create attribute plan
plan <- optAttrPlan(PRQ = 0.01, CRQ = 0.1)

# Plot OC curve
plot(plan)

# With custom pd
plot(plan, pd = seq(0, 0.15, by = 0.001))

Run the code above in your browser using DataLab