A Guide on Data Analysis

Each has probability 1/k of being selected. Each experimental unit is measured with a response \(Y_\) , in which j denotes unit and i denotes treatment.

1 2 a
\(Y_\) \(Y_\) \(Y_\)
\(Y_\)
Sample Mean \(\bar>\) \(\bar>\) \(\bar>\)
Sample SD \(s_1\) \(s_2\) \(s_a\)

And the grand mean is \(\bar>=\frac\sum_\sum_Y_\)

21.1.1 Single Factor Fixed Effects Model

also known as Single Factor (One-Way) ANOVA or ANOVA Type I model.

Partitioning the Variance

The total variability of the \(Y_\) observation can be measured as the deviation of \(Y_\) around the overall mean \(\bar>\) : \(Y_ - \bar>\)

This can be rewritten as:

\[ \begin \sum_\sum_(Y_ - \bar>)^2 &= \sum_n_i(\bar>-\bar>)^2+\sum_\sum_(Y_-\bar>)^2 \\ SSTO &= SSTR + SSE \\ total~SS &= treatment~SS + error~SS \\ (N-1)~d.f. &= (a-1)~d.f. + (N - a) ~ d.f. \end \]

we lose a d.f. for the total corrected SSTO because of the estimation of the mean ( \(\sum_\sum_(Y_ - \bar>)=0\) )
And, for the SSTR \(\sum_n_i(\bar>-\bar>)=0\)

ANOVA Table

Source of Variation SS df MS
Between Treatments \(\sum_n_i (\bar>-\bar>)^2\) a-1 SSTR/(a-1)
Error (within treatments) \(\sum_\sum_(Y_-\bar>)^2\) N-a SSE/(N-a)
Total (corrected) \(\sum_n_i (\bar>-\bar>)^2\) N-1

Linear Model Explanation of ANOVA

21.1.1.1 Cell means model

\(a = 3\) (3 treatments) \(n_1=n_2=n_3=2\)

\[ \begin \left(\begin Y_\\ Y_\\ Y_\\ Y_\\ Y_\\ Y_\\ \end\right) &= \left(\begin 1 & 0 & 0 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 1 \\ \end\right) \left(\begin \mu_1 \\ \mu_2 \\ \mu_3 \\ \end\right) + \left(\begin \epsilon_ \\ \epsilon_ \\ \epsilon_ \\ \epsilon_ \\ \epsilon_ \\ \epsilon_ \\ \end\right)\\ \mathbf &= \mathbf +\mathbf \end \]

\(X_=1\) if the \(k\) -th treatment is used

Note: no intercept term.

