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_\)
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
\(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
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\)
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
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.
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\)
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
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 \]
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:
Multiple Comparison Procedures:
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
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
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
does not control for family error rate
use \(t\) -stat for testing
Do not recommend using this test since it has less power than ANOVA.
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)
When choosing a multiple contrast method:
Also known as ANOVA Type II models.
Treatments are chosen at from from larger population. We extend inference to all treatments in the population and not restrict our inference to those treatments that happened to be selected for the study.
\(\mu_i\) and \(\epsilon_\) are mutually independent for \(i =1. a; j = 1. n\)
With all treatment sample sizes are equal
\[ \begin E(Y_) &= E(\mu_i) = \mu \\ var(Y_) &= var(\mu_i) + var(\epsilon_i) = \sigma^2_ <\mu>+ \sigma^2 \end \]
Since \(Y_\) are not independent
\[ \begin cov(Y_,Y_) &= E(Y_Y_) - E(Y_)E(Y_) \\ &= E(\mu_i^2 + \mu_i \epsilon_ + \mu_i \epsilon_ + \epsilon_\epsilon_) - \mu^2 \\ &= \sigma^2_ <\mu>+ \mu^2 - \mu^2 & \text j \neq j' \\ &= \sigma^2_ <\mu>& \text j \neq j' \end \]
\[ \begin cov(Y_,Y_) &= E(\mu_i \mu_ + \mu_i \epsilon_+ \mu_\epsilon_+ \epsilon_\epsilon_) - \mu^2 \\ &= \mu^2 - \mu^2 & \text i \neq i' \\ &= 0 \\ \end \]
Inference
Intraclass Correlation Coefficient
which measures the proportion of total variability of \(Y_\) accounted for by the variance of \(\mu_i\)
\[ \begin &H_0: \sigma_<\mu>^2 = 0 \\ &H_a: \sigma_<\mu>^2 \neq 0 \end \]
\(H_0\) implies \(\mu_i = \mu\) for all i, which can be tested by the F-test in ANOVA.
The understandings of the Single Factor Fixed Effects Model and the Single Factor Random Effects Model are different, the ANOVA is same for the one factor model. The difference is in the expected mean squares
Random Effects Model | Fixed Effects Model |
---|---|
\(E(MSE) = \sigma^2\) | \(E(MSE) = \sigma^2\) |
\(E(M STR) = \sigma^2 - n \sigma^2_\mu\) | \(E(MSTR) = \sigma^2 + \frac< \sum_i n_i (\mu_i - \mu)^2>\) |
If \(\sigma^2_\mu\) , then MSE and MSTR have the same expectation ( \(\sigma^2\) ). Otherwise, \(E(MSTR) >E(MSE)\) . Large values of the statistic
suggest we reject \(H_0\) .
Since \(F \sim F_\) when \(H_0\) holds. If \(F > f_\) we reject \(H_0\) .
If sample sizes are not equal, \(F\) -test can still be used, but the df are \(a-1\) and \(N-a\) .
An unbiased estimator of \(E(Y_)=\mu\) is the grand mean: \(\hat <\mu>= \hat_\)
The variance of this estimator is
An unbiased estimator of this variance is \(s^2(\bar)=\frac\) . Thus \(\frac<\bar_-\mu> \sim t_\)
A \(1-\alpha\) confidence interval is \(\bar_ \pm t_<(1-\alpha/2;a-1)>s(\bar_)\)
In the random and fixed effects model, MSTR and MSE are independent. When the sample sizes are equal ( \(n_i = n\) for all i),
If the lower limit for \(\frac<\sigma^2_\mu>\) is negative, it is customary to set \(L = 0\) .
\(a(n-1)MSE/\sigma^2 \sim \chi^2_\) , the \((1-\alpha)\) confidence interval for \(\sigma^2\) :
can also be used in case sample sizes are not equal - then df is N-a.
\(E(MSE) = \sigma^2\) \(E(MSTR) = \sigma^2 + n\sigma^2_\mu\) . Hence,
An unbiased estimator of \(\sigma^2_\mu\) is given by
If sample sizes are not equal,
no exact confidence intervals for \(\sigma^2_\mu\) , but we can approximate intervals.
Satterthewaite Procedure can be used to construct approximate confidence intervals for linear combination of expected mean squares
A linear combination:
\[ \sigma^2_\mu = \frac E(MSTR) + (-\frac) E(MSE) \]
\[ S = d_1 E(MS_1) + ..+ d_h E(MS_h) \]
where \(d_i\) are coefficients.
An unbiased estimator of S is
\[ \hat = d_1 MS_1 + . + d_h MS_h \]
Let \(df_i\) be the degrees of freedom associated with the mean square \(MS_i\) . The Satterthwaite approximation:
An approximate \(1-\alpha\) confidence interval for S:
For the single factor random effects model
\[ \tau_i = \mu_i - E(\mu_i) = \mu_i - \mu \]
we have \(\mu_i = \mu + \tau_i\) and
\[ Y_ = \mu + \tau_i + \epsilon_ \]
Diagnostics Measures
Remedial
Note
The multi-factor experiment is
And the model is
\[ \mathbf = \mathbf \beta + \epsilon \]
\[ \begin E(\mathbf) &= \mathbf\beta \\ var(\mathbf) &= \sigma^2 \mathbf \end \]
Interaction
\[ (\alpha \beta)_ = \mu_ - (\mu_+ \alpha_i + \beta_j) \]
\[ \begin \sum_i(\alpha \beta)_ &= \sum_i (\mu_ - \mu_ - \alpha_i - \beta_j) \\ &= \sum_i \mu_ - a \mu_ - \sum_i \alpha_i - a \beta_j \\ &= a \mu_ - a \mu_- \sum_i (\mu_ - \mu_) - a(\mu_-\mu_) \\ &= a \mu_ - a \mu_ - a \mu_+ a \mu_ - a (\mu_ - \mu_) \\ &= 0 \end \]
Similarly, \(\sum_j (\alpha \beta) = 0, i = 1. a\) and \(\sum_i \sum_j (\alpha \beta)_ =0\) , \(\sum_i \alpha_i = 0\) , \(\sum_j \beta_j = 0\)
\[ \begin \mu_ &= \mu_ + \alpha_i + \beta_j + (\alpha \beta)_ \\ Y_ &= \mu_ + \alpha_i + \beta_j + (\alpha \beta)_ + \epsilon_ \end \]
\[ \begin E(Y_) &= \mu_ + \alpha_i + \beta_j + (\alpha \beta)_\\ var(Y_) &= \sigma^2 \\ Y_ &\sim N (\mu_ + \alpha_i + \beta_j + (\alpha \beta)_, \sigma^2) \end \]
We have \(1+a+b+ab\) parameters. But there are \(ab\) parameters in the Cell Means Model. In the Factor Effects Model, the restrictions limit the number of parameters that can be estimated:
\[ \begin 1 &\text < for >\mu_ \\ (a-1) &\text < for >\alpha_i \\ (b-1) &\text < for >\beta_j \\ (a-1)(b-1) &\text < for >(\alpha \beta)_ \end \]
Hence, there are
\[ 1 + a - 1 + b - 1 + ab - a- b + 1 = ab \]
parameters in the model.
We can have several restrictions when considering the model in the form \(\mathbf = \mathbf \beta + \epsilon\)
We can fit the model by least squares or maximum likelihood
Cell Means Model
minimize
\[ Q = \sum_i \sum_j \sum_k (Y_-\mu_)^2 \]
Factor Effects Model
\[ Q = \sum_i \sum_j \sum_k (Y_ - \mu_-\alpha_i = \beta_j - (\alpha \beta)_)^2 \]
subject to the restrictions
\[ \begin \sum_i \alpha_i &= 0 \\ \sum_j \beta_j &= 0 \\ \sum_i (\alpha \beta)_ &= 0 \\ \sum_j (\alpha \beta)_ &= 0 \end \]
The fitted values
\(Y_ - \bar_<. >\) : Total deviation
\(\bar_ - \bar_<. >\) : Deviation of treatment mean from overall mean
\(Y_ - \bar_\) : Deviation of observation around treatment mean (residual).
\[ \begin \sum_i \sum_j \sum_k (Y_ - \bar_<. >)^2 &= n \sum_i \sum_j (\bar_- \bar_<. >)^2+ \sum_i \sum_j sum_k (Y_ - \bar)^2 \\ SSTO &= SSTR + SSE \end \]
(cross product terms are 0)
squaring and summing:
\[ \begin n\sum_i \sum_j (\bar_-\bar_<. >)^2 &= nb\sum_i (\bar_-\bar_<. >)^2 + na \sum_j (\bar_-\bar_<. >)^2 \\ &+ n \sum_i \sum_j (\bar_-\bar_- \bar_+ \bar_<. >)^2 \\ SSTR &= SSA + SSB + SSAB \end \]
The interaction term from
\[ \begin SSAB &= SSTO - SSE - SSA - SSB \\ SSAB &= SSTR - SSA - SSB \end \]
\(N = abn\) cases and \(ab\) treatments.
For one-way ANOVA and regression, the partition has df:
\[ SS: SSTO = SSTR + SSE \]
we must further partition the \(ab-1\) df with SSTR
\[ SSTR = SSA + SSB + SSAB \]
The expected mean squares are
If there are no factor A main effects (all \(\mu_ = 0\) or \(\alpha_i = 0\) ) the MSA and MSE have the same expectation; otherwise MSA > MSE. Same for factor B, and interaction effects. which case we can examine F-statistics.
Interaction
\[ \begin &H_0: \text(\alpha \beta)_ = 0 \\ &H_a: \text (\alpha \beta) = 0 \end \]
Factor A main effects:
Source of Variation | SS | df | MS | F |
---|---|---|---|---|
Factor A | \(SSA\) | \(a-1\) | \(MSA = SSA/(a-1)\) | \(MSA/MSE\) |
Factor B | \(SSB\) | \(b-1\) | \(MSB = SSB/(b-1)\) | \(MSB/MSE\) |
AB interactions | \(SSAB\) | \((a-1)(b-1)\) | \(MSAB = SSAB /MSE\) | |
Error | \(SSE\) | \(ab(n-1)\) | \(MSE = SSE/ab(n-1)\) | |
Total (corrected) | \(SSTO\) | \(abn - 1\) |
Doing 2-way ANOVA means you always check interaction first, because if there are significant interactions, checking the significance of the main effects becomes moot.
The main effects concern the mean responses for levels of one factor averaged over the levels of the other factor. When interaction is present, we can’t conclude that a given factor has no effect, even if these averages are the same. It means that the effect of the factor depends on the level of the other factor.
On the other hand, if you can establish that there is no interaction, then you can consider inference on the factor main effects, which are then said to be additive.
And we can also compare factor means like the Single Factor Fixed Effects Model using Tukey, Scheffe, Bonferroni.
We can also consider contrasts in the 2-way model
\[ L = \sum c_i \mu_i \]
where \(\sum c_i =0\)
which is estimated by
and variance estimate
Orthogonal Contrasts
\[ \begin L_1 &= \sum c_i \mu_i, \sum c_i = 0 \\ L_2 &= \sum d_i \mu_i , \sum d_i = 0 \end \]
these contrasts are said to be orthogonal if
in balanced case \(\sum c_i d_i =0\)
\[ \begin cov(\hat_1, \hat_2) &= cov(\sum_i c_i \bar_, \sum_l d_l \bar_) \\ &= \sum_i \sum_l c_i d_l cov(\bar_,\bar_) \\ &= \sum_i c_i d_i \frac = 0 \end \]
Orthogonal contrasts can be used to further partition the model sum of squares. There are many sets of orthogonal contrasts and thus, many ways to partition the sum of squares.
A special set of orthogonal contrasts that are used when the levels of a factor can be assigned values on a metric scale are called orthogonal polynomials
Coefficients can be found for the special case of
We can define the SS for a given contrast:
all contrasts have d.f = 1
We could have unequal numbers of replications for all treatment combinations:
Assume that each factor combination has at least 1 observation (no empty cells)
Consider the same model as:
\[ Y_ = \mu_ + \alpha_i + \beta_j + (\alpha \beta)_ + \epsilon_ \]
where sample sizes are: \(n_\) :
\[ \begin n_ &= \sum_j n_ \\ n_ &= \sum_i n_ \\ n_T &= \sum_i \sum_j n_ \end \]
Problem here is that
\[ SSTO \neq SSA + SSB + SSAB + SSE \]
(the design is non-orthogonal)
We can use these indicator variables as predictor variables and \(\mu_, \alpha_i ,\beta_j, (\alpha \beta)_\) as unknown parameters.
\[ Y = \mu_ + \sum_^ \alpha_i u_i + \sum_^ \beta_j v_j + \sum_^ \sum_^(\alpha \beta)_ u_i v_j + \epsilon \]
To test hypotheses, we use the extra sum of squares idea.
For interaction effects
\[ \begin &H_0: all (\alpha \beta)_ = 0 \\ &H_a: \text(\alpha \beta)_ =0 \end \]
\[ \begin &H_0: \beta_1 = \beta_2 = \beta_3 = 0 \\ &H_a: \text \beta_j = 0 \end \]
Analysis of Factor Means
(e.g., contrasts) is analogous to the balanced case, with modifications in the formulas for means and standard errors to account for unequal sample sizes.
Or , we can fit the cell means model and consider it from a regression perspective
If you have empty cells (i.e., some factor combinations have no observation), then the equivalent regression approach can’t be used. But you can still do partial analyses
\[ Y_ = \mu_ + \alpha_i + \beta_j + (\alpha \beta)_ + \epsilon_ \]
All \(\alpha_i, \beta_j, (\alpha \beta)_\) are pairwise independent
Theoretical means, variances, and covariances are
\[ \begin E(Y_) &= \mu_ \\ var(Y_) &= \sigma^2_Y= \sigma^2_\alpha + \sigma^2_\beta + \sigma^2_ + \sigma^2 \end \]
\(Y_ \sim N(\mu_,\sigma^2_\alpha + \sigma^2_\beta + \sigma^2_ + \sigma^2)\)
\[ \begin cov(Y_,Y_) &= \sigma^2_, j \neq j' \\ cov(Y_,Y_) &= \sigma^2_, i \neq i'\\ cov(Y_,Y_) &= \sigma^2_\alpha + \sigma^2_ + \sigma^2_, k \neq k' \\ cov(Y_,Y_) &= , i \neq i', j \neq j' \end \]
One fixed factor, while other is random treatment levels, we have a mixed effects model or a mixed model
Restricted mixed model for 2-way ANOVA:
\[ Y_ = \mu_ + \alpha_i + \beta_j + (\alpha \beta)_ + \epsilon_ \]
Two-way mixed models are written in an “unrestricted” form, with no restrictions on the interaction effects \((\alpha \beta)_\) , they are pairwise independent.
Let \(\beta^*, (\alpha \beta)^*_\) be the unrestricted random effects, and \((\bar)_^*\) the means averaged over the fixed factor for each level of random factor B.
Some consider the restricted model to be more general. but here we consider the restricted form.
Responses from the same random factor \((B)\) level are correlated
Hence, you can see that the only way you don’t have dependence in the \(Y\) is when they don’t share the same random effect.
An advantage of the restricted mixed model is that 2 observations from the same random factor b level can be positively or negatively correlated. In the unrestricted model, they can only be positively correlated.
(A fixed, B random)
For fixed, random, and mixed models (balanced), the ANOVA table sums of squares calculations are identical. (also true for df and mean squares). The only difference is with the expected mean squares, thus the test statistics.
In Random ANOVA, we test
\[ \begin &H_0: \sigma^2 = 0 \\ &H_a: \sigma^2 > 0 \end \]
The same test statistic is used for mixed models, but in that case we are testing null hypothesis that all of the \(\alpha_i = 0\)
The test statistic different for the same null hypothesis under the fixed effects model.
(A fixed, B random)
Estimation Of Variance Components
In random and mixed effects models, we are interested in estimating the variance components
Variance component \(\sigma^2_\beta\) in the mixed ANOVA.
which can be estimated with
Confidence intervals for variance components can be constructed (approximately) by using the Satterthwaite procedure or the MLS procedure (like the 1-way random effects)
Estimation of Fixed Effects in Mixed Models
Contrasts on the Fixed Effects
\[ \begin L &= \sum c_i \alpha_i \\ \sum c_i &= 0 \\ \hat &= \sum c_i \hat_i \\ \sigma^2(\hat) &= \sum c^2_i \sigma^2 (\hat_i) \\ s^2(\hat) &= \frac \sum c^2_i \end \]
Confidence intervals and tests can be constructed as usual
For a mixed model with a = 2, b = 4
\[ \mathbf \sim N(\mathbf\beta, M) \]
where \(M\) is block diagonal
if we knew the variance components, we could use GLS:
but we usually don’t know the variance components \(\sigma^2, \sigma^2_\beta, \sigma^2_\) that make up \(M\)
Another way to get estimates is by Maximum likelihood estimation
we try to maximize its log