Title: | Improved Quality Control Charts |
---|---|
Description: | Builds statistical control charts with exact limits for univariate and multivariate cases. |
Authors: | Flavio Barros [aut, cre], Emanuel Barbosa [ctb], Elias Goncalves [ctb], Daniela Recchia [ctb] |
Maintainer: | Flavio Barros <[email protected]> |
License: | GPL-2 | file LICENSE |
Version: | 0.7 |
Built: | 2025-02-25 04:30:21 UTC |
Source: | https://github.com/flaviobarros/iqcc |
This function is used to update the phase II control chart with new observations.
add.data(datum2, estat, T2II, n, j, m = NULL)
add.data(datum2, estat, T2II, n, j, m = NULL)
datum2 |
The data set for the phase II. Shoul be a vector. |
estat |
The values of the auxiliary statistics. Should be a list with a vector with the mean of the mean vectors, a matrix with the average of the variance-covariance matrices and a matrix with the means. |
T2II |
A vector with the value of T2 statistic for one sample. |
n |
The sample size. For individual observations, use n = 1. |
j |
The index of the current sample. |
m |
The number of samples in phase I. Only needed if the phase I data set is show on the plot. |
To use this function it is necessary to have the output given by the function T2.2. At every step you should entry with the new data set.
Add the new observation to the current Hoteliing control chart for phase II.
Daniela R. Recchia, Emanuel P. Barbosa
mu <- c(5.682, 88.22) Sigma <- symMatrix(c(3.770, -5.495, 13.53), 2) datum <- data.1(20, 10, mu, Sigma) estat <- stats(datum, 20, 10, 2) datum2 <- data.2(estat, 10, p = 2) T2II <- T2.2(datum2, estat, 10) #Not showing the phase I data set. cchart.T2.2(T2II, 20, 10, 1, 25, 2) datum3 <- data.2(estat, 10, p = 2) add.data(datum3, estat, T2II, 10, 2) #Showing the phase I data set. cchart.T2.2(T2II, 20, 10, 1, 25, 2, datum = datum) datum3 <- data.2(estat, 10, p = 2) add.data(datum3, estat, T2II, 10, 2, 20) #Example with individual observations datum <- data.1(50, 1, mu, Sigma) estat <- stats(datum, 50, 1, 2) datum2 <- data.2(estat, 1, p = 2) T2II <- T2.2(datum2, estat, 1) #Not showing the phase I data set. cchart.T2.2(T2II, 50, 1, 1, 25, 2) datum3 <- data.2(estat, 1, p = 2) add.data(datum3, estat, T2II, 1, 2) #Showing the phase I data set. cchart.T2.2(T2II, 50, 1, 1, 25, 2, datum = datum) datum3 <- data.2(estat, 1, p = 2) add.data(datum3, estat, T2II, 1, 2, 50)
mu <- c(5.682, 88.22) Sigma <- symMatrix(c(3.770, -5.495, 13.53), 2) datum <- data.1(20, 10, mu, Sigma) estat <- stats(datum, 20, 10, 2) datum2 <- data.2(estat, 10, p = 2) T2II <- T2.2(datum2, estat, 10) #Not showing the phase I data set. cchart.T2.2(T2II, 20, 10, 1, 25, 2) datum3 <- data.2(estat, 10, p = 2) add.data(datum3, estat, T2II, 10, 2) #Showing the phase I data set. cchart.T2.2(T2II, 20, 10, 1, 25, 2, datum = datum) datum3 <- data.2(estat, 10, p = 2) add.data(datum3, estat, T2II, 10, 2, 20) #Example with individual observations datum <- data.1(50, 1, mu, Sigma) estat <- stats(datum, 50, 1, 2) datum2 <- data.2(estat, 1, p = 2) T2II <- T2.2(datum2, estat, 1) #Not showing the phase I data set. cchart.T2.2(T2II, 50, 1, 1, 25, 2) datum3 <- data.2(estat, 1, p = 2) add.data(datum3, estat, T2II, 1, 2) #Showing the phase I data set. cchart.T2.2(T2II, 50, 1, 1, 25, 2, datum = datum) datum3 <- data.2(estat, 1, p = 2) add.data(datum3, estat, T2II, 1, 2, 50)
Used to calculate the real probability of false alarm in the 3-sigma R chart.
alpha.risk(n)
alpha.risk(n)
n |
The sample size. |
This alpha risk is calculated under the exact R statistics distribution and its values for small sample sizes will be much larger than the reference value 0,0027.
Return the value of the alpha risk for a given sample size n.
Daniela R. Recchia, Emanuel P. Barbosa
alpha.risk(15)
alpha.risk(15)
This is a binomial data set used on P-charts.
A data frame with 25 observations on the following 4 variables.
Index.
The sample Size.
Number of non-conforming units per sample.
Proportion of non-conforming units per sample.
Montgomery, D.C.,2001."Introduction to Statistical Quality Control".
data(binomdata)
data(binomdata)
This function is used to calculate the bias correction constant c4 for the sample standard deviation statistic.
c4(n)
c4(n)
n |
The sample size. |
It is used to correct the bias for small sample sizes in the sample standard deviation statistic.
Return the value of c4 for a given sample size n.
Daniela R. Recchia, Emanuel P. Barbosa
c4(5)
c4(5)
This function builds p-charts.
cchart.p(x1 = NULL, n1 = NULL, type = "norm", p1 = NULL, x2 = NULL, n2 = NULL, phat = NULL, p2 = NULL)
cchart.p(x1 = NULL, n1 = NULL, type = "norm", p1 = NULL, x2 = NULL, n2 = NULL, phat = NULL, p2 = NULL)
x1 |
The phase I data that will be plotted (if it is a phase I chart). |
n1 |
A value or a vector of values specifying the sample sizes associated with each group for the phase I data. |
type |
The type of p-chart to be plotted. The options are "norm" (traditional Shewhart p-chart), "CF" (Cornish Fisher p-chart) and "std" (standardized p-chart). If not specified, a Shewhart p-chart will be plotted. |
p1 |
The data used to estimate the phat (x1 / n1). |
x2 |
The phase II data that will be plotted in a phase II chart. |
n2 |
A value or a vector of values specifying the sample sizes associated with each group for the phase II data. |
phat |
The estimate of p. |
p2 |
The values corresponding to x2 / n2. |
For a phase I p-chart, n1 must be specified and either x1 or p1. For a phase II p-chart, n2 must be specified, plus x2 or p2 and either phat, x1 and n1, or p1 and n1. The Shewhart is based on normal-aprroximation and should be used only for large values of np or n*p (n*p > 6).
Return a p-chart.
Daniela R. Recchia, Emanuel P. Barbosa
Montgomery, D.C.,(2008)."Introduction to Statistical Quality Control". Chapter 11. Wiley
data(binomdata) attach(binomdata) cchart.p(x1 = Di[1:12], n1 = ni[1:12]) cchart.p(x1 = Di[1:12], n1 = ni[1:12], type = "CF", x2 = Di[13:25], n2 = ni[13:25]) cchart.p(type = "std", p2 = Di[13:25], n2 = ni[13:25], phat = 0.1115833)
data(binomdata) attach(binomdata) cchart.p(x1 = Di[1:12], n1 = ni[1:12]) cchart.p(x1 = Di[1:12], n1 = ni[1:12], type = "CF", x2 = Di[13:25], n2 = ni[13:25]) cchart.p(type = "std", p2 = Di[13:25], n2 = ni[13:25], phat = 0.1115833)
This function builds a R control chart.
cchart.R(x, n, type = "norm", y = NULL)
cchart.R(x, n, type = "norm", y = NULL)
x |
The data to be plotted. |
n |
The sample size. |
type |
The type of R chart to be plotted. The options are "norm" (traditional Shewhart R chart) and "tukey" (exact R chart). If not specified, a Shewhart R chart will be plotted. |
y |
The data used in phase I to estimate the standard deviation. |
The Shewhart R chart was designed for phase I (at this moment). The limits of the exact R chart are the alpha/2 and 1-alpha/2 quantiles of the R distribution that are calculated as estimated process sd times the quantiles of the relative range (W=R/sigma) distribution.
Return a R control chart.
Daniela R. Recchia, Emanuel P. Barbosa
data(pistonrings) attach(pistonrings) cchart.R(pistonrings[1:25,], 5) cchart.R(pistonrings[26:40, ], 5, type = "tukey", pistonrings[1:25, ])
data(pistonrings) attach(pistonrings) cchart.R(pistonrings[1:25,], 5) cchart.R(pistonrings[26:40, ], 5, type = "tukey", pistonrings[1:25, ])
This function builds a S control chart.
cchart.S(x, type = "n", m = NULL)
cchart.S(x, type = "n", m = NULL)
x |
The data to be plotted. |
type |
A character string specifying the type of S control chart to be plotted where "n" plots a S chart with normalized probability limits and "e" plots a S chart with exact limits. |
m |
The sample sizes. Only necessary in the control chart with exact (probability) limits. |
The exact limits are the alpha/2 and 1-alpha/2 quantiles of the S distribution which is proportional to the square root of a chi-square distribution.
Return a S control chart.
Daniela R. Recchia, Emanuel P. Barbosa
data(softdrink) #S chart with normalized probability limits cchart.S(softdrink, type = "n") #S chart with exact probability limits cchart.S(softdrink, type = "e", 10)
data(softdrink) #S chart with normalized probability limits cchart.S(softdrink, type = "n") #S chart with exact probability limits cchart.S(softdrink, type = "e", 10)
Builds the phase I Hotelling control chart.
cchart.T2.1(T2, m, n, p)
cchart.T2.1(T2, m, n, p)
T2 |
The values of the T2 statistic. Shoul be a matrix. |
m |
The number of samples generated previously in data.1. |
n |
The size of each sample used previously in data.1. If they are individual obsersations, then use n = 1. |
p |
The dimension used previously in function data.1. |
It builds the Hotelling T2 control chart for multivariate normal data (m samples / samples of size n > 1), used retrospective / validation analysis (phase I); the control limits are based on the F distribution.
Return a control chart.
Daniela R. Recchia, Emanuel P. Barbosa
Montgomery, D.C.,(2008)."Introduction to Statistical Quality Control". Chapter 11. Wiley
mu <- c(5.682, 88.22) Sigma <- symMatrix(c(3.770, -5.495, 13.53), 2) datum <- data.1(20, 10, mu, Sigma) estat <- stats(datum, 20, 10, 2) T2 <- T2.1(estat, 20, 10) # estat is a list with the auxiliary statistics. T2 is a matrix with the values of the T2 statistic. cchart.T2.1(T2, 20, 10, 2)
mu <- c(5.682, 88.22) Sigma <- symMatrix(c(3.770, -5.495, 13.53), 2) datum <- data.1(20, 10, mu, Sigma) estat <- stats(datum, 20, 10, 2) T2 <- T2.1(estat, 20, 10) # estat is a list with the auxiliary statistics. T2 is a matrix with the values of the T2 statistic. cchart.T2.1(T2, 20, 10, 2)
Builds the sub group phase II Hotelling control chart.
cchart.T2.2(T2II, m, n, j, t, p, datum = NULL, stats = NULL, T2 = NULL)
cchart.T2.2(T2II, m, n, j, t, p, datum = NULL, stats = NULL, T2 = NULL)
T2II |
A vector with the value of T2 statistic for one sample. |
m |
The number of samples generated previously in data.1. |
n |
The size of each sample used previously in data.1. If they are individual observations, use n = 1. |
j |
The index of the current sample. |
t |
The maximum value of the x axis. |
p |
The dimension used previously in function data.1. |
datum |
The data set used in phase I. |
stats |
The auxiliary statistics created by the function stats. |
T2 |
The Hotelling T2 statistic for multivariate observations at phase I created by the function T2.1. |
It builds the Hotelling T2 control chart for multivariate normal data to be used in the operational phase (known as phase II); the control limits are based on the F distribution.
Return a control chart.
Daniela R. Recchia, Emanuel P. Barbosa
Montgomery, D.C.,(2008). "Introduction to Statistical Quality Control". Chapter 11. Wiley
mu <- c(5.682, 88.22) Sigma <- symMatrix(c(3.770, -5.495, 13.53), 2) datum <- data.1(20, 10, mu, Sigma) estat <- stats(datum, 20, 10, 2) datum2 <- data.2(estat, 10, p = 2) T2II <- T2.2(datum2, estat, 10) # For the first sample j = 1. T2II is a vector with the value of the firts T2 statistic. cchart.T2.2(T2II, 20, 10, 1, 25, 2) # Same of the above, but now showing the phase I data set. cchart.T2.2(T2II, 20, 10, 1, 25, 2, datum = datum) #Example with individual observations datum <- data.1(50, 1, mu, Sigma) estat <- stats(datum, 50, 1, 2) datum2 <- data.2(estat, 1, p = 2) T2II <- T2.2(datum2, estat, 1) # For the first sample j = 1. T2II is a vector with the value of the firts T2 statistic. cchart.T2.2(T2II, 50, 1, 1, 25, 2) # Same of the above, but now showing the phase I data set. cchart.T2.2(T2II, 50, 1, 1, 25, 2, datum = datum)
mu <- c(5.682, 88.22) Sigma <- symMatrix(c(3.770, -5.495, 13.53), 2) datum <- data.1(20, 10, mu, Sigma) estat <- stats(datum, 20, 10, 2) datum2 <- data.2(estat, 10, p = 2) T2II <- T2.2(datum2, estat, 10) # For the first sample j = 1. T2II is a vector with the value of the firts T2 statistic. cchart.T2.2(T2II, 20, 10, 1, 25, 2) # Same of the above, but now showing the phase I data set. cchart.T2.2(T2II, 20, 10, 1, 25, 2, datum = datum) #Example with individual observations datum <- data.1(50, 1, mu, Sigma) estat <- stats(datum, 50, 1, 2) datum2 <- data.2(estat, 1, p = 2) T2II <- T2.2(datum2, estat, 1) # For the first sample j = 1. T2II is a vector with the value of the firts T2 statistic. cchart.T2.2(T2II, 50, 1, 1, 25, 2) # Same of the above, but now showing the phase I data set. cchart.T2.2(T2II, 50, 1, 1, 25, 2, datum = datum)
This function builds a u-chart for the Poisson-based count data statistic.
cchart.u(x1 = NULL, n1 = NULL, type = "norm", u1 = NULL, x2 = NULL, n2 = NULL, lambda = NULL, u2 = NULL)
cchart.u(x1 = NULL, n1 = NULL, type = "norm", u1 = NULL, x2 = NULL, n2 = NULL, lambda = NULL, u2 = NULL)
x1 |
The phase I data that will be plotted (if it is a phase I chart). |
n1 |
A value or a vector of values specifying the sample sizes associated with each group for the phase I data. |
type |
The type of u-chart to be plotted. The options are "norm" (traditional Shewhart u-chart), "CF" (improved u-chart) and "std" (standardized u-chart). If not specified, a Shewhart u-chart will be plotted. |
u1 |
The sample ratios used to estimate the Poisson parameter (lambda). (x1 / n1). |
x2 |
The phase II data that will be plotted in a phase II chart. |
n2 |
A value or a vector of values specifying the sample sizes associated with each group for the phase II data. |
lambda |
The estimate of lambda. |
u2 |
The sample ratios of the phase II data (x2 / n2). |
For a phase I u-chart, n1 must be specified and either x1 or u1. For a phase II u-chart, n2 must be specified, plus x2 or u2 and either phat, x1 and n1, or u1 and n1. It is important to note that the normal approximation used in the Shewhart u-chart is valid only for n*u large. For small n*p , it should be used an "improved u chart" (with non-normal correction) given by using the argument "CF".
Returns a u-chart.
Daniela R. Recchia, Emanuel P. Barbosa
data(moonroof) attach(moonroof) cchart.u(x1 = yi[1:17], n1 = ni[1:17]) cchart.u(x1 = yi[1:17], n1 = ni[1:17], type = "CF", x2 = yi[18:34], n2 = ni[18:34]) cchart.u(type = "std", u2 = ui[18:34], n2 = ni[18:34], lambda = 1.4)
data(moonroof) attach(moonroof) cchart.u(x1 = yi[1:17], n1 = ni[1:17]) cchart.u(x1 = yi[1:17], n1 = ni[1:17], type = "CF", x2 = yi[18:34], n2 = ni[18:34]) cchart.u(type = "std", u2 = ui[18:34], n2 = ni[18:34], lambda = 1.4)
This function builds the X-bar and R control charts in the same window.
cchart.Xbar_R(x, sizes)
cchart.Xbar_R(x, sizes)
x |
The data to be plotted. |
sizes |
A value or a vector of values specifying the sample sizes associated with each group. |
Return the two control charts.
Daniela R. Recchia, Emanuel P. Barbosa.
data(pistonrings) attach(pistonrings) cchart.Xbar_R(pistonrings[1:25, ])
data(pistonrings) attach(pistonrings) cchart.Xbar_R(pistonrings[1:25, ])
Builds the x-bar control chart for phase I.
cchart.Xbar1(x, sizes)
cchart.Xbar1(x, sizes)
x |
The data to be plotted. |
sizes |
A value or a vector of values specifying the sample sizes associated with each group. |
Even if the data is not normal the x-bar statistic will be close to the normal by the central limit theorem.
Return a x-bar control chart for phase I.
Daniela R. Recchia, Emanuel P. Barbosa
data(pistonrings) cchart.Xbar1(pistonrings[1:25, ])
data(pistonrings) cchart.Xbar1(pistonrings[1:25, ])
Builds the x-bar control chart for phase II.
cchart.Xbar2(x, x2bar, sigma, sizes)
cchart.Xbar2(x, x2bar, sigma, sizes)
x |
The data to be plotted. |
x2bar |
The mean of means. |
sigma |
The standar deviation of the data. |
sizes |
A value or a vector of values specifying the sample sizes associated with each group. |
To use this function it is necessary to have the output given by the function XbarI.
Return a x-bar control chart for phase II.
Daniela R. Recchia, Emanuel P. Barbosa
data(pistonrings) stat <- cchart.Xbar1(pistonrings[1:25, ]) cchart.Xbar2(pistonrings[26:40, ], stat[[1]][1], stat[[1]][2])
data(pistonrings) stat <- cchart.Xbar1(pistonrings[1:25, ]) cchart.Xbar2(pistonrings[26:40, ], stat[[1]][1], stat[[1]][2])
This function is used to calculate the mean of the sample relative range (W statistic).
d2(n)
d2(n)
n |
The sample size. |
Return the value of d2 for a given sample size n.
Daniela R. Recchia, Emanuel P. Barbosa
d2(8)
d2(8)
This function is used to calculate the standard deviation of the sample relative range (W statistic).
d3(n)
d3(n)
n |
The sample size. |
Return the value of d3 for a given sample size n.
Daniela R. Recchia, Emanuel P. Barbosa
d3(7)
d3(7)
This function simulate a normal data set to be used in the phase I Hoteliing control charts.
data.1(m, n, mu, Sigma)
data.1(m, n, mu, Sigma)
m |
The number of samples to be generated. |
n |
The size of each sample. If they are individual observations, then use n = 1. |
mu |
The vector with the means of the data to be generated. |
Sigma |
The vector with the variance-covariance matrix of the data to be generated. |
Return an array with the simulated data.
Daniela R. Recchia, Emanuel P. Barbosa
mu <- c(5.682, 88.22) Sigma <- symMatrix(c(3.770, -5.495, 13.53), 2) #Simulated data with individual observations datum <- data.1(50, 1, mu, Sigma) #Simulated data with sub-group observations datum <- data.1(20, 10, mu, Sigma)
mu <- c(5.682, 88.22) Sigma <- symMatrix(c(3.770, -5.495, 13.53), 2) #Simulated data with individual observations datum <- data.1(50, 1, mu, Sigma) #Simulated data with sub-group observations datum <- data.1(20, 10, mu, Sigma)
This function simulate a normal data set to be used in the phase II Hotelling control charts.
data.2(estat, n, delta = 0, p)
data.2(estat, n, delta = 0, p)
estat |
The values of the auxiliary statistics. Should be a list with a matrix with the means, mean of the means and mean of the standard deviation. |
n |
The size of each sample. If they are individual observations, use n = 1. |
delta |
A value to be added on the vector of means. |
p |
The dimension. |
To use this function it is necessary to have the information about the phase I given by the functions data.1 and stats.
Return an array with the simulated data.
Daniela R. Recchia, Emanuel P. Barbosa
mu <- c(5.682, 88.22) Sigma <- symMatrix(c(3.770, -5.495, 13.53), 2) datum <- data.1(20, 10, mu, Sigma) # estat is the list with the values of the auxiliary statistics. estat <- stats(datum, 20, 10, 2) datum2 <- data.2(estat, 10, p = 2)
mu <- c(5.682, 88.22) Sigma <- symMatrix(c(3.770, -5.495, 13.53), 2) datum <- data.1(20, 10, mu, Sigma) # estat is the list with the values of the auxiliary statistics. estat <- stats(datum, 20, 10, 2) datum2 <- data.2(estat, 10, p = 2)
A data set used to build an u-charts.
A data frame with 34 observations on the following 4 variables.
Index.
The number of defects.
The sample size.
The proportion of defects.
Defect data for moonroof installation example.
DeVor, R.E.; Chang, T.; Sutherland, J.W., 2007. "Statistical Quality Design and Control".
See the source.
data(moonroof)
data(moonroof)
The Piston Rings data set was taken from Montgomery's book. It consists of 40 samples of size 5 each of values of the diameter of the piston rings.
A data frame with 40 observations on the following 5 variables.
The fisrt measure.
The second measure.
The third measure.
The fouth measure.
The fifth measure.
Montgomery, D.C.,(2008)."Introduction to Statistical Quality Control".4th Ed. Wiley
data(pistonrings)
data(pistonrings)
This function removes an undesirable data that might be out of control in you data set. It is used at Hotelling T2 control charts for phase I.
remove.data(datum, i)
remove.data(datum, i)
datum |
The data set. Should be an array. |
i |
The index in the matrix of the data to be removed. |
Return the new data set without the observation that was removed.
Daniela R. Recchia, Emanuel P. Barbosa
mu <- c(5.682, 88.22) Sigma <- symMatrix(c(3.770, -5.495, 13.53), 2) datum <- data.1(20, 10, mu, Sigma) # Removing the observatiob 13 from the data set "datum" and updating it: datum <- remove.data(datum, 13)
mu <- c(5.682, 88.22) Sigma <- symMatrix(c(3.770, -5.495, 13.53), 2) datum <- data.1(20, 10, mu, Sigma) # Removing the observatiob 13 from the data set "datum" and updating it: datum <- remove.data(datum, 13)
Consists of 15 samples of 10 bottles where it is measured the volume of soft drink.
A data frame with 15 lines and 10 columns.
The first measure.
The second measure.
The third measure.
The fourth measure.
The fifth measure.
The sixth measure.
The seventh measure.
The eigth measure.
The ninth measure.
The tenth measure.
Montgomery, D.C.,(2001)."Introduction to Statistical Quality Control".4th ed. Wiley.
data(softdrink)
data(softdrink)
This function calculate the auxiliary statistics necessary to build the control chart reference lines.
stats(datum, m, n, p)
stats(datum, m, n, p)
datum |
The data set. Should be an array. |
m |
The number of sub groups generated previously in data.1. |
n |
The size of each sub group used previously in data.1. |
p |
The dimension used previously in function data.1. |
To use this function it is necessary to have the information about the data.1.
Return the values of the three statistics: a vector with the mean of the means, the mean of the estimated variance-covariance matrixes and a matrix with the means of each sample.
Daniela R. Recchia, Emanuel P. Barbosa
mu <- c(5.682, 88.22) Sigma <- symMatrix(c(3.770, -5.495, 13.53), 2) #Example with individual observations datum <- data.1(50, 1, mu, Sigma) estat <- stats(datum, 50, 1, 2) #Example with sub-group observations datum <- data.1(20, 10, mu, Sigma) estat <- stats(datum, 20, 10, 2)
mu <- c(5.682, 88.22) Sigma <- symMatrix(c(3.770, -5.495, 13.53), 2) #Example with individual observations datum <- data.1(50, 1, mu, Sigma) estat <- stats(datum, 50, 1, 2) #Example with sub-group observations datum <- data.1(20, 10, mu, Sigma) estat <- stats(datum, 20, 10, 2)
Calculate the Hotelling T2 statistic for multivariate observations at phase I , to be used to build the corresponding control chart.
T2.1(estat, m, n)
T2.1(estat, m, n)
estat |
The values of the auxiliary statistics. Should be a list with a matrix with the means, mean of the means and mean of the standard deviation. |
m |
The number of samples generated previously in data.1. |
n |
The size of each samples used previously in data.1. |
Before using this function it is necessary to execute the function "stats"(that calculate the auxiliary statistics involved in the T2 formula) and the function "data.1" (or other way to supply the data).
Return a vector with the Hotelling T2 statistics.
Daniela R. Recchia, Emanuel P. Barbosa
Montgomery, D.C.,(2008)."Introduction to Statistical Quality Control". Chapter 11. Wiley.
mu <- c(5.682, 88.22) Sigma <- symMatrix(c(3.770, -5.495, 13.53), 2) #Example with individual observations datum <- data.1(50, 1, mu, Sigma) estat <- stats(datum, 50, 1, 2) T2.1(estat, 50, 1) #Example with sub group observations datum <- data.1(20, 10, mu, Sigma) estat <- stats(datum, 20, 10, 2) T2.1(estat, 20, 10)
mu <- c(5.682, 88.22) Sigma <- symMatrix(c(3.770, -5.495, 13.53), 2) #Example with individual observations datum <- data.1(50, 1, mu, Sigma) estat <- stats(datum, 50, 1, 2) T2.1(estat, 50, 1) #Example with sub group observations datum <- data.1(20, 10, mu, Sigma) estat <- stats(datum, 20, 10, 2) T2.1(estat, 20, 10)
Calculate the Hotelling T2 statistic for multivariate observations at phase II , to be used to build the corresponding control chart.
T2.2(datum2, estat, n)
T2.2(datum2, estat, n)
datum2 |
The data set for the phase II. Shoul be a vector. |
estat |
The values of the auxiliary statistics. Should be a list with a matrix with the means, mean of the means and mean of the standard deviation. |
n |
The size of each sample used previously in data.2. If they are individual observations, use n = 1. |
Before using this function it is necessary to execute the function "stats"(that calculate the auxiliary statistics involved in the T2 formula) and the function "data.2" (or other way to supply the data).
Return a vector with the Hotelling T2 statistics.
Daniela R. Recchia, Emanuel P. Barbosa
Montgomery, D.C.,(2008)."Introduction to Statistical Quality Control". Chapter 11. Wiley.
T2.1,stats, data.2, cchart.T2.2
mu <- c(5.682, 88.22) Sigma <- symMatrix(c(3.770, -5.495, 13.53), 2) #Example with individual observations datum <- data.1(50, 1, mu, Sigma) estat <- stats(datum, 50, 1, 2) datum2 <- data.2(estat, 1, p = 2) T2II <- T2.2(datum2, estat, 1) #Example with subgroup observations datum <- data.1(20, 10, mu, Sigma) estat <- stats(datum, 20, 10, 2) datum2 <- data.2(estat, 10, p = 2) T2II <- T2.2(datum2, estat, 10)
mu <- c(5.682, 88.22) Sigma <- symMatrix(c(3.770, -5.495, 13.53), 2) #Example with individual observations datum <- data.1(50, 1, mu, Sigma) estat <- stats(datum, 50, 1, 2) datum2 <- data.2(estat, 1, p = 2) T2II <- T2.2(datum2, estat, 1) #Example with subgroup observations datum <- data.1(20, 10, mu, Sigma) estat <- stats(datum, 20, 10, 2) datum2 <- data.2(estat, 10, p = 2) T2II <- T2.2(datum2, estat, 10)
This function is used to build a table of values for the constants d2, d3 and c4 for sucessive values of sample size n.
table.const(n)
table.const(n)
n |
The maximum size. |
It builds a table in matrix form with 3 columns (one for each constant) and one row for each value of n from 2 to a specified value.
Return the values of these three constants.
Daniela R. Recchia, Emanuel P. Barbosa
table.const(17)
table.const(17)
Builds a table with quantiles of the sample relative range distribution.
table.qtukey(alpha, n)
table.qtukey(alpha, n)
alpha |
The probability of type-I error of false alarm , that is equal to 1 minus the confidence level. |
n |
The maximum sample size. |
It is used the fact that the sample relative range distribution is the same as the sample studentized range distribution (tukey distribution) with infinity d.f. in the denominator . It is considered 4 quantiles: alpha/2 , alpha , 1-alpha and 1-alpha/2, for different sample size values .
Daniela R. Recchia, Emanuel P. Barbosa
table.qtukey(0.0027, 15)
table.qtukey(0.0027, 15)