This function is used to compute statistics required by the cusum chart.
Usage
qcs.cusum(x, ...)
# S3 method for default
qcs.cusum(
x,
var.index = 1,
sample.index = 2,
covar.index = NULL,
covar.names = NULL,
data.name = NULL,
sizes = NULL,
center = NULL,
std.dev = NULL,
decision.interval = 5,
se.shift = 1,
plot = FALSE,
...
)
# S3 method for qcd
qcs.cusum(
x,
center = NULL,
std.dev = NULL,
decision.interval = 5,
se.shift = 1,
plot = FALSE,
...
)
Arguments
- x
An object of class "qcd".
- ...
Arguments passed to or from methods.
- var.index
A scalar with the column number corresponding to the observed data for the variable (the variable quality). Alternativelly can be a string with the name of the quality variable.
- sample.index
A scalar with the column number corresponding to the index fo each group (sample).
- covar.index
Optional. A scalar or numeric vector with the column number(s) corresponding to the covariate(s). Alternativelly it can be a character vector with the names of the covariates.
- covar.names
Optional. A string or vector of strings indicating the names for the covariate columns. Only valid if there is more than one column of data. By default, takes the names from the original object.
- data.name
A string specifying the name of the variable which appears on the plots. If not provided, it is taken from the object given as data.
- sizes
A value or a vector of values specifying the sample sizes associated with each group.
- center
A value specifying the center of group statistics or the ''target'' value of the process.
- std.dev
A value or an available method specifying the within-group standard deviation(s) of the process.
Several methods are available for estimating the standard deviation.- decision.interval
A numeric value specifying the number of standard errors of the summary statistics at which the cumulative sum is out of control.
- se.shift
The amount of shift to detect in the process, measured in standard errors of the summary statistics.
- plot
Logical value. If
TRUE
a cusum chart should be plotted.
Examples
library(qcr)
data(pistonrings)
attach(pistonrings)
#> The following objects are masked from circuit:
#>
#> sample, trial
#> The following objects are masked from orangejuice:
#>
#> sample, trial
res.qcd <- qcd(pistonrings, type.data = "dependence")
res.qcs <- qcs.cusum(res.qcd, type = "cusum")
summary(res.qcs)
#> cusum chart for pistonrings
#>
#> Summary of group statistics:
#> cusum
#> Min. :73.99
#> 1st Qu.:74.00
#> Median :74.00
#> Mean :74.00
#> 3rd Qu.:74.01
#> Max. :74.02
#>
#> Group sample size: 5
#> Number of groups: 40
#> Center of group statistics: 74.0036
#> Standard deviation: 0.01007094
#>
#> Control limits:
#> [1] -5 5
#>
#> Beyond limits of control:
#> [1] 73.9902 74.0060 73.9966 74.0008 74.0074 73.9982 74.0092 73.9998 74.0016
#> [10] 74.0024 73.9982 73.9922 73.9974
#>
#> Violationg runs:
#> [1] 74.0196 74.0234 74.0128
plot(res.qcs)