plot.OCdata | R Documentation |
Plots the Operating Characteristic (OC) curve from an object of class "OCdata"
, either by proportion nonconforming or process mean levels.
## S3 method for class 'OCdata'
plot(x, by = c("pd", "mean"), ...)
x |
An object of class |
by |
A character string indicating the type of OC curve to plot. Options are:
|
... |
Additional graphical parameters passed to the |
This method visualizes the OC curve based on the content of the "OCdata"
object.
By default, the curve is plotted against the proportion of nonconforming items (@pd
). If by = "mean"
is specified and the plan includes valid mean-level estimates (@process_means
), the curve is plotted against mean levels.
If by = "mean"
is requested but no mean estimates are available (e.g., for attribute plans), a message will be shown and no plot will be drawn.
A plot showing the OC curve for the given attribute/variable sampling plan.
Ha Truong
OCdata
, optAttrPlan
, optVarPlan
# Attribute plan
plan_attr <- optAttrPlan(PRQ = 0.01, CRQ = 0.05)
oc_attr <- OCdata(plan_attr)
plot(oc_attr) # OC curve by pd (default)
plot(oc_attr, by = "mean") # Will show message if not available
# Variable plan
plan_var <- optVarPlan(PRQ = 0.025, CRQ = 0.1, USL = 0.1,
distribution = "normal", sigma=0.01)
oc_var <- OCdata(plan_var)
plot(oc_var) # OC curve by pd
plot(oc_var, by = "mean") # OC curve by mean levels
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.