Skip to contents

This function is used to compute statistics required by the t2 of HOTELLING or Shewhart Multivariate chart.

Usage

mqcs.t2(x, ...)

# S3 method for default
mqcs.t2(
  x,
  data.name = NULL,
  limits = NULL,
  Xmv = NULL,
  S = NULL,
  colm = NULL,
  alpha = 0.01,
  phase = 1,
  method = "sw",
  plot = FALSE,
  ...
)

# S3 method for mqcd
mqcs.t2(
  x,
  limits = NULL,
  Xmv = NULL,
  S = NULL,
  colm = NULL,
  alpha = 0.01,
  phase = 1,
  method = "sw",
  plot = FALSE,
  ...
)

Arguments

x

An object of class 'mqcd'

...

Arguments passed to or from methods.

data.name

A string that specifies the title displayed on the plots. If not provided it is taken from the name of the object x.

limits

A two-values vector specifying the control limits.

Xmv

The mean vector. It is only specified for Phase II or when the parameters of the distribution are known.

S

The sample covariance matrix. It is only used for Phase II or when the parameters of the distribution are known.

colm

The number of samples (m) and it is only used in Hotelling control chart for Phase II.

alpha

It is the the significance level (0.01 for default)

phase

Allows to select the type of UCL to use. Only values of phase = 1 or 2 are allowed.

method

The method employed to compute the covariance matrix in the individual observation case. Two methods are used "sw" for compute according to (Sullivan,Woodall 1996a) and "hm" by (Holmes,Mergen 1993)

plot

Logical value. If TRUE a t2 chart should be plotted.

See also

Author

Edgar Santos-Fernandez

Examples


##
##  Continuous data 
##
library(qcr)
data(dowel1)
str(dowel1)
#> 'data.frame':	40 obs. of  2 variables:
#>  $ diameter: num  0.492 0.501 0.491 0.492 0.505 0.5 0.497 0.509 0.49 0.499 ...
#>  $ length  : num  0.988 1.011 1.008 0.97 1.003 ...
data.mqcd <- mqcd(dowel1)
res.mqcs <- mqcs.t2(data.mqcd)
summary(res.mqcs)
#> 
#> Summary of group statistics:
#>        V1         
#>  Min.   :0.09137  
#>  1st Qu.:0.60154  
#>  Median :1.66096  
#>  Mean   :1.95000  
#>  3rd Qu.:2.64402  
#>  Max.   :5.34020  
#> 
#> Number of quality characteristics:  2
#> Number of samples or observations:  40
#> Number of observations or sample size:  1
#> 
#> Mean Vector: 
#>  0.500875 1.001825
#> Covariance Matrix:
#>          diameter       length
#> [1,] 4.908654e-05 8.584936e-05
#> [2,] 8.584936e-05 4.199429e-04
#> 
#> Control limits: 
#>      lcl      ucl 
#>  0.00000 12.44888 
#> 
#> Number beyond limits: 0 
plot(res.mqcs, title =" Hotelling Control Chart for dowel1")


data(archery1)
str(archery1)
#>  num [1:24, 1:2, 1:3] 24.14 28.55 3.97 28.57 -3.43 ...
#>  - attr(*, "dimnames")=List of 3
#>   ..$ : NULL
#>   ..$ : chr [1:2] "x-coordinate" "y-coordinate"
#>   ..$ : NULL
#>  - attr(*, "names")= chr [1:144] "x-coordinate" "y-coordinate" NA NA ...
data.mqcd <- mqcd(archery1)
res.mqcs <- mqcs.t2(data.mqcd)
summary(res.mqcs)
#> 
#> Summary of group statistics:
#>        V1         
#>  Min.   :0.04769  
#>  1st Qu.:0.37341  
#>  Median :0.92883  
#>  Mean   :1.51997  
#>  3rd Qu.:2.11386  
#>  Max.   :6.16892  
#> 
#> Number of quality characteristics:  2
#> Number of samples or observations:  24
#> Number of observations or sample size:  3
#> 
#> Mean Vector: 
#>  6.779028 5.772917
#> Covariance Matrix:
#>           [,1]      [,2]
#> [1,] 105.25999  48.44271
#> [2,]  48.44271 149.28805
#> 
#> Control limits: 
#>      lcl      ucl 
#> 0.000000 9.958262 
#> 
#> Number beyond limits: 0 
plot(res.mqcs, title =" Hotelling Control Chart for archery1")