plot.VarPlan | R Documentation |
Plots the Operating Characteristic (OC) curve for an object of class VarPlan
. Supports plotting against either the proportion of nonconforming items or the corresponding process mean levels, depending on availability.
## S3 method for class 'VarPlan'
plot(x, pd = NULL, by = c("pd", "mean"), ...)
x |
An object of class |
pd |
Optional numeric vector of proportions of nonconforming items to evaluate. If |
by |
Character string indicating which x-axis to use for plotting. Either |
... |
Additional graphical parameters passed to |
This plotting method visualizes the probability of acceptance (P(accept)
) against the desired metric, based on the parameters of a variable sampling plan.
If by = "pd"
, the x-axis represents the proportion of nonconforming items. If by = "mean"
and the plan defines limit_type
and spec_limit
, the function estimates corresponding process means using muEst
and plots the OC curve by those mean values.
Reference lines for the Producer's Risk Quality (PRQ) and Consumer's Risk Quality (CRQ), along with their respective acceptance probabilities, are shown when plotting by proportion.
A plot showing the OC curve for the given variable sampling plan, either by nonconforming proportion or mean level.
Ha Truong
optVarPlan
, accProb
, muEst
, OCdata
, plot.OCdata
# Variable sampling plan with specification limits
plan <- optVarPlan(
PRQ = 0.025, CRQ = 0.1,
alpha = 0.05, beta = 0.1,
distribution = "normal",
USL = 3, sigma = 0.1
)
# Plot by proportion nonconforming
plot(plan, by = "pd")
# Plot by estimated mean level (requires spec_limit and limit_type)
plot(plan, by = "mean")
# Custom pd vector
plot(plan, pd = seq(0.01, 0.15, by = 0.001))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.