This function is used to compute statistics required by the c chart.
Usage
qcs.c(x, ...)
# S3 method for default
qcs.c(
x,
var.index = 1,
sample.index = 2,
covar.index = NULL,
covar.names = NULL,
data.name = NULL,
sizes = NULL,
center = NULL,
conf.nsigma = 3,
limits = NULL,
plot = FALSE,
...
)
# S3 method for qcd
qcs.c(x, center = NULL, conf.nsigma = 3, limits = NULL, 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
Optional. A value or a vector of values specifying the sample sizes associated with each group. For continuous data, the sample sizes are obtained counting the non-
NA
elements of thesample.index
vector. For attribute variable the argument sizes is required.- center
A value specifying the center of group statistics or the ''target'' value of the process.
- conf.nsigma
A numeric value used to compute control limits, specifying the number of standard deviations (if
conf.nsigma
> 1) or the confidence level (if 0 <conf.nsigma
< 1).- limits
A two-value vector specifying control limits.
- plot
Logical value. If
TRUE
a c chart should be plotted.
Examples
library(qcr)
data(circuit)
attach(circuit)
#> The following objects are masked from orangejuice:
#>
#> sample, size, trial
str(circuit)
#> 'data.frame': 46 obs. of 4 variables:
#> $ x : int 21 24 16 12 15 5 28 20 31 25 ...
#> $ sample: int 1 2 3 4 5 6 7 8 9 10 ...
#> $ size : int 100 100 100 100 100 100 100 100 100 100 ...
#> $ trial : logi TRUE TRUE TRUE TRUE TRUE TRUE ...
datos <- circuit
datos$sample <- 1:length(datos$x)
str(datos)
#> 'data.frame': 46 obs. of 4 variables:
#> $ x : int 21 24 16 12 15 5 28 20 31 25 ...
#> $ sample: int 1 2 3 4 5 6 7 8 9 10 ...
#> $ size : int 100 100 100 100 100 100 100 100 100 100 ...
#> $ trial : logi TRUE TRUE TRUE TRUE TRUE TRUE ...
sizes <- datos[,2]
datos.qcd <- qcd(data = datos, var.index = 1,sample.index = 2,
sizes = size, type.data = "atributte")
res.qcs <- qcs.c(datos.qcd)
summary(res.qcs)
#> c chart for datos
#>
#> Summary of group statistics:
#> c
#> Min. : 5.00
#> 1st Qu.:16.00
#> Median :19.00
#> Mean :19.17
#> 3rd Qu.:22.00
#> Max. :39.00
#>
#> Group sample size: 100
#> Number of groups: 46
#> Center of group statistics: 19.17391
#> Standard deviation: 4.378803
#>
#> Control limits:
#> LCL UCL
#> 6.037505 32.31032
#>
#> Beyond limits of control:
#> [1] 39 5
#>
#> Violationg runs:
#> [1] 12 15
plot(res.qcs)