Learn R Programming

ctsfeatures (version 1.2.2)

plot_ccc: Constructs a control chart for the cycle lengths of a categorical series

Description

plot_ccc constructs a control chart for the cycle lengths of a categorical series

Usage

plot_ccc(
  series,
  mu_t,
  lcl_t,
  ucl_t,
  plot = TRUE,
  title = "Control chart (cycles)",
  ...
)

Value

If plot = TRUE (default), represents the control chart for the cycle lengths. Otherwise, the function returns a matrix with the values of the standardized statistic for each time t

Arguments

series

An object of type tsibble (see R package tsibble), whose column named Value contains the values of the corresponding CTS. This column must be of class factor and its levels must be determined by the range of the CTS.

mu_t

The mean of the process measuring the cycle lengths.

lcl_t

The lower control limit.

ucl_t

The upper control limit.

plot

Logical. If plot = TRUE (default), returns the control chart. Otherwise, returns the standardized statistic.

title

The title of the graph.

...

Additional parameters for the function.

Author

Ángel López-Oriona, José A. Vilar

Details

Constructs a control chart of a CTS based on cycle lengths. The chart is based on the standardized statistic \(T_t=T_t^{(L)}+T_t^{(U)}\), with \(T_t^{(L)}=\min \left(0, \frac{C_t-\mu_t}{\left|L C L_t-\mu_t\right|}\right)\) and \(T_t^{(U)}=\max \left(0, \frac{C_t-\mu_t}{\left|U C L_t-\mu_t\right|}\right)\), where \(Z_t\) expresses the length of a cycle ending with a specific category, \(\mu_t\) denotes the mean of \(Z_t\) and \(LCL_t\) and \(UCL_t\) are lower and upper individual control limits, respectively. Note that an out-of-control alarm is signalled if \(T_t<-1\) or \(T_t>1\).

References

weiss2008visualctsfeatures

Examples

Run this code
sequence_1 <- SyntheticData1[which(SyntheticData1$Series==1),]
cycle_cc <- plot_ccc(series = sequence_1, mu_t = c(1, 1.5, 1),
lcl_t = rep(10, 600), ucl_t = rep(10, 600)) # Representing
# a control chart for the cycle lengths
cycle_cc <- plot_ccc(series = sequence_1, mu_t = c(1, 1.5, 1),
lcl_t = rep(10, 600), ucl_t = rep(10, 600), plot = FALSE) # Computing the
# corresponding standardized statistic

Run the code above in your browser using DataLab