\[\begin \begin \mathbf= \left[\begin \mu_1 \\ \mu_2 \\ \mu_3 \\ \end\right] &= (\mathbf'\mathbf)^\mathbf'\mathbf \\ & = \left[\begin n_1 & 0 & 0\\ 0 & n_2 & 0\\ 0 & 0 & n_3 \\ \end\right]^ \left[\begin Y_1\\ Y_2\\ Y_3\\ \end\right] \\ & = \left[\begin \bar\\ \bar\\ \bar\\ \end\right] \end \tag \end\]

is the BLUE (best linear unbiased estimator) for \(\beta=[\mu_1 \mu_2\mu_3]'\)

\[ var(\mathbf)=\sigma^2(\mathbf)^=\sigma^2 \left[\begin 1/n_1 & 0 & 0\\ 0 & 1/n_2 & 0\\ 0 & 0 & 1/n_3\\ \end\right] \]

\(var(b_i)=var(\hat<\mu_i>)=\sigma^2/n_i\) where \(\mathbf \sim N(\beta,\sigma^2(\mathbf)^)\)

We have \(E(s_i^2)=\sigma^2\)

Hence, MSE is an unbiased estimator of \(\sigma^2\) , regardless of whether the treatment means are equal or not.

Then we can use an \(F\) -test for the equality of all treatment means:

\[H_a: not~al l~ \mu_i ~ are ~ equal \]

\(F=\frac\)
where large values of F support \(H_a\) (since MSTR will tend to exceed MSE when \(H_a\) holds)
and F near 1 support \(H_0\) (upper tail test)

Equivalently, when \(H_0\) is true, \(F \sim f_\)

Note: If \(a = 2\) (2 treatments), \(F\) -test = two sample \(t\) -test

21.1.1.2 Treatment Effects (Factor Effects)

Besides Cell means model, we have another way to formalize one-way ANOVA: \[Y_ = \mu + \tau_i + \epsilon_\] where

For example, \(a = 3\) , \(n_1=n_2=n_3=2\)

\[\begin \begin \left(\begin Y_\\ Y_\\ Y_\\ Y_\\ Y_\\ Y_\\ \end\right) &= \left(\begin 1 & 1 & 0 & 0 \\ 1 & 1 & 0 & 0 \\ 1 & 0 & 1 & 0 \\ 1 & 0 & 1 & 0 \\ 1 & 0 & 0 & 1 \\ 1 & 0 & 0 & 1 \\ \end\right) \left(\begin \mu \\ \tau_1 \\ \tau_2 \\ \tau_3\\ \end\right) + \left(\begin \epsilon_ \\ \epsilon_ \\ \epsilon_ \\ \epsilon_ \\ \epsilon_ \\ \epsilon_ \\ \end\right)\\ \mathbf &= \mathbf +\mathbf \end \tag \end\]

\[ \mathbf = \left( \begin \sum_n_i & n_1 & n_2 & n_3 \\ n_1 & n_1 & 0 & 0 \\ n_2 & 0 & n_2 & 0 \\ n_3 & 0 & 0 & n_3 \\ \end \right) \]

is singular thus does not exist, \(\mathbf\) is insolvable (infinite solutions)

Hence, we have to impose restrictions on the parameters to a model matrix \(\mathbf\) of full rank.

Whatever restriction we use, we still have:

\(E(Y_)=\mu + \tau_i = \mu_i = mean ~ response ~ for ~ i-th ~ treatment\)

21.1.1.2.1 Restriction on sum of tau

is the average of the treatment mean (grand mean) (overall mean)

Hence, the mean for the a-th treatment is

Hence, the model need only “a” parameters:

\[\begin \begin \left(\begin Y_\\ Y_\\ Y_\\ Y_\\ Y_\\ Y_\\ \end\right) &= \left(\begin 1 & 1 & 0 \\ 1 & 1 & 0 \\ 1 & 0 & 1 \\ 1 & 0 & 1 \\ 1 & -1 & -1 \\ 1 & -1 & -1 \\ \end\right) \left(\begin \mu \\ \tau_1 \\ \tau_2 \\ \end\right) + \left(\begin \epsilon_ \\ \epsilon_ \\ \epsilon_ \\ \epsilon_ \\ \epsilon_ \\ \epsilon_ \\ \end\right)\\ \mathbf &= \mathbf +\mathbf \end \end\]

Equation (21.1) with \(\sum_\tau_i=0\) becomes

21.1.1.2.2 Restriction on first tau

In R, lm() uses the restriction \(\tau_1=0\)

For the previous example, for \(n_1=n_2=n_3=2\) , and \(\tau_1=0\) .

Then the treatment means can be written as:

\[ \begin \mu_1 &= \mu + \tau_1 = \mu + 0 = \mu \\ \mu_2 &= \mu + \tau_2 \\ \mu_3 &= \mu + \tau_3 \end \]

Hence, \(\mu\) is the mean response for the first treatment

In the matrix form,

\[ \begin \left(\begin Y_\\ Y_\\ Y_\\ Y_\\ Y_\\ Y_\\ \end\right) &= \left(\begin 1 & 0 & 0 \\ 1 & 0 & 0 \\ 1 & 1 & 0 \\ 1 & 1 & 0 \\ 1 & 0 & 1 \\ 1 & 0 & 1 \\ \end\right) \left(\begin \mu \\ \tau_2 \\ \tau_3 \\ \end\right) + \left(\begin \epsilon_ \\ \epsilon_ \\ \epsilon_ \\ \epsilon_ \\ \epsilon_ \\ \epsilon_ \\ \end\right)\\ \mathbf &= \mathbf +\mathbf \end \]

\[ \begin var(\mathbf) &= \sigma^2(\mathbf)^ \\ var(\hat<\mu>) &= var(\bar>)=\sigma^2/n_1 \\ var(\hat) &= var(\bar>-\bar>) = \sigma^2/n_2 + \sigma^2/n_1 \\ var(\hat) &= var(\bar>-\bar>) = \sigma^2/n_3 + \sigma^2/n_1 \end \]

Note For all three parameterization, the ANOVA table is the same

All models have the same calculation for \(\hat\) as

ANOVA Table

The \(F\) -statistic here has \((a-1,N-a)\) degrees of freedom, which gives the same value for all three parameterization, but the hypothesis test is written a bit different:

\[ \begin &H_0 : \mu_1 = \mu_2 = . = \mu_a \\ &H_0 : \mu + \tau_1 = \mu + \tau_2 = . = \mu + \tau_a \\ &H_0 : \tau_1 = \tau_2 = . = \tau_a \end \]

The \(F\) -test here serves as a preliminary analysis, to see if there is any difference at different factors. For more in-depth analysis, we consider different testing of treatment effects.

21.1.1.3 Testing of Treatment Effects

21.1.1.3.1 Single Treatment Mean

Since \(\frac>-\mu_i>)> \sim t_\) and the confidence interval for \(\mu_i\) is \(\bar> \pm t_s(\bar>)\) ,
then we can do a t-test for the means difference with some constant \(c\)

\[ \begin &H_0: \mu_i = c \\ &H_1: \mu_i \neq c \end \]

follows \(t_\) when \(H_0\) is true.
If \(|T| > t_\) , we can reject \(H_0\)

21.1.1.3.2 Differences Between Treatment Means

Let \(D=\mu_i - \mu_i'\) , also known as pairwise comparison
\(D\) can be estimated by \(\hat=\bar>-\bar>'\) is unbiased ( \(E(\hat)=\mu_i-\mu_i'\) )

Since \(\bar>\) and \(\bar>'\) are independent, then

can be estimated with

With the single treatment inference,

\[ \begin &H_0: \mu_i = \mu_i' \\ &H_a: \mu_i \neq \mu_i' \end \]

can be tested by the following statistic

21.1.1.3.3 Contrast Among Treatment Means

generalize the comparison of two means, we have contrasts

A contrast is a linear combination of treatment means:

where each \(c_i\) is non-random constant and sum to 0:

An unbiased estimator of a contrast L is

and \(E(\hat) = L\) . Since the \(\bar_\) , i = 1,…, a are independent.

\[ \begin var(\hat) &= var(\sum_^a c_i \bar_) = \sum_^a var(c_i \bar_i) \\ &= \sum_^a c_i^2 var(\bar_i) = \sum_^a c_i^2 \sigma^2 /n_i \\ &= \sigma^2 \sum_^ c_i^2 /n_i \end \]

Estimation of the variance:

\(\hat\) is normally distributed (since it is a linear combination of independent normal random variables).

Then, since \(SSE/\sigma^2\) is \(\chi_^2\)

A \(1-\alpha\) confidence limits are given by

\[ \begin &H_0: L = 0 \\ &H_a: L \neq 0 \end \]

21.1.1.3.4 Linear Combination of Treatment Means

just like contrast \(L = \sum_^a c_i \mu_i\) but no restrictions on the \(c_i\) coefficients.

Tests on a single treatment mean, two treatment means, and contrasts can all be considered form the same perspective.

\[ \begin &H_0: \sum c_i \mu_i = c \\ &H_a: \sum c_i \mu_i \neq c \end \]

The test statistics ( \(t\) -stat) can be considered equivalently as \(F\) -tests; \(F = (T)^2\) where \(F \sim F_\) . Since the numerator degrees of freedom is always 1 in these cases, we refer to them as single-degree-of-freedom tests.

Multiple Contrasts

To test simultaneously \(k \ge 2\) contrasts, let \(T_1. T_k\) be the t-stat. The joint distribution of these random variables is a multivariate t-distribution (the tests are dependent since they re based on the same data).

Limitations for comparing multiple contrasts:

  1. The confidence coefficient \(1-\alpha\) only applies to a particular estimate, not a series of estimates; similarly, the Type I error rate, \(\alpha\) , applies to a particular test, not a series of tests. Example: 3 \(t\) -tests at \(\alpha = 0.05\) , if tests are independent (which they are not), \(0.95^3 = 0.857\) (thus \(\alpha - 0.143\) not 0.05)
  2. The confidence coefficient \(1-\alpha\) and significance level \(\alpha\) are appropriate only if the test was not suggest by the data.

Multiple Comparison Procedures:

21.1.1.3.4.1 Tukey

All pairwise comparisons of factor level means. All pairs \(D = \mu_i - \mu_i'\) or all tests of the form:

\[ \begin &H_0: \mu_i -\mu_i' = 0 \\ &H_a: \mu_i - \mu_i' \neq 0 \end \]

Notes

21.1.1.3.4.2 Scheffe

This method applies when the family of interest is the set of possible contrasts among the treatment means:

\[ L = \sum_^a c_i \mu_i \]

where \(\sum_^a c_i =0\)

That is, the family of all possible contrasts \(L\) or

\[ \begin &H_0: L = 0 \\ &H_a: L \neq 0 \end \]

The family confidence level for the Scheffe procedure is exactly \(1-\alpha\) (i.e., significance level = \(\alpha\) ) whether the sample sizes are equal or not.

For simultaneous confidence intervals,

where \(\hat=\sum c_i \bar_,s^2(\hat) = MSE \sum c_i^2/n_i\) and \(S^2 = (a-1)f_\)

The Scheffe procedure considers

where we reject \(H_0\) at the family significance level \(\alpha\) if \(F > f_\)

Note

21.1.1.3.4.3 Bonferroni

Applicable whether the sample sizes are equal or unequal.

For the confidence intervals,

where \(B= t_<(1-\alpha/(2g);N-a)>\) and g is the number of comparisons in the family.

\[ \begin &H_0: L = 0 \\ &H_a: L \neq 0 \end \]

Notes

21.1.1.3.4.4 Fisher’s LSD

does not control for family error rate

use \(t\) -stat for testing

21.1.1.3.4.5 Newman-Keuls

Do not recommend using this test since it has less power than ANOVA.

21.1.1.3.5 Multiple comparisons with a control
21.1.1.3.5.1 Dunnett

We have \(a\) groups where the last group is the control group, and the \(a-1\) treatment groups.

Then, we compare treatment groups to the control group. Hence, we have \(a-1\) contrasts (i.e., \(a-1\) pairwise comparisons)

21.1.1.3.6 Summary

When choosing a multiple contrast method: