Calculate the Hotelling T2 statistic for multivariate observations at phase I , to be used to build the corresponding control chart.
Usage
T2.1(estat, m, n)
Arguments
estat
The values of the auxiliary statistics. Should be a list with a matrix with the means, mean of the means and mean of the standard deviation.
m
The number of samples generated previously in data.1.
n
The size of each samples used previously in data.1.
Details
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).
Value
Return a vector with the Hotelling T2 statistics.
Author(s)
Daniela R. Recchia, Emanuel P. Barbosa
References
Montgomery, D.C.,(2008)."Introduction to Statistical Quality Control". Chapter 11. Wiley.
See Also
stats, data.1, cchart.T2.1
Examples
mu <- c(5.682, 88.22)
Sigma <- 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)
#Example with sub group observations
datum <- data.1(20, 10, mu, Sigma)
estat <- stats(datum, 20, 10, 2)
T2.1(estat, 20, 10)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(IQCC)
Loading required package: qcc
Package 'qcc', version 2.6
Type 'citation("qcc")' for citing this R package in publications.
Loading required package: MASS
Loading required package: micEcon
If you have questions, suggestions, or comments regarding one of the 'micEcon' packages, please use a forum or 'tracker' at micEcon's R-Forge site:
https://r-forge.r-project.org/projects/micecon/
Loading required package: miscTools
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/IQCC/T2.1.Rd_%03d_medium.png", width=480, height=480)
> ### Name: T2.1
> ### Title: Hotelling T2 Statistic for Phase I.
> ### Aliases: T2.1
>
> ### ** Examples
>
> mu <- c(5.682, 88.22)
> Sigma <- 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] 0.57679525 1.52618370 4.48760620 1.41572413 2.58257411 0.24814671
[7] 1.09586309 4.51240499 1.26102548 0.09583315 6.87846390 0.37929354
[13] 0.75401733 3.86774169 0.04050108 3.80824094 1.66466617 0.73702173
[19] 1.15328105 3.63017010 4.55429759 0.29921678 0.79990624 0.58061666
[25] 1.79393908 0.06339286 2.24423755 0.51873954 0.10881320 0.43160575
[31] 0.42958063 1.36399114 1.46711150 2.92991956 0.59951447 0.06821394
[37] 3.35967844 0.14690402 1.09745858 1.00006458 0.26569371 5.18254304
[43] 0.80076302 1.28358006 1.51884935 7.25116780 1.40129833 2.00440594
[49] 0.06566077 0.32183246
> #Example with sub group observations
> datum <- data.1(20, 10, mu, Sigma)
> estat <- stats(datum, 20, 10, 2)
> T2.1(estat, 20, 10)
[1] 4.22269182 2.36138326 1.96361752 0.34970570 3.22983889 0.62598872
[7] 0.40668078 1.89365645 0.74631452 0.15596703 0.15140472 3.85123893
[13] 4.76880919 0.27349115 0.09229975 1.45059342 4.07052592 2.00818692
[19] 1.93369967 0.07936566
>
>
>
>
>
> dev.off()
null device
1
>