Calculate the Hotelling T2 statistic for multivariate observations at phase I , to be used to build the corresponding control chart.
T2.1(estat, m, n)Return a vector with the Hotelling T2 statistics.
Before using this function it is necessary to execute the function "stats"(that calculate the auxiliary statistics involved in the T2 formula) and the function "data.1" (or other way to supply the data).
Montgomery, D.C.,(2008)."Introduction to Statistical Quality Control". Chapter 11. Wiley.
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