# Hotelling's $T^2$ chart for subgroups with unequal size

I have been reading about Hotelling's $$T^2$$ control charts and I'm unsure on how to deal with the case where the mean observations come from unequal-sized subgroups.

Consider $$m$$ observations $$\mathbf{X}_1,\mathbf{X}_2, \ldots,\mathbf{X}_m$$ from a multivariate process that has $$p$$ variables being monitored. Thus, let's assume that $$\mathbf{X}_i \sim \mathcal{N}_p\left(\boldsymbol{\mu},\Sigma\right)$$ for $$i = 1,\ldots,m$$. Since $$\boldsymbol{\mu}$$ and $$\Sigma$$ are usually unknown, they will be estimated by $$\mathbf{\bar{\bar{x}}}=(1 / m) \sum_{i=1}^m \bar{\mathbf{x}}_i \qquad \text{and} \qquad S =(1 / m) \sum_{i=1}^m S_i,$$ where $$S_i$$ is the usual covariance matrix for observations in group $$i$$.Now, for $$T^2$$ control charts, the statistic $$T_i^2 = n (\bar{\mathbf{x}}_i - \mathbf{\bar{\bar{x}}})^T S^{-1}(\bar{\mathbf{x}}_i - \mathbf{\bar{\bar{x}}})$$ is typically used for the case where there are $$m$$ subgroups and each one consists of $$n$$ observations. This theoretical framework has been studied already (see, e.g., Alt, F. and Smith, N. (1988)). In this case, $$T_i^2 \sim \frac{p(m-1)(n-1)}{(m n-m-p+1)}F_{p,mn-m-p+1}.$$ So, the upper control limit is set as the upper quantile of this distribution (with a desired $$\alpha)$$. That is, $$UCL = \frac{p(m-1)(n-1)}{(m n-m-p+1)}F_{p,mn-m-p+1,\alpha}.$$ However, what happens if one has a process where subgroups are not of the same size? That is, what if the subgroups have sizes $$n_1, n_2, \ldots, n_m$$, respectively? I have considered using a statistic $$T_i^2 = n_i (\bar{\mathbf{x}}_i - \mathbf{\bar{\bar{x}}})^T S^{-1}(\bar{\mathbf{x}}_i - \mathbf{\bar{\bar{x}}}),$$ as it seems analogous to standardizing in a univariate setting, but then the upper control limit requires one $$n$$ value. Something seems off. Any help or pointing in the right direction will be appreciated!

• By unequal size of the subgroups, do you mean you have missing observation but only for some $i$ of X? Can you upload an example data-set? Commented Mar 29 at 6:30
• @Kozolovska By unequal size I mean that not all of the subgroups contain the same number of observations - this could be due to missing observations or simply due to the nature of a process. For very similar values of subgroup sizes, one could average them and use $\overline{n}$ in the statistics mentioned in the question. However, for more "wildly" varying sample sizes, I would expect the idea of an average sample size not to work well in practice, thus the need for an alternative. I will try to upload a reproducible example a bit later. Commented Mar 29 at 13:39
• Why not using pooled covariance matrix? see for example here: stats.stackexchange.com/a/400036/144600 Commented Mar 31 at 8:05
• @Spätzle Using the pooled covariance matrix is indeed a good way to estimate the underlying covariance. However, my question is in terms of the $T^2$ chart, i.e. to know the distribution of $T_i^2 = n (\bar{\mathbf{x}}_i - \mathbf{\bar{\bar{x}}})^T S^{-1}(\bar{\mathbf{x}}_i - \mathbf{\bar{\bar{x}}})$ and an appropriate control limit. The distribution of the statistics depend on $n$, and is problematic when they are not equal. Commented Mar 31 at 10:36
• See the first page here, might clarify: ncss.com/wp-content/themes/ncss/pdf/Procedures/NCSS/… Commented Mar 31 at 11:18