| Title: | Phase I Shewhart X-Bar Chart |
|---|---|
| Description: | The purpose of 'PH1XBAR' is to build a Phase I Shewhart control chart for the basic Shewhart, the variance components and the ARMA models in R for subgrouped and individual data. More details can be found: Yao and Chakraborti (2020) <doi: 10.1002/qre.2793>, Yao and Chakraborti (2021) <doi: 10.1080/08982112.2021.1878220>, and Yao et al. (2023) <doi: 10.1080/00224065.2022.2139783>. |
| Authors: | Yuhui Yao [aut, cre], Subha Chakraborti [ctb], Tyler Thomas [ctb], Jason Parton [ctb], Xin Yang [ctb] |
| Maintainer: | Yuhui Yao <[email protected]> |
| License: | GPL-3 |
| Version: | 0.11.3 |
| Built: | 2026-05-19 05:52:12 UTC |
| Source: | https://github.com/yuhuiyao88/ph1xbar |
The purpose of 'PH1XBAR' is to build a Phase I Shewhart control chart for the basic Shewhart, the variance components and the ARMA models in R for subgrouped and individual data. More details can be found: Yao and Chakraborti (2020) doi: 10.1002/qre.2793, Yao and Chakraborti (2021) doi: 10.1080/08982112.2021.1878220, and Yao et al. (2023) doi: 10.1080/00224065.2022.2139783.
The utility of this package is in building a Shewhart-type control chart based on new methods for subgrouped and individual data. The Phase I chart is based on the multivariate normal/t or ARMA process.
Maintainer: Yuhui Yao [email protected]
Other contributors:
Subha Chakraborti [email protected] [contributor]
Tyler Thomas [email protected] [contributor]
Jason Parton [email protected] [contributor]
Xin Yang [email protected] [contributor]
Champ, C.W., and Jones, L.A. (2004) Designing Phase I X-bar charts with small sample sizes. Quality and Reliability Engineering International. 20(5), 497-510
Yao, Y., Hilton, C.W., and Chakraborti, S. (2017) Designing Phase I Shewhart X-bar charts: Extended tables and software. Quality and Reliability Engineering International. 33(8), 2667-2672.
Yao, Y., and Chakraborti, S. (2021). Phase I monitoring of individual normal data: Design and implementation. Quality Engineering, 33(3), 443-456.
Yao, Y., and Chakraborti, S. (2021). Phase I process monitoring: The case of the balanced one-way random effects model. Quality and Reliability Engineering International, 37(3), 1244-1265.
Yao, Y., Chakraborti, S., Yang, X., Parton, J., Lewis Jr, D., and Hudnall, M. (2023). Phase I control chart for individual autocorrelated data: application to prescription opioid monitoring. Journal of Quality Technology, 55(3), 302-317.
Useful links:
#Build a Phase I basic Shewhart control chart data(grinder_data) PH1XBAR(grinder_data, nsim=10) # Build a Phase I individual control chart with an ARMA model data(preston_data) PH1ARMA(preston_data, nsim.process=10, nsim.coefs=10)#Build a Phase I basic Shewhart control chart data(grinder_data) PH1XBAR(grinder_data, nsim=10) # Build a Phase I individual control chart with an ARMA model data(preston_data) PH1ARMA(preston_data, nsim.process=10, nsim.coefs=10)
A dataset cotaining bore diameter measurements in mm
bore_diameter_databore_diameter_data
A matrix with 20 rows and 5 variables:
Diameter measurement at Position 1
Diameter measurement at Position 2
Diameter measurement at Position 3
Diameter measurement at Position 4
Diameter measurement at Position 5
Wooluru, Yerriswamy, D. R. Swamy, and P. Nagesh. "THE PROCESS CAPABILITY ANALYSIS-A TOOL FOR PROCESS PERFORMANCE MEASURES AND METRICS-A CASE STUDY." International Journal for Quality Research 8.3 (2014).
get Phase I corrected charting constant with an ARMA model
getCC.ARMA( fap0 = 0.05, interval = c(1, 4), m = 50, order = c(1, 0), phi.vec = 0.5, theta.vec = NULL, case = "U", method = "MLE+MOM", nsim.coefs = 100, nsim.process = 1000, burn.in = 50, sim.type = "Recursive", verbose = FALSE )getCC.ARMA( fap0 = 0.05, interval = c(1, 4), m = 50, order = c(1, 0), phi.vec = 0.5, theta.vec = NULL, case = "U", method = "MLE+MOM", nsim.coefs = 100, nsim.process = 1000, burn.in = 50, sim.type = "Recursive", verbose = FALSE )
fap0 |
nominal false Alarm Probabilty in Phase 1 |
interval |
searching range of charting constants for the exact method |
m |
number of observations |
order |
order for ARMA(p, q) model |
phi.vec |
a vector of length p containing autoregressive coefficient(s). When case = 'K', the vector must have a length equal to the first value in the order. If no autoregressive coefficent presents, set phi.vec = NULL |
theta.vec |
a vector of length q containing moving-average coefficient(s). When case = 'K', the vector must have a length equal to the first value in the order. If no moving-average coefficent presents, set theta.vec = NULL |
case |
known or unknown case. When case = 'U', the parameters are estimated, when case = 'K', the parameters need to be input |
method |
estimation method for the control chart. When method = 'Method 3' is maximum likehood estimations plus method of moments. Other options are 'Method 1' which is pure MLE and 'Method 2' which is pure CSS. |
nsim.coefs |
number of simulation for coeficients. It is functional when double.sim = TRUE. |
nsim.process |
number of simulation for ARMA processes |
burn.in |
number of burn-ins. When burn.in = 0, the ECM gets involved. When burn.in is large enough, the ACM gets involved. |
sim.type |
type of simulation. When sim.type = 'Matrix', the simulation is generated using matrix computation. When sim.type = 'Recursive', the simulation is based on a recursion. |
verbose |
print diagnostic information about fap0 and the charting constant during the simulations for the exact method |
Object type double. The corrected charting constant.
# load the data in the package as an example set.seed(12345) # Calculate the charting constant using fap0 of 0.05, and 50 observations getCC.ARMA(fap0=0.05, m=50, nsim.coefs=10, nsim.process=10)# load the data in the package as an example set.seed(12345) # Calculate the charting constant using fap0 of 0.05, and 50 observations getCC.ARMA(fap0=0.05, m=50, nsim.coefs=10, nsim.process=10)
get Phase I corrected charting constant
getCC.XBAR( m, fap0 = 0.05, var.est = c("S", "MR"), ub.cons = 1, method = c("exact", "BA"), interval = c(1, 4), nsim = 10000, nu = m - 1, lambda = 1, verbose = FALSE )getCC.XBAR( m, fap0 = 0.05, var.est = c("S", "MR"), ub.cons = 1, method = c("exact", "BA"), interval = c(1, 4), nsim = 10000, nu = m - 1, lambda = 1, verbose = FALSE )
m |
number of subgroups when the data are subgrouped or number of observations when the data are individual. |
fap0 |
nominal False Alarm Probabilty in Phase 1 |
var.est |
'S' - use mean-square-based estimator, 'MR' - use moving-range-based estimator |
ub.cons |
unbiasing constant |
method |
'exact' - calculate results using the exact method, 'BA' - calculate results using the Bonfferoni approximation |
interval |
searching range of charting constants for the exact method |
nsim |
number of simulation for the exact method |
nu |
degrees of freedom; When var.est = 'S', the degrees of freedom is that of the chi-squared distribution itself for the variance estimator. When var.est = 'MR', the degrees of freedom is that of the chi-squared distribution approximating to the actual distribution. |
lambda |
unbiasing constant for the chi-squared distribution approximation. When var.est = 'S', there is no need to do the unbiasing. When var.est = 'MR', the unbiasing constant needs to be used. |
verbose |
print diagnostic information about fap0 and the charting constant during the simulations for the exact method |
Object type double. The corrected charting constant.
set.seed(12345) # Calculate the charting constant using 10 simulations and mean-square-based estimator getCC.XBAR(fap0=0.05, m=20, nsim=10, var.est='S', verbose = TRUE) # Calculate the charting constant using 10 simulations and moving-range-based estimator getCC.XBAR(fap0=0.05, m=20, nsim=10, var.est='MR', verbose = TRUE)set.seed(12345) # Calculate the charting constant using 10 simulations and mean-square-based estimator getCC.XBAR(fap0=0.05, m=20, nsim=10, var.est='S', verbose = TRUE) # Calculate the charting constant using 10 simulations and moving-range-based estimator getCC.XBAR(fap0=0.05, m=20, nsim=10, var.est='MR', verbose = TRUE)
A dataset containing the thickness measurements in nm at different positions on the silicon wafer
grinder_datagrinder_data
A matrix with 30 rows and 5 variables:
Thickness measurement at Position 1 (outer circle)
Thickness measurement at Position 2 (outer circle)
Thickness measurement at Position 3 (middle circle)
Thickness measurement at Position 4 (middle circle)
Thickness measurement at Position 5 (inner circle)
Roes, Kit CB, and Ronald JMM Does. "Shewhart-type charts in nonstandard situations." Technometrics 37.1 (1995): 15-24
Build a Phase I individual control chart for the ARMA models. The charting constant is corrected by this approach.
PH1ARMA( X, cc = NULL, fap0 = 0.05, order = c(1, 0), plot.option = TRUE, interval = c(1, 4), case = "U", phi.vec = NULL, theta.vec = NULL, mu0 = NULL, sigma0 = NULL, method = "MLE+MOM", nsim.coefs = 100, nsim.process = 1000, burn.in = 50, sim.type = "Recursive", transform = "none", lambda = 1, standardize = FALSE, verbose = FALSE )PH1ARMA( X, cc = NULL, fap0 = 0.05, order = c(1, 0), plot.option = TRUE, interval = c(1, 4), case = "U", phi.vec = NULL, theta.vec = NULL, mu0 = NULL, sigma0 = NULL, method = "MLE+MOM", nsim.coefs = 100, nsim.process = 1000, burn.in = 50, sim.type = "Recursive", transform = "none", lambda = 1, standardize = FALSE, verbose = FALSE )
X |
input and it must be a vector (m by 1) |
cc |
nominal Phase I charting constant. If this is given, the function will not re-compute the charting constant. |
fap0 |
nominal false Alarm Probabilty in Phase I |
order |
order for ARMA(p, q) model |
plot.option |
- draw a plot for the process; TRUE - Draw a plot for the process, FALSE - Not draw a plot for the process |
interval |
searching range of charting constants for the exact method |
case |
known or unknown case. When case = 'U', the parameters are estimated, when case = 'K', the parameters need to be input |
phi.vec |
a vector of length p containing autoregressive coefficient(s). When case = 'K', the vector must have a length equal to the first value in the order. If no autoregressive coefficent presents, set phi.vec = NULL |
theta.vec |
a vector of length q containing moving-average coefficient(s). When case = 'K', the vector must have a length equal to the first value in the order. If no moving-average coefficent presents, set theta.vec = NULL |
mu0 |
value of the IC process mean. When case = 'K', the value needs to be provided. |
sigma0 |
value of the IC process standard deviation. When case = 'K', the value needs to be provided. |
method |
estimation method for the control chart. When method = 'MLE+MOM' is maximum likehood estimations plus method of moments. Other options are 'MLE' which is pure MLE and 'CSS' which is pure CSS. |
nsim.coefs |
number of simulation for coefficients. |
nsim.process |
number of simulation for ARMA processes |
burn.in |
number of burn-ins. When burn.in = 0, the simulated process is assumed to be in the initial stage. When burn.in is sufficiently large (e.g., the default value of 50), the simulated process is assumed to have reached a stable state. |
sim.type |
type of simulation. When sim.type = 'Recursive', the simulation is generated recursively, as in the ARMA model. When sim.type = 'Matrix', the simulation is generated using the covariance matrix among observations, derived from the relationship between the ARMA coefficient(s) and the partial autocorrelation(s). Note that sim.type = 'Matrix' is primarily used as a proof of concept and is not recommended for practical use due to its high computational cost. |
transform |
type of transformation. When transform = 'none', no transformation is performed. When transform = 'boxcox', the Box-Cox transformation is used. When transform = 'yeojohnson', the Yeo-Johnson transformation is used. |
lambda |
parameter used in the Box-Cox or Yeo-Johnson transformation. |
standardize |
Output standardized charting statistics instead of raw ones. When standardize = TRUE, the standardization is used. When standardize = FALSE, the standardization is not performed. |
verbose |
print diagnostic information about fap0 and the charting constant during the simulations for the exact method |
CL Object type double - central line
gamma Object type double - process variance estimate
cc Object type double - charting constant
order Object type integer - order for ARMA model
phi.vec Object type integer - values of autoregressors
theta.vec Object type integer - values of moving averages
LCL Object type double - lower charting limit
UCL Object type double - upper charting limit
CS Object type double - charting statistic
Yao, Y., Chakraborti, S., Yang, X., Parton, J., Lewis Jr, D., and Hudnall, M. (2023). Phase I control chart for individual autocorrelated data: application to prescription opioid monitoring. Journal of Quality Technology, 55(3), 302-317.
# load the data in the package as an example data(preston_data) # set number of simulations nsim.process <- 10 nsim.coefs <- 10 # An example using the default setting whose fap0 = 0.1 PH1ARMA(preston_data, nsim.process = nsim.process, nsim.coefs = nsim.coefs) # When users get an error message about the size of matrix, # the function needs to use the alternative simulation type as follows PH1ARMA(preston_data, fap0 = 0.05, nsim.process = nsim.process, nsim.coefs = nsim.coefs, sim.type = 'Recursive')# load the data in the package as an example data(preston_data) # set number of simulations nsim.process <- 10 nsim.coefs <- 10 # An example using the default setting whose fap0 = 0.1 PH1ARMA(preston_data, nsim.process = nsim.process, nsim.coefs = nsim.coefs) # When users get an error message about the size of matrix, # the function needs to use the alternative simulation type as follows PH1ARMA(preston_data, fap0 = 0.05, nsim.process = nsim.process, nsim.coefs = nsim.coefs, sim.type = 'Recursive')
Build a Phase I Shewhart control chart for the variance components model if the data are subgrouped or for the basic Shewhart model if the data are individual. The charting constant is correted by this approach.
PH1XBAR( X, cc = NULL, fap0 = 0.05, var.est = c("S", "MR"), ub.option = TRUE, method = c("exact", "BA"), plot.option = TRUE, interval = c(1, 4), nsim = 10000, transform = "none", lambda = 1, standardize = FALSE, verbose = FALSE )PH1XBAR( X, cc = NULL, fap0 = 0.05, var.est = c("S", "MR"), ub.option = TRUE, method = c("exact", "BA"), plot.option = TRUE, interval = c(1, 4), nsim = 10000, transform = "none", lambda = 1, standardize = FALSE, verbose = FALSE )
X |
input and it must be a matrix (m by n) or a vector (m by 1) |
cc |
nominal Phase I charting constant. If this is given, the function will not recompute the charting constant. |
fap0 |
nominal False Alarm Probabilty in Phase 1 |
var.est |
'S' - use mean-square-based estimator, 'MR' - use moving-range-based estimator |
ub.option |
TRUE - the standard deviation estimator corrected by a unbiasing constant. For S, it is c4 and for MR, it is d2. FALSE - no unbiasing constant |
method |
'exact' - calculate results using the exact method, 'BA' - calculate results using the Bonfferoni approximation |
plot.option |
- draw a plot for the process; TRUE - Draw a plot for the process, FALSE - Not draw a plot for the process |
interval |
searching range of charting constants for the exact method |
nsim |
number of simulation for the exact method |
transform |
type of transformation. When transform = 'none', no transformation is performed. When transform = 'boxcox', the Box-Cox transformation is used. When transform = 'yeojohnson', the Yeo-Johnson transformation is used. |
lambda |
parameter used in the Box-Cox or Yeo-Johnson transformation. |
standardize |
Output standardized charting statistics instead of raw ones. When standardize = TRUE, the standardization is used. When standardize = FALSE, the standardization is not performed. |
verbose |
print diagnostic information about fap0 and the charting constant during the simulations for the exact method |
CL Object type double - central line
var.est Object type double - variance estimate
ub.cons Object type double - unbiasing constant
cc Object type double - charting constant
m Object type integer - number of subgroups when X is a matrix or number of observations when X is a vector
nu Object type integer - degrees of freedom; When var.est = 'S', the degrees of freedom is that of the chi-squared distribution itself for the variance estimator. When var.est = 'MR', the degrees of freedom is that of the chi-squared distribution approximating to the actual distribution.
lambda Object type integer - chi-squared unbiasing constant for the chi-squared distribution approximation
LCL Object type double - lower charting limit
UCL Object type double - upper charting limit
CS Object type double - charting statistic
Champ, C.W., and Jones, L.A. (2004) Designing Phase I X-bar charts with small sample sizes. Quality and Reliability Engineering International. 20(5), 497-510
Yao, Y., Hilton, C.W., and Chakraborti, S. (2017) Designing Phase I Shewhart X-bar charts: Extended tables and software. Quality and Reliability Engineering International. 33(8), 2667-2672.
Yao, Y., and Chakraborti, S. (2021). Phase I monitoring of individual normal data: Design and implementation. Quality Engineering, 33(3), 443-456.
Yao, Y., and Chakraborti, S. (2021). Phase I process monitoring: The case of the balanced one-way random effects model. Quality and Reliability Engineering International, 37(3), 1244-1265.
set.seed(12345) # load the data in the package as an example data(grinder_data) # An example using a false alarm probability of 0.05, and 10 simulations PH1XBAR(grinder_data, fap0 = 0.05, nsim=10, verbose=TRUE)set.seed(12345) # load the data in the package as an example data(grinder_data) # An example using a false alarm probability of 0.05, and 10 simulations PH1XBAR(grinder_data, fap0 = 0.05, nsim=10, verbose=TRUE)
A dataset containing piston ring data
pistonring_datapistonring_data
A data frame with 25 rows and 5 variables:
Observation 1 in subgroups
Observation 2 in subgroups
Observation 3 in subgroups
Observation 4 in subgroups
Observation 5 in subgroups
Montgomery, Douglas C. 2005. Introduction to Statistical Quality Control. John Wiley & Sons.
A dataset containing prescription fentanyl consumption in Preston county, WV, measured using MME percapita. This is a subset from Rich et al. <doi: 10.21105/joss.02450>
preston_datapreston_data
A vector with 60 elements
Rich, S., Tran, A. B., Williams, A., Holt, J., Sauer, J., & Oshan, T. M. (2020). arcos and arcospy: R and Python packages for accessing the DEA ARCOS database from 2006-2014. Journal of Open Source Software, 5(53), 2450.
A dataset cotaining the 151st feature in SECOM dataset
semiconductor_datasemiconductor_data
A vector with 50 observations:
the 151st feature
McCann, Michael, and Adrian Johnston. 2008. “SECOM.” UCI Machine Learning Repository. DOI: https://doi.org/10.24432/C54305.
A dataset containing snowfalls measured in inches in Minneapolis/St. Paul, MN.
snowfall_datasnowfall_data
A data frame with 82 rows and 4 variables:
year of the snowfalls
snowfalls in January
snowfalls in February
snowfalls in March
Mukherjee, P. S. (2016). On phase II monitoring of the probability distributions of univariate continuous processes. Statistical Papers, 57(2), 539-562.