Calculate the Hotelling T² statistic for Phase I using estimated mean vector and covariance matrix. For individual observations (\(n = 1\)): \(T^2 = x_i' S^{-1} x_i\). For subgroups (\(n > 1\)): \(T^2_i = n (\bar{x}_i - \bar{\bar{x}})' S^{-1} (\bar{x}_i - \bar{\bar{x}})\).
Arguments
- estat
A list returned by
statswith three components:[[1]]grand mean vector,[[2]]pooled covariance matrix,[[3]]matrix of subgroup means (\(m \times p\)).- m
Number of subgroups (Phase I sample size).
- n
Subgroup size. Use \(n = 1\) for individual observations, \(n > 1\) for subgroups.
Details
Before using this function it is necessary to execute stats
(that calculates the auxiliary statistics involved in the T² formula) and
the function data.1 (or other way to supply the data).
Phase convention
Phase I --- uses parameters estimated from the same data being
plotted. The T² statistics are not independent.
Decision rule
A Phase I point signals when T² exceeds the UCL from
cchart.T2.1.
References
Montgomery, D.C., (2009). "Introduction to Statistical Quality Control". Chapter 11. Wiley.
Examples
mu <- c(5.682, 88.22)
Sigma <- miscTools::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)
#> [1] 1.63010843 4.92020396 1.54140603 2.96122927 0.24859337 0.52825846
#> [7] 6.37793912 4.47023938 0.28213725 1.34780483 0.23775930 1.75896711
#> [13] 2.80333336 0.77451939 3.70185703 0.67761718 2.60881542 0.07459600
#> [19] 3.26686800 1.06436244 0.63787579 0.15962278 8.03795869 0.23803994
#> [25] 4.58825929 0.67745231 0.05583719 0.20899034 10.95558897 0.12548359
#> [31] 1.48228606 1.05986251 2.63978937 0.87332724 3.77130072 1.80004590
#> [37] 1.41978289 1.58868763 0.31655744 0.06265461 4.70580564 0.67197986
#> [43] 1.30294367 5.74965846 0.39175984 1.16881545 0.85410895 2.95273285
#> [49] 0.84829113 1.47748803
#Example with sub group observations
datum <- data.1(20, 10, mu, Sigma)
estat <- stats(datum, 20, 10, 2)
T2.1(estat, 20, 10)
#> [1] 3.2842282 1.5617464 1.1382521 2.9967570 4.1172577 1.2393318 1.2037962
#> [8] 0.8167576 2.4744763 0.6787133 1.1616673 2.5645355 2.3503479 0.3277436
#> [15] 1.0340342 0.3318650 2.8054783 1.3435299 6.1620795 1.4261519