Package 'PH1XBAR'

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.2
Built: 2025-03-05 05:48:07 UTC
Source: https://github.com/bolus123/ph1xbar

Help Index


PH1XBAR: 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.

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.

Author(s)

Maintainer: Yuhui Yao [email protected]

Other contributors:

References

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.

See Also

Useful links:

Examples

#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)

Bore diameter in manufacturing automotive driver gears

Description

A dataset cotaining bore diameter measurements in mm

Usage

bore_diameter_data

Format

A data frame with 20 rows and 5 variables:

X1

Diameter measurement at Position 1

X2

Diameter measurement at Position 2

X3

Diameter measurement at Position 3

X4

Diameter measurement at Position 4

X5

Diameter measurement at Position 5

References

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

Description

get Phase I corrected charting constant with an ARMA model

Usage

getCC.ARMA(
  fap0 = 0.05,
  interval = c(1, 4),
  n = 50,
  order = c(1, 0, 0),
  phi.vec = 0.5,
  theta.vec = NULL,
  case = "U",
  method = "MLE+MOM",
  nsim.coefs = 100,
  nsim.process = 1000,
  burn.in = 50,
  sim.type = "Matrix",
  verbose = FALSE
)

Arguments

fap0

nominal false Alarm Probabilty in Phase 1

interval

searching range of charting constants for the exact method

n

number of observations

order

order for ARMA model

phi.vec

given vectors of autoregressive parameters for ARMA models

theta.vec

given vectors of moving-average parameters for ARMA models

case

known or unknown case. When case = 'U', the parameters are unknown and the charting constant is calculated based on a bootstrapping method. When case = 'K', the parameters are known and the charting constant is found using the quantile function of multivariate normal distribution

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

phi

vector of autoregressive coefficient(s). When case = 'K', it must be provided. The length must be the same as the first value in the order. It needs to be NULL if no autoregressor presents

theta

vector of moving-average coefficient(s). When case = 'K', it must be provided. The length must be the same as the third value in the order. It needs to be NULL if no moving average presents

Value

Object type double. The corrected charting constant.

Examples

# 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, n=50, nsim.coefs=10, nsim.process=10)

Random Flexible Level Shift Model

Description

get Phase I corrected charting constant

Usage

getCC.XBAR(
  m,
  fap0 = 0.05,
  var.est = c("S", "MR"),
  ub.cons = 1,
  method = c("exact", "BA"),
  interval = c(1, 5),
  nsim = 10000,
  nu = m - 1,
  lambda = 1,
  verbose = FALSE
)

Arguments

m

nominal false Alarm Probabilty in Phase 1

fap0

number of subgroups

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 for the Bonfferoni approximation

lambda

constant for the Bonfferoni approximation

verbose

print diagnostic information about fap0 and the charting constant during the simulations for the exact method

Value

Object type double. The corrected charting constant.

Examples

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)

Thickness measurement of silicon wafer

Description

A dataset containing the thickness measurements in nm at different positions on the silicon wafer

Usage

grinder_data

Format

A data frame with 30 rows and 5 variables:

pos1

Thickness measurement at Position 1 (outer circle)

pos2

Thickness measurement at Position 2 (outer circle)

pos3

Thickness measurement at Position 3 (middle circle)

pos4

Thickness measurement at Position 4 (middle circle)

pos5

Thickness measurement at Position 5 (inner circle)

References

Roes, Kit CB, and Ronald JMM Does. "Shewhart-type charts in nonstandard situations." Technometrics 37.1 (1995): 15-24


Phase I individual control chart with an ARMA model

Description

Build a Phase I individual control chart for the ARMA models. The charting constant is corrected by this approach.

Usage

PH1ARMA(
  X,
  cc = NULL,
  fap0 = 0.05,
  order = c(1, 0, 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 = "Matrix",
  standardize = TRUE,
  verbose = FALSE
)

Arguments

X

input and it must be a vector

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 model

plot.option

- 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

phi.vec

vector of autoregressive coefficient(s). When case = 'K', the vector needs to be provided with the length same as the first value in the order. If autoregressive coefficents does not present, phi needs to be NULL

theta.vec

vector of moving-average coefficient(s). When case = 'K', the vector needs to be provided with the length same as the third value in the order. If moving-average coefficents does not present, theta needs to be 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 coeficients.

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 large enough, the simulated process is assumed to be in the stable stage.

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.

standardize

Output standardized data instead of raw data

verbose

print diagnostic information about fap0 and the charting constant during the simulations for the exact method

Value

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

References

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.

Examples

# 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')

Phase I X-bar control chart with a corrected charting constant

Description

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.

Usage

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, 5),
  nsim = 10000,
  verbose = FALSE
)

Arguments

X

input and it must be a matrix

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; 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

verbose

print diagnostic information about fap0 and the charting constant during the simulations for the exact method

Value

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 observations

nu Object type integer - degrees of freedom

lambda Object type integer - chi-squared unbiasing constant

LCL Object type double - lower charting limit

UCL Object type double - upper charting limit

CS Object type double - charting statistic

References

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.

Examples

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)

Prescription fentanyl consumption in Preston county, WV

Description

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>

Usage

preston_data

Format

A vector with 60 elements

References

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.


Seasonal snowfall in inches in Minneapolis/St. Paul, MN

Description

A dataset containing snowfalls measured in inches in Minneapolis/St. Paul, MN.

Usage

snowfall_data

Format

A data frame with 82 rows and 4 variables:

Year

year of the snowfalls

jan

snowfalls in January

feb

snowfalls in February

mar

snowfalls in March

References

Mukherjee, P. S. (2016). On phase II monitoring of the probability distributions of univariate continuous processes. Statistical Papers, 57(2), 539-562.