| Title: | Statistical Quality Control Simulation |
|---|---|
| Description: | This is a set of statistical quality control functions, that allows plotting control charts and its iterations, process capability for variable and attribute control, highlighting the xrs_gr() function, like a first iteration for variable chart, meanwhile the we_rules() function detects non random patterns in sample. |
| Authors: | Erick Marroquin [aut, cre] |
| Maintainer: | Erick Marroquin <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 0.2 |
| Built: | 2026-05-31 10:28:45 UTC |
| Source: | https://github.com/cran/XRSCC |
Calculates the control limits for each type of variable or attribute control chart, then using an iteration to get the true control limits
| Package: | XRSCC |
| Type: | Package |
| Version: | 0.1 |
| Date: | 2016-05-04 |
| License: | GPL |
Erick Marroquin
Maintainer: Erick Marroquin <[email protected]>
Calculates and plots the risk of not detecting shifts and the Average Run Length
Beta.X(k,n)Beta.X(k,n)
k |
A numeric vector, of length one, is the k standard deviations factor since the known mean |
n |
An integer, equal the sample size |
beta |
risk of not detecting shifts |
ARL |
Average Run Lengh |
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
Beta.X(k=1,n=5) Beta.X(k=0.5,n=5) Beta.X(k=1,n=3)Beta.X(k=1,n=5) Beta.X(k=0.5,n=5) Beta.X(k=1,n=3)
The data give the number of defective bottles in a fixed sample size
data(bottles)data(bottles)
A data frame with 80 observations on the following variable.
Da numeric vector of integer number of defective bottles
data(bottles) require(XRSCC) p_gr(bottles, n=100)data(bottles) require(XRSCC) p_gr(bottles, n=100)
Calculates the c control chart for attributes, using a sample C of number of nonconformities. The plotted values in graph are the nonconformities number on each sample at a regular time interval when there is not a standard given.
c_gr(C)c_gr(C)
C |
A data frame or a vector containing the number of nonconformities per sample. Note that the variable name must be the uppercase letter, like D. |
in.control |
The under control row list for the c chart |
out.control |
The out of control row list for the c chart |
Iteraciones |
The number of iterations, in this function always will be the first and the last one |
data.0 |
The original data frame |
data.1 |
Subsetting the data frame with under control rows |
bin |
The binary values for out of control equal to one, and results under control equal to zero |
Limites de Control Grafica \emph{c} |
The c chart control limits vector |
Conclusion del proceso |
The same results in a phrase as the bin values |
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
p_gr, np_gr, u_gr, P_it, NP_it, C_it, U_it
data(clothes) c_gr(clothes)data(clothes) c_gr(clothes)
Calculates the iteration i'th, for the control limits of c chart using the results obtained in c_gr and previous C_it iteration.
C_it(prev.results)C_it(prev.results)
prev.results |
Its a list of previous results obtained by the |
in.control |
The under control row list for the c chart |
out.control |
The out of control row list for the c chart |
Iteraciones |
The number of iterations, It is assumed to be the second or later |
data.0 |
The original data frame or vector |
data.1 |
The under control subset after iteration |
bin |
The binary values for out of control equal to one and under control equal to zero |
Limites de Control Grafica \emph{c} |
The c chart control limits vector |
Conclusion del proceso |
The same results in a phrase as the bin values |
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
p_gr, np_gr, u_gr, c_gr, P_it, NP_it, U_it
data(clothes) r1<-c_gr(clothes) r2<-C_it(r1) r3<-C_it(r2)data(clothes) r1<-c_gr(clothes) r2<-C_it(r1) r3<-C_it(r2)
The data give a defectives number in a clothes process
data(clothes)data(clothes)
A data frame with 90 observations on the following variable.
ca numeric vector of integer number of nonconformities in a sample
require(XRSCC) data(clothes) c_gr(clothes)require(XRSCC) data(clothes) c_gr(clothes)
The data give a nonconformities number in a clothes process in a variable sample
data(clothes2)data(clothes2)
A data frame with 90 observations and two variables.
da numeric vector of integer number of nonconformities in a sample
na numeric vector of sample size
require(XRSCC) data(clothes2) u_gr(clothes2)require(XRSCC) data(clothes2) u_gr(clothes2)
Given a variable sample, the function calculates the process capability and, assuming a normal distribution of the X chart, after the true control limits were found.
Cp_X(prev.results, LES, LEI, mu)Cp_X(prev.results, LES, LEI, mu)
prev.results |
Is a list of previous results obtained by the |
LES |
A numeric vector of length one, containing the upper specification limit. |
LEI |
A numeric vector of length one, containing the lower specification limit. |
mu |
A numeric vector of length one, containing the average specification, if not exists, function takes the Control Limit of previous results. |
The function stops for the lack of any arguments.
Cp |
The process capability index |
Cpk |
The process capability index in case is not centered |
P.cp |
The specification range percentage used by the control limits |
X.sigma |
The process standard deviation |
Conclusion del proceso |
A phrase to take conclusion about the process capability |
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
data(vol_sample) results1<-xrs_gr(vol_sample) results2<-X_it(results1) # Type dev.off() function before use Cp_X Cp_X(results2, LES=510, LEI=490, mu=500)data(vol_sample) results1<-xrs_gr(vol_sample) results2<-X_it(results1) # Type dev.off() function before use Cp_X Cp_X(results2, LES=510, LEI=490, mu=500)
A sample containing piston hole length in mm
data(dato2)data(dato2)
A data frame with 45 subgroup of 5 observations
n1a numeric vector of length in mm
n2a numeric vector of length in mm
n3a numeric vector of length in mm
n4a numeric vector of length in mm
n5a numeric vector of length in mm
data(dato2) require(XRSCC) results1<-xrs_gr(dato2) results2<-X_it(results1) results3<-R_it(results2)data(dato2) require(XRSCC) results1<-xrs_gr(dato2) results2<-X_it(results1) results3<-R_it(results2)
A data frame containing the factor for variable control charts calculations.
data(factor.a)data(factor.a)
A data frame with factors (ex: A2, d2, D4 and so on) for size groups from 2 to 25.
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
data(factor.a)data(factor.a)
Calculates the np control chart for attributes, using a sample D of number of defectives or nonconforming items and a constant sample size n. The values plotted in graph are the defectives number.
np_gr(D, n)np_gr(D, n)
D |
A data frame containing the non conforming items, and must be integer and non negative. |
n |
A vector of length one, integer and nonnegative, to fix the sample size. |
in.control |
The under control row list for the np chart |
out.control |
The out of control row list for the np chart |
Iteraciones |
The number of iterations, in this function always will be the first and the last one |
data.n |
The fixed sample size |
data.0 |
The original data frame |
data.1 |
The filtered data frame |
bin |
The binary values for out of control equal to one and under control equal to zero |
Limites de Control Grafica \emph{np} |
The np chart control limits vector |
Conclusion del proceso |
The same results in a phrase as the bin values |
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
p_gr, u_gr, c_gr, P_it, NP_it, C_it, U_it
data(bottles) np_gr(bottles, n=100)data(bottles) np_gr(bottles, n=100)
Calculates the iteration i'th for the control limits of p chart using the results obtained in np_gr or further NP_it iterations.
NP_it(prev.results)NP_it(prev.results)
prev.results |
Is a list of previous results obtained by the |
in.control |
The under control row list for the np chart in this iteration |
out.control |
The out of control row list for the np chart |
Iteraciones |
The number of iterations, It is assumed to be the second or later |
data.n |
The fixed sample size |
data.0 |
The original data frame |
data.1 |
The under control subset after iteration |
bin |
The binary values for out of control equal to one and under control equal to zero |
Limites de Control Grafica \emph{np} |
The np chart control limits vector |
Conclusion del proceso |
The same results in a phrase as the bin values |
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
p_gr, np_gr, c_gr, u_gr, P_it, C_it, U_it
data(bottles) r1<-np_gr(bottles, n=100) r2<-NP_it(r1) r3<-NP_it(r2)data(bottles) r1<-np_gr(bottles, n=100) r2<-NP_it(r1) r3<-NP_it(r2)
Calculates the p control chart for attributes, using a sample D of number of defectives or nonconforming items and a constant sample size n. The values plotted in graph are the fractions pof defectives.
p_gr(D, n)p_gr(D, n)
D |
A data frame containing in one column the non conforming items, and must be integer and non negative. |
n |
A vector of length one, integer and nonnegative, to fix the sample size. |
in.control |
The under control row list for the p chart |
out.control |
The out of control row list for the p chart |
Iteraciones |
The number of iterations, in this function always will be the first and the last one |
data.n |
The fixed sample size |
data.0 |
The original data frame |
data.1 |
The filtered data frame |
bin |
The binary values for out of control equal to one and under control equal to zero |
Limites de Control Grafica p |
The p chart control limits vector |
Conclusion del proceso |
The same results in a phrase as the bin values |
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
P_it, c_gr, C_it, np_gr, NP_it, u_gr, U_it
data(bottles) p_gr(bottles, n=100)data(bottles) p_gr(bottles, n=100)
Calculates the iteration i'th for the control limits of p chart using the results obtained in p_gr or further P_it iterations.
P_it(prev.results)P_it(prev.results)
prev.results |
Is a list of previous results obtained by the |
in.control |
The under control row list for the p chart in this iteration |
out.control |
The out of control row list for the p chart |
Iteraciones |
The number of iterations, It is assumed to be the second or later |
data.n |
The fixed sample size |
data.0 |
The original data frame |
data.1 |
The under control subset after iteration |
bin |
The binary values for out of control equal to one and under control equal to zero |
Limites de Control Grafica \emph{p} |
The p chart control limits vector |
Conclusion del proceso |
The same results in a phrase as the bin values |
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
p_gr, c_gr, C_it, np_gr, NP_it, u_gr, U_it
data(bottles) r1<-p_gr(bottles, n=100) r2<-P_it(r1) r3<-P_it(r2)data(bottles) r1<-p_gr(bottles, n=100) r2<-P_it(r1) r3<-P_it(r2)
A sample containing weights of sugar bags
data(qqsugar)data(qqsugar)
A data frame with 100 subgroup of ten observations
muestra1a numeric vector of weights in pounds
muestra2a numeric vector of weights in pounds
muestra3a numeric vector of weights in pounds
muestra4a numeric vector of weights in pounds
muestra5a numeric vector of weights in pounds
muestra6a numeric vector of weights in pounds
muestra7a numeric vector of weights in pounds
muestra8a numeric vector of weights in pounds
muestra9a numeric vector of weights in pounds
muestra10a numeric vector of weights in pounds
data(qqsugar) require(XRSCC) xrs_gr(qqsugar)data(qqsugar) require(XRSCC) xrs_gr(qqsugar)
Calculates the iteration i'th for R chart, after the X chart is under control. The function estimates if any value (range) is out of control limits, and returns a values list.
R_it(prev.results)R_it(prev.results)
prev.results |
Is a list of previous results obtained by the |
The function stops if the R chart is under control already, and also stops if there is not any active graphic device.
in.control |
The under control row list for the X chart |
R.in.control |
The under control row list for the R chart |
out.control |
The out of control row list for the X chart |
Iteraciones |
The number of iterations, It is assumed to be the second or later |
data.0 |
The original data frame |
data.1 |
The filtered data frame |
data.r.1 |
The calculated ranges of data.0 |
bin |
The binary values for out of control equal to one and under control equal to zero, for X and R charts |
LX |
The X chart control limits vector |
LR |
The R chart control limits vector |
Limites Grafixa X |
The X chart control limits vector |
Limites Grafixa R |
The R chart control limits vector |
Conclusion del proceso |
The same results in a phrase as the bin values |
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
data(dato2) results1<-xrs_gr(dato2) results2<-X_it(results1) results3<-R_it(results2)data(dato2) results1<-xrs_gr(dato2) results2<-X_it(results1) results3<-R_it(results2)
Calculates the u control chart for attributes, given a variable sample n and a number of nonconformities u per sample. The plotted values in graph are the average number of nonconformities per unit.
u_gr(U)u_gr(U)
U |
A data frame containing the number d of nonconformities per sample, the sample n can be variable. Note that the variable names must be lowercase letter, say d and n. |
in.control |
The under control row list for the u chart |
out.control |
The out of control row list for the u chart |
Iteraciones |
The number of iterations, in this function always will be the first and the last one |
data.0 |
The original data frame |
data.1 |
Subsetting the data frame with under control rows |
bin |
The binary values for out of control equal to one and under control equal to zero |
Limites de Control Grafica \emph{u} |
The u chart control limits vector |
Conclusion del proceso |
The same results in a phrase as the bin values |
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
p_gr, np_gr, c_gr, P_it, NP_it, C_it, U_it
data(udata2) u_gr(udata2)data(udata2) u_gr(udata2)
Calculates the iteration i'th for the control limits of c chart using the results obtained in c_gr and previous U_it iteration.
U_it(prev.results)U_it(prev.results)
prev.results |
Is a list of previous results obtained by the |
in.control |
The under control row list for the u chart |
out.control |
The out of control row list for the u chart |
Iteraciones |
The number of iterations, in this function always will be the first and the last one |
data.0 |
The original data frame |
data.1 |
Subsetting the data frame with under control rows |
bin |
The binary values for out of control equal to one and under control equal to zero |
Limites de Control Grafica \emph{u} |
The u chart control limits vector |
Conclusion del proceso |
The same results in a phrase as the bin values |
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
p_gr, np_gr, c_gr, u_gr, P_it, NP_it, C_it
data(udata2) r1<-u_gr(udata2) r2<-U_it(r1)data(udata2) r1<-u_gr(udata2) r2<-U_it(r1)
The data give a nonconformities number on a clothes manufacturing process, the sample size is fixed.
data(udata2)data(udata2)
A data frame with 90 observations and two variables.
da numeric vector of integer number of nonconformities in a sample
na numeric vector of sample size
require(XRSCC) data(udata2) u_gr(udata2)require(XRSCC) data(udata2) u_gr(udata2)
A volume sample in milliliters
data(vol_sample)data(vol_sample)
A data frame with 100 subgroup of five observations
n1a numeric vector of volume
n2a numeric vector of volume
n3a numeric vector of volume
n4a numeric vector of volume
n5a numeric vector of volume
data(vol_sample) require(XRSCC) xrs_gr(vol_sample)data(vol_sample) require(XRSCC) xrs_gr(vol_sample)
Estimates the first four Western Electric Rules for detecting patterns, starting with under control X chart obtained in the sequence xrs_gr, X_it, R_it functions. At the same time, plots the X chart including the zones above and below the central limit. For last, a binary value for each rule is presented if at least one rule is violated, '1' for 'yes', 0 for 'no'.
we_rules(prev.results)we_rules(prev.results)
prev.results |
Its a list of previous results obtained by the |
The previous results may say that the process is under control, but, it's a conclusion concerning the first Western Electric rule only.
Resultados de analisis |
A phrarse saying the process is or not under control |
Las siguientes reglas tienen al menos un grupo que viola la regla |
The conclussion about the Western Electric rules from 1 to 4, showing a binary response, '1' for 'yes', 0 for 'no'. |
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
SMALL, Bonnie B. (1956) Statistical Quality Control Handbook, 2th ed. Easton : Western Electric Co, Inc.
yhat The Yhat Blog. Machine Learning, Data Science, Engineering, [On line] http://blog.yhathq.com/posts/quality-control-in-r.html
data(qqsugar) results1<-xrs_gr(qqsugar) results2<-R_it(results1) we_rules(results2)data(qqsugar) results1<-xrs_gr(qqsugar) results2<-R_it(results1) we_rules(results2)
With the results of xrs_gr followed by previous X_it iterations, the function calculates the X control limits charts, using a data frame with a fixed subgroup size n. In the graph plotting, the function estimates if any value (row or subgroup average) is out of control limits, and returns a list with calculations. Also, gives the R chart and control limits, which will be used in R_it function.
X_it(prev.results)X_it(prev.results)
prev.results |
Is a list of previous results obtained by the |
The function stops if the X chart is under control already, and also stops if there is not any active graphic device.
in.control |
The under control row list for the X chart |
R.in.control |
The under control row list for the R chart |
out.control |
The out of control row list for the X chart |
Iteraciones |
The iterations number, It is assumed to be the second or later |
data.0 |
The original data frame |
data.1 |
The under control subset after iteration |
data.r.1 |
The calculated ranges of data.0 |
bin |
The binary values for out of control equal to one and under control equal to zero, for X and R charts |
LX |
The X chart control limits vector |
LR |
The R chart control limits vector |
Limites Grafixa X |
The X chart control limits vector |
Limites Grafixa R |
The R chart control limits vector |
Conclusion del proceso |
The same results in a phrase as the bin values |
For the true Range control limits calculation, use R_it.
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
data(vol_sample) results1<-xrs_gr(vol_sample) results2<-X_it(results1)data(vol_sample) results1<-xrs_gr(vol_sample) results2<-X_it(results1)
Calculates the control limits for X, R and S charts, using a data frame with a fixed subgroup size. Plots the corresponding graph, the function estimates if any value is out of the control limits, returns a list with calculations.
xrs_gr(X)xrs_gr(X)
X |
A sample in a dataframe object, with m rows like subgroups, and n columns like sample size. |
in.control |
The under control row list for the X chart |
R.in.control |
The under control row list for the R chart |
out.control |
The out of control row list for the X chart |
Iteraciones |
The iterations number, the firts and the last one on this function |
data.0 |
The original data frame |
data.1 |
The under control subset after iteration |
data.r.1 |
The calculated ranges of data.0 |
bin |
The binary values for out of control equal to one and under control equal to zero, for X, R and S charts |
LX |
The X chart control limits vector |
LR |
The R chart control limits vector |
LS |
The S chart control limits vector |
Limites Grafixa X |
The X chart control limits vector |
Limites Grafixa R |
The R chart control limits vector |
Limites Grafixa S |
The S chart control limits vector |
Conclusion del proceso |
The same results in a phrase as the bin values |
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
X_it, we_rules, R_it, Cp_X, Beta.X
data(vol_sample) results1<-xrs_gr(vol_sample)data(vol_sample) results1<-xrs_gr(vol_sample)