Implements the eight rules of Nelson (1984, 1985) plus a Western Electric "7 in a row" variant for backward compatibility. Returns a tidy tibble of rule violations.
Usage
shewhart_runs(
x,
rules = c("nelson_1_beyond_3s", "nelson_2_nine_same"),
center = NULL,
sigma = NULL
)Arguments
- x
Either a
shewhart_chartobject (most common) or a numeric vector of values. If a vector is supplied,centerandsigmamust also be provided.- rules
Character vector of rule keys to apply. Use
shewhart_rules_available()to see all options. Default applies Nelson 1 (beyond 3 sigma) and Nelson 2 (9 same side), the most commonly recommended pair.- center, sigma
Numeric scalars or vectors. Required only when
xis a numeric vector. Ignored otherwise.
Value
A tibble with columns position (integer, the index where
the rule fired), rule (character key), description (character
label), value (the value at that position) and severity
(currently always "out_of_control"; reserved for future
warning-level rules).
References
Nelson, L. S. (1984). The Shewhart Control Chart – Tests for Special Causes. Journal of Quality Technology, 16(4), 237-239. doi:10.1080/00224065.1984.11978921
Nelson, L. S. (1985). Interpreting Shewhart Xbar Control Charts. Journal of Quality Technology, 17(2), 114-117. doi:10.1080/00224065.1985.11978941
Western Electric Co. (1956). Statistical Quality Control Handbook.