six_sigma_ctrl_chart: Generate IndX and mR charts.

Description Usage Arguments Value References Examples

Description

Generate IndX and mR charts.

Usage

1
2
3
4
5
six_sigma_ctrl_chart(x, linesColors = c("gray50", "gray65", "gray85", "black",
  "gray85", "gray65", "gray50"), applyRules = c(TRUE, TRUE, TRUE, TRUE, TRUE,
  TRUE, TRUE, TRUE), rulesColors = c("red", "yellow2", "green", "magenta",
  "blue", "orange", "brown", "cyan"), seg = c(), keepStats = TRUE,
  verbose = FALSE)

Arguments

x

(mandatory) A data frame with the individual values in the first column and the time in the second column. It can be either a factor, a date or a string and it will be ordered automatically.
See ?spcTimeSeries

linesColors

(optional) A vector with 7 colors in order from the average + 3 standard deviations to the average - 3 standard deviations, including the average itself in the center.
Default value is c("gray50", "gray65", "gray85", "black", "gray85", "gray65", "gray50")

applyRules

(optional) A vector with 8 boolean values indicating which rules must be applied.
Default value is c(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE)

rulesColors

(optional) A vector with colors, one for each rule. The last point of each violating run will be colored indicating the violation and the corresponding rule.
Default value is c("red", "yellow2", "green", "magenta", "blue", "orange", "brown", "cyan")

seg

(optional) A vector with the positions of the points where there should be breaks and another pair of charts should be plotted. It may be used for better visualization when the series is too long.
Default value is c()

keepStats

(optional) A boolean indicating if each segment's plot should be considered as part of the same series or independelty, as different series. If TRUE, it will be considered as part of the same series. If FALSE, each plot will have it's limits calculated independently, as well as the application of the rules. It's useful to compare different scenarios.
Default value is TRUE

verbose

(optional) A boolean indicating if mean, standard deviation/UCL and number of violations should be printed.
Default value is FALSE

Value

None

References

Engineering Statistics Handbook 6.3.2, NIST/SEMATECH e-Handbook of Statistical Methods National Institute of Standards and Technology, Dec 2006

https://en.wikipedia.org/wiki/Nelson_rules

Lloyd S. Nelson, "Technical Aids," Journal of Quality Technology 16, no. 4 (October 1984), 238-239.

The 8 rules are: 1 One point is more than 3 standard deviations from the mean. 2 Nine (or more) points in a row are on the same side of the mean. 3 Six (or more) points in a row are continually increasing (or decreasing). 4 Fourteen (or more) points in a row alternate in direction, increasing then decreasing. 5 Two (or three) out of three points in a row are more than 2 standard deviations from the mean in the same direction. 6 Four (or five) out of five points in a row are more than 1 standard deviation from the mean in the same direction. 7 Fifteen points in a row are all within 1 standard deviation of the mean on either side of the mean. 8 Eight points in a row exist with none within 1 standard deviation of the mean and the points are in both directions from the mean.

Examples

1
2
3
4
5

Example output

[1] "IndX Mean =  16.24"
[1] "IndX Std. dev.  =  6.93857610636638"
[1] "IndX Violations =  8"
[1] "mR Mean =  7.61616161616162"
[1] "mR UCL  =  24.882"
[1] "mR Violations =  1"
dev.new(): using pdf(file="Rplots1.pdf")
dev.new(): using pdf(file="Rplots2.pdf")
dev.new(): using pdf(file="Rplots3.pdf")
dev.new(): using pdf(file="Rplots4.pdf")
[1] "IndX Mean =  15.84"
[1] "IndX Std. dev.  =  7.63042156983042"
[1] "IndX Violations =  2"
[1] "mR Mean =  7.08333333333333"
[1] "mR UCL  =  23.14125"
[1] "mR Violations =  1"
dev.new(): using pdf(file="Rplots5.pdf")
[1] "IndX Mean =  19.48"
[1] "IndX Std. dev.  =  5.67244803120017"
[1] "IndX Violations =  1"
[1] "mR Mean =  7.04166666666667"
[1] "mR UCL  =  23.005125"
[1] "mR Violations =  0"
dev.new(): using pdf(file="Rplots6.pdf")
[1] "IndX Mean =  16.96"
[1] "IndX Std. dev.  =  6.96706537934014"
[1] "IndX Violations =  1"
[1] "mR Mean =  8.5"
[1] "mR UCL  =  27.7695"
[1] "mR Violations =  0"
dev.new(): using pdf(file="Rplots7.pdf")
[1] "IndX Mean =  12.68"
[1] "IndX Std. dev.  =  5.9"
[1] "IndX Violations =  0"
[1] "mR Mean =  8.04166666666667"
[1] "mR UCL  =  26.272125"
[1] "mR Violations =  0"

processcontrol documentation built on May 2, 2019, 9:50 a.m.