clFun {qAnalyst} | R Documentation |
Internal function to compute upper or lower confidence limits for the specified control chart
Description
clFun
calculates upper and lower confidence limits for control charts. Confidence limits are retuned as a vector.
Usage
clFun(x, sg, nSigma, cl, type = "xbar", xbarVariability = "auto", mu = NA, sigma = NA)
Arguments
x |
data vector
|
sg |
Subgroup variable. This argument has a different meaning according to chart type.
xbar , r and s charts: sg represents rational sub-group of observations. It can be specified either as a vector, of the same length of x of ordered subgroup id, or as a constant value that will be replicated along x. Subgroup dimension must be greather than one.
i and mr charts: sg represents the width of the window over which moving range are computed. Must be a scalar. Default value is set to two.
p , np and u charts: sg represents sample size of observation. It can be specified either as a vector, of the same length of x or as a constant value that will be replicated along x.
c chart: sg is not required
|
nSigma |
A vector or a scalar of parameters to be used by tests. If nSigma is not specified, tests are performed with nSigma default values. If nSigma is specified, its length must be of the same length as testType .
|
cl |
"u" or "l" respectively for upper or lower confidence limit
|
type |
Chart type. String identifying chart type. Charts can be of type: "xbar", "r", "s", "i", "mr", "p", "np", "u", "c".
|
xbarVariability |
How to compute variability for xbar charts.
"auto" : (default) use the ranges if all subgroups have the same numerosity, and it is less than 7; otherwise it use the standard deviations.
"r" : use the ranges for the variaibility of the xbar charts.
"s" : use the standard deviations for the variability of the xbar charts.
|
mu |
A scalar containing the process mean. Its use will be different depending from chart type.
xbar and i charts: mu represents the center line. If mu is specified also sigma must be specified. If mu is not specified, then the process mean is calculated from data.
p , np , c and u charts: mu represents the parameter value for the in-control process, and then the center line. If mu is not specified, then the process mean is calculated from data.
s , r and mr charts: mu is not used.
|
sigma |
A scalar containing the process within samples standard deviation. Its use will be different depending from chart type.
xbar and i charts: the within samples variability around the center line. If sigma is specified also mu must be specified. If sigma is not specified, then the process within samples standard deviation is calculated from data.
s chart: sigma represents the center line. If sigma is not specified, then the process standard within samples deviation is calculated from data.
r and mr charts: sigma is used to calculate the center line. If sigma is not specified, then the process standard within samples deviation is calculated from data.
p , np , c and u charts: sigma is not used.
|
Details
clFun allows to handle unequal sample size subgroups that makes confidence limits to vary. A warning is thrown if subgroup dimension is less than 2 when variables chart for groups are calculated.
Value
A vector of length equal to the number of points in the chart representing either lower o upper confidence limit.
Note
Internal function
Author(s)
Andrea Spano' and Giorgio Specicato
References
Montgomery, Statistical Quality Control
See Also
spc
, plot.spc
Examples
# brakeCap dataset
data(brakeCap)
clFun(x=brakeCap$hardness, sg=brakeCap$subgroup, nSigma=2, cl="u", type="xbar")
[Package
qAnalyst version 0.6.4
Index]