On this page
9.4 One-Way ANOVA - Random Effects
In the previous module we saw the ANOVA model with fixed effects and it differs from the model covered in this module, in which we modeled ANOVA with random effects. The distinction between these two models is best seen through an example.
In most mammal species the “sex” factor has two levels, which are “male” and “female”. For an analysis of this factor, for example, the female person transmits a large amount of information about the person, and this information is based on experience gained from many other people who were female. This person will have a set of attributes (associated with being a woman), no matter which population the person is part of.
Now, when we evaluate the level of mathematics education in a given city, we have the “school” factor. When we evaluate a level of this factor, school “A”, for example, it does not transmit any information about students' grades in mathematics teaching, if we do not have information about performance or performance classification published in research, and the teaching level of these schools can influence the conclusion about student grades. If we do not have this type of information, the school factor does not transmit any information about grades, unlike the sex factor which is informative.
Because the latter has this type of characteristic, the sex factor is modeled as fixed effects. As for the school factor, students' grades differ in many aspects, but we do not know exactly how or why they differ, so we model with random effects. In the case of sex, we know that males and females are likely to vary in characteristic and predictable ways, whereas in the case of student grades they are not. Therefore, to delve deeper into these concepts, we will present the ANOVA models with random effects.
9.4 ANOVA - Random Factors (One Factor)
The previous modules were devoted to a study of several models with common characteristics and the same numbers of observations were taken from each treatment or group in each row of the subsample. When these numbers are the same, the data is known as balanced data, now when the number of observations in the rows are not all equal, the data is known as unbalanced data. In general, it is desirable to have an equal number of observations in each subclass, as experiments with unbalanced data are much more complex and difficult to analyze and interpret than those with balanced data.
However, in many practical situations, it is not always possible to have an equal number of observations for treatments or groups. Even if an experiment is well designed to be balanced, it may run into problems during execution due to circumstances beyond the experimenter’s control, for example, missing values or deletion of faulty observations, can result in different sample sizes in different groups. In many cases, data may arise through sampling, in which the number of observations per group cannot be determined, or through an experiment intended to produce balanced data, but which may actually result in unbalanced data. We can cite as an example, that plants or animals can die, machines can break or fail and patients can even be removed from the study.
Inferences about variance components for unbalanced data are much more complicated than those for balanced data. The reason is that analysis of variance of balanced data is quite simple since there is a single partition of the total sum of squares into sum of squares components, which under the standard distribution assumptions follow a multiple of a Chi-Square distribution. This multiple being the product of the degrees of freedom and expected mean squares of one of the random effects. Thus, hypotheses about treatment effects can be tested by dividing the mean squares of one of the effects by the appropriate mean squared error to form a variance test relationship F. Imbalanced data do not have these properties, since there is no single partition of the total sum of squares and, consequently, there is no single analysis of variance. Furthermore, in any given decomposition, the component sums of squares are not independent or identically distributed as Chi-Square variables, and corresponding to any particular mean square treatment means that there is no mean squared error with equal expectation under the null hypothesis.
In this module we present the model of a random factor with balanced data, we emphasize that the deductions are similar to the ANOVA model with fixed effects. Next, we have the following model
$$y_{ij}=\mu+\alpha_i+\varepsilon_{ij}\quad\begin{cases} i=1,\dots, k \cr j=1,\dots,r \end{cases} \tag{1.1}$$
For this model $ \mu $ is a parameter common to all treatments and represents the general average of the data, $ \alpha_{i} $ is the effect due to the ith level of the factor. The random variable $ \varepsilon_{ij} $ corresponds to experimental random error, that is, the variability not explained by the model due to variations present in several sources not considered in the study.
Furthermore, we assume that the error has a Normal distribution with zero mean and variance $ \sigma^{2}_{\varepsilon} $ and that the errors are mutually independent. With this, we have to
$$\varepsilon_{ij}\sim~N(0,\sigma^{2}_{\varepsilon}).$$
Now, for the purpose $ \alpha_i $, we assume that it has a Normal distribution with zero mean and variance $ \sigma^2_{\alpha}. $ We also assume that the effects are mutually independent. So,
$$\alpha_{i}\sim~N(0,\sigma^{2}_{\alpha}).$$
Furthermore, we assume that we have no correlation between the effect $ \alpha_i $ and the experimental error $ \varepsilon_{ij} $ for everyone $ i,j. $ To illustrate this model we have the following example:
Example 4.1
An education specialist wants to evaluate the level of mathematics teaching for elementary school students in schools in his city. For this, a sampling was carried out among school students, in which a test was administered. Based on the data collected in the table, what can we say about the uniformity of teaching between schools?
| Note | School A | School B | School C | School D |
|---|---|---|---|---|
| 1 | 3,94 | 4,23 | 5,2 | 3,86 |
| 2 | 4,45 | 5,69 | 6,3 | 3,74 |
| 3 | 4,43 | 5,37 | 9,92 | 4,35 |
| 4 | 6,21 | 4,5 | 7,38 | 5 |
| 5 | 3,63 | 3,78 | 9,41 | 5,99 |
| 6 | 5,89 | 6,19 | 8,47 | 3,95 |
| 7 | 6,36 | 5,43 | 6,74 | 2,84 |
| 8 | 3,89 | 5,64 | 7,93 | 5,37 |
| 9 | 5,84 | 5,74 | 8,91 | 4,39 |
| 10 | 5,15 | 4,2 | 4,99 | 3,89 |
| 11 | 4,16 | 2,91 | 6,91 | 2,06 |
| 12 | 4,44 | 6,92 | 8,73 | 2,72 |
| 13 | 4,8 | 6,84 | 5,61 | 3,29 |
| 14 | 4,04 | 5,91 | 8,89 | 3,14 |
| 15 | 4,15 | 6,74 | 6,28 | 3,61 |
| 16 | 3,46 | 5,09 | 7,38 | 5,38 |
| 17 | 4,04 | 8,01 | 6,85 | 4,24 |
| 18 | 3,29 | 4,45 | 6,57 | 3,58 |
| 19 | 3,7 | 4,36 | 8,38 | 5,01 |
| 20 | 3,8 | 4,76 | 8,06 | 3,97 |
Table 9.4.1: Grades of elementary school students in the mathematics test in each school.
Initially, a descriptive analysis of the data was carried out to facilitate their interpretation and the application of the ANOVA model.
Figure 9.4.1: Boxplot of grades of elementary school students in the mathematics test in each school.
Through the boxplot, we notice that school C has higher grades than the others, 7.4 on average, compared to the other elementary schools. The objective of this example is the uniformity of teaching in schools, for this, we will apply the ANOVA method to answer this question.
In this simple example, the k levels are chosen randomly from a population of levels and we can extend the conclusions to all other levels of the population, which in our case are the students at each school. In this case, the effects are random variables and called random effects, next we will partition the total variability of the data.
9.4.1 Decomposition of the Total Sum of Squares
Before we calculate the sum of squares decomposition, let’s establish the covariance structure:
$$E(Y_{ij})=\mu,\quad Var(Y_{ij})=\sigma^2_{\alpha}+\sigma^2_{\varepsilon}$$
$$Cov(Y_{ij})=Cov(Y_{ij})=\sigma^2_{\alpha},\quad {para}~j\neq j$$
The ANOVA technique is associated with partitioning the total data variability into components. The total sum of squares is defined as a measure of the total variability of the data,
$$SQT=\sum_{i=1}^{k}\sum_{j=1}^{r}(y_{ij} - \overline{y_{..}})^{2}.$$
Intuitively this is reasonable, because if we divide SQT by its degrees of freedom (N -1), we obtain the sampling variance of the data.
Adding and subtracting $ \overline{y_{i.}} $ we get
$$SQT=\sum_{i=1}^{k}\sum_{j=1}^{r}\left[(y_{ij}-\overline{y_{i.}})+(\overline{y_{i.}}-\overline{y_{..}})\right]^{2}=$$
$$=\sum_{i=1}^{k}\sum_{j=1}^{r}(y_{ij}-\overline{y_{i.}})^{2}+2\sum_{i=1}^{k} \sum_{j=1}^{r}(y_{ij}-\overline{y_{i.}})(\overline{y_{i.}}-\overline{y_{..}})+\sum_{i=1}^{k}\sum_{j=1}^{r}(\overline{y_{i.}}- \overline{y_{..}})^{2}=$$
However, the cross product in the above equation is zero, since
$$=\sum_{i=1}^{k}\sum_{j=1}^{r}(y_{ij}-\overline{y_{i.}})(\overline{y_{i.}}-\overline{y_{..}})~=~\sum_{i=1}^{k}\sum_{j=1}^{r}\left(y_{ij}\overline{y_{i.}}- y_{ij}\overline{y_{..}}-\overline{y_{i.}}^2+\overline{y_{i.}}\overline{y_{..}}\right)=$$
$$=\sum_{i=1}^{k}\sum_{j=1}^{r}y_{ij}\overline{y_{i.}}-\sum_{i=1}^{k}\sum_{j=1}^{r}y_{ij}\overline{y_{..}}-\sum_{i=1}^{k}\sum_{j=1}^{r}\overline{y_{i.}}^2+\sum_{i=1}^{k}\sum_{j=1}^{r}\overline{y_{i.}}\overline{y_{..}}=$$
$$=\sum_{i=1}^{k}r \overline{y_{i.}}^2 - \overline{y_{..}}\sum_{i=1}^{k}r \overline{y_{i.}} -\sum_{i=1}^{k}r \overline{y_{i.}}^2 + \overline{y_{..}}\sum_{i=1}^{k}r \overline{y_{i.}}=0$$
Logo
$$SQT=\sum_{i=1}^{k}\sum_{j=1}^{r}(y_{ij}-\overline{y_{i.}})^{2}+\sum_{i=1}^{k}\sum_{j=1}^{r}(\overline{y_{i.}}-\overline{y_{..}})^{2}=\sum_{i=1}^{k}\sum_{j=1}^{r}(y_{ij}-\overline{y_{i.}})^{2}+\sum_{i=1}^{k}r(\overline{y_{i.}}-\overline{y_{..}})^{2}$$
that is,
$$SQT=SQA+SQE.$$
Observations
- Factor A Sum of Squares (SQA) is the deviation of the estimated means in each treatment (level) around the general average of the data. It represents the variability due to the different levels of factor A.
- Sum of Squares Error (SQE) is the deviation of observations around the estimated mean of their level (treatment). It represents the variability within each level of the factor.
Degrees of freedom and variance estimates
The concept of degree of freedom is always associated with a sum of squares. Consider $ x_1, x_2, \ldots, x_n $ elements, then
$$\overline{x}=\frac{\sum\limits_{i=1}^{n} x_{i}}{n}~~~{e}~~~\sum_{i=1}^{n}(x_{i}-\overline{x})=0.$$
One way to calculate the degrees of freedom is to determine the expected value of the SQA and SQE components.
Let’s calculate the expected values of the sums of squares.
$$E[SQE]=E\left[\sum_{i=1}^{k} \sum_{j=1}^{r}(y_{ij}-\overline{y_{i.}})^{2}\right]=E\left[\sum_{i=1}^{k}\sum_{j=1}^{r}(y_{ij}^2-2y_{ij}\overline{y_{i.}}+\overline{y_{i.}}^2)\right]=$$
$$=E\left[\sum_{i=1}^{k}\sum_{j=1}^{r}y_{ij}^2-2\sum_{i=1}^{k}r\overline{y_{i.}}^2+\sum_{i=1}^{k} r\overline{y_{i.}}^2\right]=E\left[\sum_{i=1}^{k}\sum_{j=1}^{r}y_{ij}^{2}-\sum_{i=1}^{k}\frac{1}{r}y_{i.}^{2} \right]$$
Replacing the model information in $ y_{ij} $ and $ y_{i.} $, we get
$$E[SQE]=E\left[\sum_{i=1}^{k}\sum_{j=1}^{r}(\mu+\alpha_{i}+\varepsilon_{ij})^{2}-\sum_{i=1}^{k}\frac{1}{r}\left(\sum_{j=1}^{r}(\mu+\alpha_{i}+\varepsilon_{ij})\right)^{2}\right]=$$
$$=E\left[\sum_{i=1}^{k} \sum_{j=1}^{r}(\mu^2+\alpha_i^2+\varepsilon_{ij}^2+2\mu\alpha_i+2\mu\varepsilon_{ij}+2\alpha_i\varepsilon_{ij})\right.-$$
$$-\left.\sum_{i=1}^{k}\frac{1}{r}\left(r^2\mu^2+r^2\alpha_i^2+\left(\sum_{j=1}^{r}\varepsilon_{ij}\right)^2+2~r^2\mu\alpha_i+2r\mu\sum_{j=1}^{r}\varepsilon_{ij}+2r\alpha_i\sum_{j=1}^{r}\varepsilon_{ij} \right)\right]=$$
$$=E\left[N\mu^2+\sum_{i=1}^{k} r\alpha_i^2+\sum_{i=1}^{k}\sum_{j=1}^{r}\varepsilon_{ij}^2+2\mu\sum_{i=1}^{k} r\alpha_i+2\mu\sum_{i=1}^{k}\sum_{j=1}^{r}\varepsilon_{ij}+2\sum_{i=1}^{k}\sum_{j=1}^{r}\alpha_i\varepsilon_{ij} \right.-$$
$$-\left.\left(N\mu^2+\sum_{i=1}^{k} r\alpha_i^2+\frac{1}{r}\sum_{i=1}^{k}\left(\sum_{j=1}^{r}\varepsilon_{ij}\right)^2+2\mu\sum_{i=1}^{k}r\alpha_i+ 2\mu\sum_{i=1}^{k}\sum_{j=1}^{r}\varepsilon_{ij}+2\sum_{i=1}^{k}\sum_{j=1}^{r}\alpha_i\varepsilon_{ij} \right)\right]=$$
$$=E\left[\sum_{i=1}^{k}\sum_{j=1}^{r}\varepsilon_{ij}^2-\frac{1}{r}\sum_{i=1}^{k}\left(\sum_{j=1}^{r}\varepsilon_{ij}\right)^2\right]=$$
$$=E\left[\sum_{i=1}^{k}\sum_{j=1}^{r}\varepsilon_{ij}^2\right]-\frac{1}{r}\sum_{i=1}^k E\left[\sum_{j=1}^r\varepsilon^2_{ij}+2\sum_{j\neq j}\varepsilon_{ij}\varepsilon_{ij}\right]=$$
$$= E \left[\sum_{i=1}^{k} \sum_{j=1}^{r} \varepsilon_{ij}^2 \right] - \frac{1}{r} \sum_{i=1}^{k} \sum_{j=1}^{r} E(\varepsilon_{ij}^2) - \frac{1}{r} \underbrace{E \left[2 \sum_{j \neq j'} \varepsilon_{ij} \varepsilon_{ij'} \right]}_{\text{é 0, pois } E(\varepsilon_{ij}) = 0 \text{ e } \varepsilon_{ij}, \varepsilon_{ij'} \text{ são independentes, } \forall j \neq j'}$$
$$=\sum_{i=1}^{k}\sum_{j=1}^{r}\left(1-\frac{1}{r}\right)E(\varepsilon^2_{ij})=$$
$$=\sum_{i=1}^{k}\sum_{j=1}^{r}\left(1-\frac{1}{r}\right)(Var(\varepsilon_{ij})+[E(\varepsilon_{ij})]^2), \quad \text{mas } E(\varepsilon_{ij})=0, \text{ então}$$
$$=(N-k)\sigma^2_{\varepsilon}=k(r-1)~\sigma^2_{\varepsilon}$$
Now we calculate the expected value of SQA, but first to facilitate construction we define $ \overline{y_{i.}}=\mu+\alpha_i+\overline{\varepsilon_{i.}} $ and
$$\overline{y_{..}}=\frac{1}{N}\sum^k_{i=1}\sum^{r}_{j=1}y_{ij}=\frac{1}{N}\sum^k_{i=1}\sum^{r}_{j=1}(\mu+\alpha_i+\varepsilon_{ij})=\frac{1}{N}\underbrace{\displaystyle\sum^k_{i=1}r\mu}_{N\mu}+\frac{1}{N}\sum^k_{i=1}r\alpha_i+\frac{1}{N}\underbrace{\displaystyle\sum^k_{i=1}\sum^{r}_{j=1}\varepsilon_{ij}}_{\displaystyle\sum^{r}_{j=1}r\varepsilon_{i.}}$$
So,
$$E[SQA]=E\left[\sum^k_{i=1}r(\overline{y_{i.}}-\overline{y_{..}})^2\right]=$$
$$=E\left[\sum^k_{i=1}r\left(\mu+\alpha_i+\overline{\varepsilon_{i.}}-\frac{1}{N}\left(N\mu+\sum^k_{i=1}r\alpha_i+\sum^{r}_{j=1}r\varepsilon_{i.}\right)\right)^2\right]=$$
$$=E\left[\sum^k_{i=1}r\left(\alpha_i-\frac{1}{N}\sum^k_{i=1}r\alpha_r-\overline{\varepsilon_{i.}}-\frac{1}{N}\sum^k_{i=1}r\overline{\varepsilon_{r.}}\right)^2\right]=$$
$$=\sum^k_{i=1}r \left(E\left[\alpha^2_i-\frac{2}{N}\alpha_i\sum^k_{i=1}r\alpha_r+\frac{1}{N^2}\left(\sum^k_{i=1}r\overline{\varepsilon_{r.}}\right)^2\right]\right)+$$
$$+\sum^k_{i=1}r \left(E\left[(\overline{\varepsilon_{i.}})^2-\frac{2}{N}\overline{\varepsilon_{i.}}\sum^k_{i=1}r\overline{\varepsilon_{r.}}+\frac{1}{N^2}\left(\sum^k_{i=1}r\overline{\varepsilon_{r.}}\right)^2\right]\right)\overset{(**)}{=}$$
$$=\sum^k_{i=1}r \left(\sigma^2_{\alpha}-\frac{2}{N}r\sigma^2_{\alpha}+\frac{1}{N^2}\sum^k_{i=1}r^2\sigma^2_{\alpha}\right)+\sum^k_{i=1}r \left(\frac{\sigma^2_{\varepsilon}}{r}-\frac{2r\sigma^2_{\varepsilon}}{N~r}+\frac{1}{N^2}\sum^k_{i=1}r^2\frac{\sigma^2_{\varepsilon}}{r}\right)=$$
$$=\left(\sum^k_{i=1}r-\frac{2}{N}\sum^k_{i=1}r^2+\frac{1}{N^2}\left(\sum^k_{i=1}r\right)\left(\sum^k_{i=1}r\right) \right)\sigma^2_{\alpha}+$$
$$+\left(\sum^k_{i=1}\frac{r}{r}-\frac{2}{N}\sum^k_{i=1}r^2+\frac{1}{N^2}\left(\sum^k_{i=1}r\right)\left(\sum^k_{i=1}r\right) \right)\sigma^2_{\varepsilon}=$$
$$=\left(N-\frac{1}{N}\sum^k_{i=1}r^2\right)\sigma^2_{\alpha}+(k-1)\sigma^2_{\varepsilon}=$$
$$=r(k-1)\sigma^2_\alpha+(k-1)\sigma^2_\varepsilon$$
In the passage ($ ** $), we use the property $ E(X^2)=\text{Var}(X)+E^2(X) $ (for more details see the variance content of random variables) and the fact that $ \alpha_i $ has a normal distribution with zero mean and variance $ \sigma^2_\alpha $and $ \varepsilon_{ij} $ has a normal distribution with zero mean and variance $ \sigma^2_\varepsilon. $
Therefore, as we argued in the (fixed effects ANOVA) section, the QME is a good estimator for variance because
$$E[QME]=E\left[\frac{SQE}{N-k}\right]=\frac{1}{N-k}E[SQE]=\sigma^2_{\varepsilon};~~~{e}$$
$$E[QMA]=E\left[\frac{SQA}{k-1}\right]=\frac{1}{k-1}E[SQA]=\frac{1}{k-1}(k-1)(r\sigma^2_\alpha+\sigma^2_\varepsilon)=r\sigma^2_{\alpha}+\sigma^2_{\varepsilon}$$
Thus, QMA is also a good estimator for variance. However, if there is a difference between the means of the levels, the expected value of the mean square of factor A (due to the levels) is greater than $ \sigma^{2}_{\varepsilon} $.
Thus, we have the following degrees of freedom:
| Sum of Squares | Degrees of Freedom | Medium Squares |
|---|---|---|
| SQA | k - 1 | $ \frac{SQA}{k-1} $ |
| SQE | k (r - 1) | $ \frac{SQE}{k(r-1)} $ |
| SQT | k r - 1 |
Table 9.4.2: Degrees of Freedom
Now we show a brief summary of the mean squares expected values.
| Factor | Degrees of Freedom | Medium Squares | Expected Value of Mean Squares |
|---|---|---|---|
| Factor A | k-1 | $ QMA $ | $ E(QMA)=\sigma^2_\varepsilon+r\sigma^2_\alpha $ |
| Error | k(r-1) | $ QME $ | $ E(QME)=\sigma^2_\varepsilon $ |
Table 9.4.3: Expected Values of Mean Squares.
| Statistics | |
|---|---|
| $ QMA= $ | $ r\displaystyle\sum^k_{i=1}\frac{(\overline{Y_{i.}}-\overline{Y_{..}})^2}{k-1} $ |
| $ QME= $ | $ \displaystyle\sum^k_{i=1}\sum^r_{j=1}\frac{(\overline{Y_{ij}}-\overline{Y_{i.}})^2}{k(r-1)} $ |
| $ \overline{Y_{i.}}= $ | $ \displaystyle\sum^r_{j=1}\frac{Y_{ij}}{r} $ |
| $ \overline{Y_{..}}= $ | $ \displaystyle\sum^k_{i=1}\sum^r_{j=1}\frac{Y_{ij}}{kr} $ |
Table 9.4.4: Summary of mean squares and means for model (1.1).
With the results obtained in table 1.1.1 we have the following estimators:
For the error component we have
$$\hat{\sigma}^2_\varepsilon=QME \tag{1.1.1}$$
Now, to calculate the effect of factor A, we use equation (1.1.1) as follows
$$\hat{\sigma}^2_\alpha=\frac{QMA-\hat{\sigma}^2_\varepsilon}{r}\overset{(1.1.1)}{=}\frac{QMA-QME}{r} \tag{1.1.2}$$
Table 9.4.5 represents the point estimators of model (1.1).
| Model Representation | Spot Estimator |
|---|---|
| $ \hat{\mu} $ | $ \overline{Y}_{…} $ |
| $ \hat{\sigma}^2_\alpha $ | $ \displaystyle\frac{QMA-QME}{r} $ |
| $ \hat{\sigma}^2_\varepsilon $ | $ QME $ |
Table 9.4.5: Summary of Point Estimators for model (1.1).
9.4.2 Statistical Analysis
As mentioned previously, inferences about variance components from unbalanced data are much more complicated than from balanced data. The reason is that analysis of variance of balanced data is quite simple since there is a single partition of the total sum of squares, which under the standard distribution assumption follows a multiple of a Chi-Square distribution. This multiple being the product of the degrees of freedom and expected value of the mean square of one of the random effects.
Thus, hypotheses about treatment effects can be tested by dividing the mean square of the treatment by the appropriate mean squared error to form a variance relationship (F test). Now, unbalanced data does not have these properties since there is no single partition of the total sum of squares, consequently, there is no single analysis of variance.
Furthermore, in any given decomposition, the component sums of squares are not independent (in general) or identically distributed as Chi-Square variables. Corresponding to any particular treatment mean square means that there is no mean squared error with equal expected value under the null hypothesis.
In models with balanced data, QME and QMA are independent and,
$$\frac{SQE}{\sigma^2_{\varepsilon}}\sim \chi^2_{k(r-1)}$$
However, less than $ \sigma^2_{\alpha}=0, $ we have to
$$\frac{SQA}{\sigma^2_{\alpha}}$$
does not have a Chi-Square distribution.
One solution to this problem is to construct confidence intervals using an alternative set of statistics. In particular, we use unweighted sums of squares (SQNP) for this purpose. Thomas and Hultquist proposed the statistic
$$(k-1)\frac{SQA_{*}}{\sigma^2_{\alpha *}}$$
in which
$$QMA_{*}=\frac{n_H}{k-1}\sum^k_{i=1}(\overline{y_{i.}}-\overline{y}^*_{..})^2,~~~~~~\hbox{com}~~\begin{cases}\overline{y}^*_{..}=\frac{1}{^k}\displaystyle\sum^k_{i=1}\overline{y}_{i.} \cr \hbox{e} \cr n_H=\frac{k}{\displaystyle\sum^k_{i=1}\frac{1}{n_i}} \cr \end{cases}$$
and
$$\sigma^2_{\alpha *}=E(QMA_{*})=n_H\sigma^2_{\alpha}+\sigma^2_{\varepsilon}$$
Computationally,
$$\sum^k_{i=1}(\overline{y_{i.}}-\overline{y}^*_{..})^2=\sum^k_{i=1}(\overline{y_{i.}})^2-\frac{(\displaystyle\sum^k_{i=1}\overline{y}^*_{..})^2}{k}$$
The statistic $ SQA_{*} $ is the unbalanced sum of squares SQNB of the treatment means and nH is the harmonic mean of the ni values. Thomas and Hultquist showed that under the assumptions of model (1.1) the moment-generating function $ \displaystyle\frac{SQA_{*}}{\sigma^2_{\alpha *}} $ approximates to a Chi-Square random variable with k-1 degrees of freedom and for all ni is approximated to a constant, or if $ \rho=\displaystyle\frac{\sigma^2_{\alpha}}{\sigma^2_{\alpha}+\sigma^2_{\varepsilon}} $ approaches to 1, or if all ni tends to infinity. Furthermore, studies carried out through simulations showed that this approach has satisfactory results for $ \rho< 0,20, $ even in extremely unbalanced experiments.
Now, let’s assume the data is balanced. Therefore, we developed a test to evaluate the hypothesis of differences or not between the population means of the levels, that is,
| Objective | Hypothesis |
|---|---|
| Effect of Factor A | $\begin{cases} H_0: \alpha_1 = \cdots = \alpha_k = 0 \cr H_1: \alpha_i \neq 0 \hbox{ (para algum) } ~ i = 1, …, k \end{cases}$ |
Table 9.4.6: hypothesis of differences between the population means of the levels
How the mistakes $ \varepsilon_{ij} $ has a Normal distribution with mean 0 and variance $ \sigma^{2}_{\varepsilon} $ independent and as previously stated $n_i → r (n_i ≈ r)$.
So,
$$\frac{SQE}{\sigma^2_\varepsilon}\sim\chi^2_{k(r-1)}~~~{e}~~~~\frac{SQA}{\sigma^2_\alpha}\sim\chi^2_{(k-1)}$$
However, the three square sums are not necessarily independent, as
$$SQT=SQE+SQA$$
To establish the independence between SQE and SQA, we will use the following version of Cochran’s theorem.
Cochran’s theorem
If we have $ Q = Q_1 + Q_2 + … + Q_q $ in which $ ~Q_i~,~i = 1, 2,…,q~(q \leq p) $ are sums of squares, each with pi degrees of freedom, such that:
$$p=\sum^{q}_{i=1}p_i$$
we get that $ Q_i\sim \chi^{2}_{(p_i)} $ and are independent of any $ i = 1, 2,…, q $.
ANOVA Test - One Factor
How $ \displaystyle\frac{{SQA}}{\sigma_\alpha^{2}} $ and $ \displaystyle\frac{{SQE}}{\sigma^{2}_\varepsilon} $ have Chi-Square distribution, independent, we obtain that
$$F_0 =\frac{\displaystyle\frac{SQA}{(k-1)}}{\displaystyle\frac{SQE}{k(r-1)}}=\frac{QMA}{QME}\sim F_{(k-1; k(r-1))}$$
Se $ F_0> F_{(1-\alpha,k-1, k(r-1))} $, we reject $ H_0 $ and we concluded that there is a significant difference between the means of the factor levels (treatments), in which $ F_{(1-\alpha, k-1, k(r-1))} $ corresponds to the quantile of Snedecor’s F distribution with a confidence level of $ 1-\alpha, $
Figure 9.4.2: Quantile of the F-Snedecor distribution.
We can also calculate the P-value as, $ P[~F_{(k-1;k(r-1))}> F_0~\mid~H_0] $
ANOVA can be represented in the following table:
| FV | Sum of Squares | Degrees of Freedom | Medium Squares | $F_0$ |
|---|---|---|---|---|
| Factor | SQA | k - 1 | $QMA = \dfrac{SQA}{k-1} $ | $F_0 = \dfrac{QMA}{QME}$ |
| Error | SQE | k (r - 1) | $QME = \dfrac{SQE}{k(r-1)} $ | |
| Total | SQT | k r - 1 |
Table 9.4.7: ANOVA - One Factor.
Example 4.2.1
Returning to Example 4.1 we have
To test the following hypotheses:
$$ \begin{cases} H_0: \alpha_1 = \cdots = \alpha_{20} \cr \alpha_{\ell} \neq \alpha_{m}, ~ \hbox{para algum}~~\ell \neq m. \end{cases}$$
the sums of squares are given by:
$$SQT~=\sum^n_{i=1}\sum^{n_i}_{j=1}y_{ij}^{2}-\frac{y^{2}_{..}}{N}=239,54$$
$$SQA=\sum^n_{i=1}\cfrac{1}{n_i}y_i^{2} -\frac{y^{2}_{..}}{N}= 138,2$$
With this, we have to
$$SQE=SQT-SQA= 101,33$$
Table 9.4.8 below represents the ANOVA for the School factor.
| FV | Sum of Squares | Degrees of Freedom | Medium Squares | $F_0$ |
|---|---|---|---|---|
| Factor | 138,2 | $4 - 1 = 3$ | $\dfrac{138,2}{3} = 46,07 $ | $F_0 = \dfrac{QMA}{QME} = 34,55$ |
| Error | 101,33 | $4 \ast (20-1) = 76$ | $QME = \dfrac{101,33}{76} = 1,33 $ | |
| Total | 239,54 | $20 \ast 4 -1 = 79$ |
Table 9.4.8: ANOVA for the School factor.
The approximate value of the P-value is: $ P[~F_{(3,76)}> F_0~\mid~H_0~]=3,4\times 10^{-14}≈0 $
For $ \alpha = 0,05 $, we obtain that $ F[0,05, 3, 76] = 2,72 $. Therefore, with 95% confidence, we reject $ {H}_0 $, that is, at least one $ \alpha_i $ is non-zero, for $ i=1,\ldots,n $.
See below the results obtained by the Action software.
| G.L. | Sum of Squares | Medium Square | Stat. F | P-value | |
|---|---|---|---|---|---|
| Schools | 3 | 138.208 | 46.0693 | 34.5518 | 0 |
| Waste | 76 | 101.3339 | 1.3333 |
Table 9.4.9: ANOVA Table
9.4.3 Estimation of model parameters
The analysis of variance (ANOVA) method for estimating variance components $ \sigma^2_{\varepsilon} $ and $ \sigma^2_{\alpha} $ consists of equating the observed values of the QME and QMA mean squares to their expected values, and solving the resulting equations to $ \sigma^2_{\varepsilon} $ and $ \sigma^2_{\alpha}. $ The estimators for balanced data obtained are
$$\hat{\sigma}^2_{\varepsilon}=QME~~~~~ \hbox{e} ~~~~\hat{\sigma}^2_{\alpha}=\frac{QMA-QME}{n_0} \tag{1.3.1}$$
Now, for the case of unbalanced data we will use the statistics proposed by Thomas and Hultquist, with this we obtain the following estimators
$$\hat{\sigma}^2_{\alpha *}=\frac{QMA_{*}-QME}{n_H}~~~~ \tag{1.3.2}$$
The problem of weighting in estimating variance components is discussed by Robertson (1962). We verified that the correct weighting is dependent on the F value of the analysis of variance.
For the estimator $ \hat{\sigma}^2_{\alpha} $ we can obtain a negative estimate. Mathew et al. (1992) consider non-negative estimators based on unbalanced models with two variance components, of which the model (equation 1.1) is a special case. Chatterjee and Das (1983) developed better asymptotically normal estimators for the variance components. Kelly and Mathew (1993) discussed a quadratic invariant estimator of $ \sigma^2_{\alpha} $ which has a probability of $ QME $ be less than to produce a negative estimate of $ \hat{\sigma}^2_{\alpha}, $ i.e. $ P[\hat{\sigma}^2_{\alpha}< 0]=P[QME< QMA]. $
Furthermore, QMA can be expressed as a central linear combination of independent Chi-Square variables. Thus, the QMA distribution can be approximated for a central Chi-Square variable using the Satterthwaite approximation.
Now the probability of a negative estimate can be evaluated in terms of the central F distributions. Singh (1989a) developed an expression to determine an exact value for the probability $ P (\sigma^2_{\alpha}< 0), $ using an infinite weighted sum of incomplete beta functions.
An exact value of the probability of a negative estimate can also be assessed from Davies (1980), who gives an algorithm for calculating the distribution of a linear combination of independent (possibly non-central) Chi-Square variables with arbitrary degrees of freedom.
To construct the confidence intervals, we used some constants for the linear combinations mentioned above. For example, we built a table with a significance level of 0.05, k=10 and N=17.
| Constant | Definition | Value |
|---|---|---|
| $ G_a $ | $ 1-F_{\frac{\alpha}{2}:\infty;k-1} $ | 0,5269 |
| $ G_e $ | $ 1-F_{\frac{\alpha}{2}:\infty;N-k} $ | 0,5628 |
| $ H_a $ | $ F_{1-\frac{\alpha}{2}:\infty;k-1}-1 $ | 2,333 |
| $ H_e $ | $ F_{1-\frac{\alpha}{2}:\infty;N-k}-1 $ | 3,142 |
| $ F_a $ | $ F_{1-\frac{\alpha}{2}:k-1;N-k} $ | 4,823 |
| $ F_e $ | $ F_{\frac{\alpha}{2}:k-1;N-k} $ | 0,2383 |
| $ G_{ae} $ | $ \frac{(F1-1)^2-G^2_1F^2_1-H^2_2}{F_1} $ | -0,356 |
| $ H_{ae} $ | $ \frac{(1-F2)^2-H^2_1F^2_2-G^2_2}{F_2} $ | -0,191 |
| $ H_{ae} $ | $ \frac{(1-F2)^2-H^2_1 F^2_2-G^2_2}{F_2} $ | -0,191 |
Table 9.4.10: Constants used in the Confidence Intervals of equation 1.1.
Confidence Interval for $ \mu $
The confidence interval for $ \mu $ is obtained by substituting $ QMA $ by $ QMA_{*},~n_H $ by $ n_i~\hbox{e}~\overline{y}^*_{..} $ by $ \overline{y_{..}} $ Therefore, the confidence interval $ 100(1-\alpha) \char37 $ approximate for $ \mu $ is
$$ LI=\overline{y_{..}}^*-\sqrt{\frac{QMA_{*}F_{1-\frac{\alpha}{2}:1,k-1}}{k~n_H}} $$
and
$$ LS=\overline{y_{..}}^*+\sqrt{\frac{QMA_{*}F_{1-\frac{\alpha}{2}:1,k-1}}{k~n_H}} \tag{1.3.4} $$
El-Bassiouni and Abdelhafez compared equation 1.3.4 to nine other intervals for $ \mu. $ (The form of equation 1.3.4 considered by El-Bassiouni and Abdelhafez used degrees of freedom estimated based on the Satterthwaite approximation. However, they found this equation and it was adequately approximated by p-1). Equation 1.3.4 maintained the declared confidence level.
Confidence Interval for $ \sigma^2_{\alpha} $
A confidence interval $ 100(1-\alpha) \char37 $ approximate to $ \sigma^2_{\alpha} $ based on modifications of the Unbalanced Sum of Squares $ SQNB $ of equation 1.1 is
$$LI=\hat{\sigma}^2_{\alpha}-\frac{\sqrt{V_{\alpha I}}}{n_H}$$
and
$$LS=\hat{\sigma}^2_{\alpha}+\frac{\sqrt{V_{\alpha S}}}{n_H} \tag{1.3.5}$$
in which
$$V_{\alpha I}=G^2_{a} QMA^2_{\alpha *}+H^2_{e} QME^2+G_{ae} QMA_{\alpha *}QME,$$
$$V_{\alpha S}=H^2_{a} QMA^2_{\alpha *}+G^2_e QME^2+H_{ae} QMA_{\alpha *}QME$$
being $ G_{a}, G_e, H_a, H_e, G_{ae} $ and $ H_{ae} $ are defined in table 9.4.10 and $ \hat{\sigma}^2_{\alpha *} $ is defined in equation 1.3.2.
Confidence Interval for $ \sigma^2_{\varepsilon} $
O $ 100(1-\alpha) \char37 $ Exact Confidence Interval for $ \sigma^2_{\varepsilon} $ is
$$LI=(1-G_e)QME$$
and
$$LS=(1+H_e)QME \tag{1.3.6}$$
in which $ G_e $ and $ H_e $ are defined in Table 9.4.10 and $ \frac{SQE}{\sigma^2_{\varepsilon}} $ has a Chi-Square distribution in models with balanced and unbalanced data.
Example 4.3.1
Returning to example 1.1, we now calculate the parameter estimates as follows
From the results obtained in example 1.2.1 we have
$$QME=1,33 ~ \hbox{e} ~ QMA=46,07$$
First, we calculate the confidence interval for $ \mu.=\overline{y_{..}}=5,32 $
$$ LI=\overline{y_{..}}^*-\sqrt{\frac{QMA_{*}F_{1-\frac{\alpha}{2}:1,k-1}}{k~n_H}}=5,32-\sqrt{\frac{46,07\times 5,92}{20 \times 4}}=3,48~~~~e $$
$$ LS=\overline{y_{..}}^*+\sqrt{\frac{QMA_{*}F_{1-\frac{\alpha}{2}:1,k-1}}{k~n_H}}=5,32+\sqrt{\frac{46,07\times 5,92}{20\times 4}}=7,17 $$
The confidence interval for $ \sigma^2_{\alpha} $ is given by
$$\hat{\sigma}^2_{\alpha}=\sqrt{\frac{QMA-QME}{r}}=\sqrt{\frac{46,07-1,33}{20}}=1,496$$
$$LI=\sqrt{\hat{\sigma}^2_{\alpha}-\frac{\sqrt{V_{\alpha I}}}{n_H}}=\sqrt{2,237-\frac{\sqrt{980,708}}{20}}=0,819~~~~{e}$$
$$LS=\sqrt{\hat{\sigma}^2_{\alpha}+\frac{\sqrt{V_{\alpha S}}}{n_H}}=\sqrt{2,237+\frac{\sqrt{353261,7}}{20}}=5,653$$
in which
$$V_{\alpha I}=G^2_{a} QMA^2_{\alpha *}+H^2_{e} QME^2+G_{ae} QMA_{\alpha *}QME=$$
$$=0,679^2~46,07^2+0,413^2~1,33^2+(0,0263)~46,07~1,33=980,708$$
$$V_{\alpha S}=H^2_{a} QMA^2_{\alpha *}+G^2_e QME^2+H_{ae} QMA_{\alpha *}QME=$$
$$=12,902^2~46,07^2+0,255^2~1,33^2+(-0,776)~46,07~1,33=353261,7$$
The confidence interval for $ \sigma^2_{\varepsilon} $ is given by
$$\hat{\sigma}_\varepsilon=\sqrt{QME}=\sqrt{QME}=\sqrt{1,33}=1,15$$
$$LI=\sqrt{(1-G_e)QME}=\sqrt{(1-0,255)~1,33}=0,997$$
and
$$LS=\sqrt{(1+H_e)QME}=\sqrt{(1+0,413)~1,33}=1,373$$
Below we present a summary of the results
| Factor | Standard deviation | Lower Limit | Upper Limit |
|---|---|---|---|
| Error | 1,155 | 0,997 | 1,373 |
| School | 1,496 | 0,819 | 5,653 |
| Total | 1,889 |
Table 9.4.11: Confidence Intervals for $\sigma^2_{\alpha}$
| G.L. | Sum of Squares | Medium Square | Stat. F | P-value | |
|---|---|---|---|---|---|
| Schools | 3 | 138.208 | 46.0693 | 34.5518 | 0 |
| Waste | 76 | 101.3339 | 1.3333 |
Table 9.4.12: ANOVA table
Example 4.3.2
Consider the study carried out to analyze the efficiency of the measurement system for measuring the door dimensions of an excavator. The measuring system uses a CNC coordinate measuring machine. In this case, we consider that the operator does not influence the measurement, a fact that led us to consider only one operator and 15 parts in the analysis.
| Ask | Measurements |
|---|---|
| 1 | 461,28 |
| 2 | 458,17 |
| 3 | 460,57 |
| 4 | 459,28 |
| 5 | 461,28 |
| 6 | 460,25 |
| 7 | 458,82 |
| 8 | 461,58 |
| 9 | 459,36 |
| 10 | 459,62 |
| 11 | 461,38 |
| 12 | 458,67 |
| 13 | 462,57 |
| 14 | 459,58 |
| 15 | 461,76 |
| 1 | 461,5 |
| 2 | 458,62 |
| 3 | 460,28 |
| 4 | 459,66 |
| 5 | 461,12 |
| 6 | 460,68 |
| 7 | 458,95 |
| 8 | 461,1 |
| 9 | 459,52 |
| 10 | 459,34 |
| 11 | 461,57 |
| 12 | 459,03 |
| 13 | 462,28 |
| 14 | 459,66 |
| 15 | 461,12 |
| 1 | 461,2 |
| 2 | 458,61 |
| 3 | 460,32 |
| 4 | 459,58 |
| 5 | 461,18 |
| 6 | 460,28 |
| 7 | 458,66 |
| 8 | 461,18 |
| 9 | 459,57 |
| 10 | 459,54 |
| 11 | 461,53 |
| 12 | 458,98 |
| 13 | 462,32 |
| 14 | 459,28 |
| 15 | 461,15 |
Table 9.4.13: Measurements of the 15 sample pieces
The sums of squares are given by:
$$SQT=\sum_{i=1}^{k}\sum_{j=1}^{n_{i}}(y_{ij}-\overline{y_{i.}})^{2}+\sum_{i=1}^{k}\sum_{j=1}^{n_{i}}(\overline{y_{i.}}-\overline{y_{..}})^{2}=\sum_{i=1}^{k}\sum_{j=1}^{n_{i}}(y_{ij}-\overline{y_{i.}})^{2}+\sum_{i=1}^{k}n_{i}(\overline{y_{i.}}-\overline{y_{..}})^{2}=60,666$$
$$SQA=\sum^k_{i=1}n_i(\overline{y_{i.}}-\overline{y_{..}})^2=59,5$$
With this, we have to
$$SQE=SQT-SQA=60,666-59,5=1,166$$
Now, we will calculate the Mean Squares
$$QME=\frac{SQE}{N-k}=\frac{1,166}{45-15}=0,03884$$
$$QMA=\frac{SQA}{k-1}=\frac{59,5}{15-1}=4,25$$
We calculate confidence intervals. First, we will make the confidence interval for $ \mu. $
$$LI=\overline{y_{..}}^*-\sqrt{\frac{QMA_{*}F_{1-\frac{\alpha}{2}:1,k-1}}{k~n_H}}=460,2662-\sqrt{\frac{4,25\times 4,6001}{15 \times 3}}=459,607$$
and
$$LS=\overline{y_{..}}^*+\sqrt{\frac{QMA_{*}F_{1-\frac{\alpha}{2}:1,k-1}}{k~n_H}}=460,2662+\sqrt{\frac{4,25\times 4,6001}{15\times 3}}=460,925$$
The confidence interval for $ \sigma^2_{\alpha} $ is given by
$$\sigma_{\alpha}=\sqrt{\frac{QMA-QME}{n_r}}=\sqrt{\frac{4,25-0,03884}{3}}=1,184$$
$$LI=\sqrt{\hat{\sigma}^2_{\alpha}-\frac{\sqrt{V_{\alpha I}}}{n_H}}=\sqrt{1,404-\frac{\sqrt{3,889244}}{3}}=0,863$$
and
$$LS=\sqrt{\hat{\sigma}^2_{\alpha}+\frac{\sqrt{V_{\alpha S}}}{n_H}}=\sqrt{1,404+\frac{\sqrt{39,94}}{3}}=1,873$$
in which
$$V_{\alpha I}=G^2_{a} QMA^2_{\alpha *}+H^2_{e} QME^2+G_{ae} QMA_{\alpha *}QME=$$
$$=0,464^2~4,25^2+0,787^2~0,03884^2+(-0,0025)4,25~0,03884=3,889244$$
$$V_{\alpha S}=H^2_{a} QMA^2_{\alpha *}+G^2_e QME^2+H_{ae} QMA_{\alpha *}QME=$$
$$=1,4872^2~4,25^2+0,36142^2~0,03884^2+(-0,068)4,25~0,03884=39,94$$
The confidence interval for $ \sigma^2_{\varepsilon} $ is given by
$$\sigma_\varepsilon=\sqrt{QME}=0,197$$
$$LI=\sqrt{(1-G_e)QME}=\sqrt{(1-0,3614)0,03884}=0,157$$
and
$$LS=\sqrt{(1+H_e)QME}=\sqrt{(1-0,787)0,03884}=0,263$$
Results obtained by the Action Stat (RR) software:
| G.L. | Sum of squares | Medium Squares | F-statistic | P-Value | |
|---|---|---|---|---|---|
| Parts | 14 | 59.5007 | 4.2501 | 109.4309 | 0 |
| Repetitiveness | 30 | 1.1651 | 0.0388 |
Table 9.4.14: ANOVA table
| Variances | Contribution (%) | |
|---|---|---|
| Repetitiveness | 0.0388 | 2.6923 |
| Parts | 1.4037 | 97.3077 |
| Repeatability and reproducibility | 0.0388 | 2.6923 |
| Total | 1.4426 | 100 |
Table 9.4.15: Contribution Table
| Standard deviation | Total variation (%) | |
|---|---|---|
| Repetitiveness | 0.1971 | 16.4081 |
| Parts | 1.1848 | 98.6447 |
| Repeatability and reproducibility | 0.1971 | 16.4081 |
| Total | 1.2011 | 100 |
Table 9.4.16: Total Variation and/or Tolerance