shewhart {dfphase1} | R Documentation |
shewhart
computes, and, optionally, plots,
Shewhart-type Phase I control charts for detecting
changes in location and scale of univariate subgrouped data.
shewhart.normal.limits
pre-computes
the corresponding control limits when the in-control distribution is normal.
shewhart(x, subset, stat = c("XbarS", "Xbar", "S", "Rank", "lRank", "sRank"), aggregation = c("median", "mean"), plot = TRUE, FAP = 0.05, seed = 11642257, L = if (stat %in% c("XbarS", "Xbar", "S")) 1000 else 100000, limits = NA) shewhart.normal.limits(n, m, stat = c("XbarS", "Xbar", "S", "Rank", "lRank", "sRank"), aggregation = c("median", "mean"), FAP = 0.05, seed = 11642257, L = 100000)
x |
a nxm data numeric matrix (n observations gathered at m time points). |
n |
integer: size of each subgroup (number of observations gathered at each time point). |
m |
integer: number of subgroups (time points). |
subset |
an optional vector specifying a subset of subgroups/time points to be used |
stat |
character: the control statistic[s] to use; see Details. |
aggregation |
character:
it specify how to aggregate the subgroup means and standard deviations.
Used only when |
plot |
logical; if |
FAP |
numeric (between 0 and 1): desired false alarm probability. |
seed |
positive integer; if not |
L |
positive integer: number of Monte Carlo replications used to
compute the control limits. Unused by |
limits |
numeric: a precomputed vector of control limits.
The vector should contain (A,B1,B2)
when |
The implemented control charts are:
XbarS
: combination of the Xbar
and S
control charts described in the following.
Xbar
: chart based on plotting the subgroup means with control limits
mu.hat +/- A sigma.hat/sqrt(n)
where mu-hat (sigma.hat) denotes the estimate of the in-control mean (standard deviation) computed as the mean or median of the subgroup means (standard deviations).
S
: chart based on plotting the (unbiased) subgroup standard deviations
with lower control limit B1 x sigma.hat and
upper control limit B2 x sigma.hat.
Rank
: combination of the lRank
and sRank
control charts described in the following.
lRank
: control chart based on the standardized
rank-sum control statistic suggested by
Jones-Farmer et al. (2009) for detecting changes in the location parameter.
Control limits are of the type +/- C.
sRank
: control chart based on the standardized
rank-sum control statistic suggested by
Jones-Farmer and Champ (2010) for detecting changes in the scale parameter.
Control limits are of the type +/- D.
shewhart
returns an invisible list with elements
|
subgroup means; this element is present only if
|
|
subgroup standard deviation; this element is present only if
|
|
rank-based control statistics for detecting
changes in location; this element is present only if
|
|
rank-based control-statistics for detecting
changes in scale; this element is present only if
|
|
control limits. |
|
estimates
mu.hat and sigma.hat of the in-control
mean and standard deviation; these elements are present only if
|
|
input arguments. |
shewhart.normal.limits
returns a numeric vector
containing the limits.
If argument limits
is NA
, shewhart
computes the control limits using (i) the permutation approach if
stat
is Xbars
, Xbar
, S
and (ii) the distribution-free unconditional distribution
when stat
is Rank
, lRank
and sRank
.
In both cases, the resulting control chart is
distribution-free.
Pre-computed limits, such as those computed using
shewhart.normal.limits
, are not recommended
when stat
is XbarS
, Xbar
or S
.
Indeed, the resulting control chart will not be distribution-free.
When stat
is Rank
, lRank
or
sRank
, the control limits computed by
shewhart.normal.limits
are distribution-free in the class
of all univariate continuous distributions.
So, if user plan to apply rank-based control charts on a repeated
number of samples of the same size, pre-computing the control limits using
mshewhart.normal.limits
can reduce the overall computing time.
Giovanna Capizzi and Guido Masarotto.
L. A. Jones-Farmer, V. Jordan, C. W. Champs (2009) “Distribution-free Phase I control charts for subgroup location”, Journal of Quality Technology, 41, pp. 304–316.
L. A. Jones-Farmer, C. W. Champ (2010) “A distribution-free Phase I control chart for subgroup scale”. Journal of Quality Technology, 42, pp. 373–387.
# A simulated example set.seed(12345) y <- matrix(rt(100,3),5) y[,20] <- y[,20]+3 shewhart(y) # Reproduction of the control charts shown # by Jones-Farmer et. al. (2009,2010) data(colonscopy) u <- shewhart.normal.limits(NROW(colonscopy),NCOL(colonscopy),stat="lRank",FAP=0.1) u # control limits based on a limited number of replications # to avoid a (relatively) long execution time shewhart(colonscopy,stat="lRank",limits=u,L=10000) shewhart(colonscopy,stat="sRank",FAP=0.1,L=10000)