Lecture 5
Oct 7, 2025
HW5 (Due Friday Oct 9th)
- Analyze the data set warpbreaks that is included in R distribution. It is regarding the Number of Breaks in Yarn during Weaving. Describe how two factors affect the response. You can view the description and access the data in R by
- Briefly explain the difference between "correlation" and "interaction".
data(warpbreaks)
Decomposition of Variation
Let's use the Guinea Pig study as an example. We can see that there are 6 groups reflecting combination of two factors, the factor supplements has two levels (VC or OJ), and the factor dosage that has three levels (at 0.5, 1, and 2 mg), each group has 10 guinea pigs and we want to know how the two factors affect the tooth growth. To simplify our discussion, I will call supplement factor A, and dosage factor B, and let $y_{ijk}$ be the response of the kth guinea pig of the treatment group that is at the $i$th level of factor A, and $j$th level of factor B.
To answer these two questions, we apply the same exercises of breaking total variation of a response variable into summation of different sources in the following way,
$$\sum(y_{ijk}-\bar{y})^2 = \sum_{ijk}(\hat{y}_{ij}-\bar{y})^2+ \sum_{ijk}(y_{ijk}-\hat{y}_{ij})^2.$$
For $\hat{y}_{ij}$, the prediction of each treatment group, a reasonable choice would be the average tooth growth of 10 guinea pigs in each group, let denote it by $\bar{y}_{ij.}$. Note that when we do this, we are essentially treating it as a 6 group one-way ANOVA and not really considering the factor that there are two treatment factors to be studied here. So our next step is to further break down the first team on the right side of the equation into smaller components.
$$\sum_{ijk}(\bar{y}_{ij.}-\bar{y})^2 = \sum_{ijk}(\bar{y}_{i..}-\bar{y})^2+\sum_{ijk}(\bar{y}_{.j.}-\bar{y})^2+\sum_{ijk}(\bar{y}_{ij.}-\bar{y}_{i..}-\bar{y}_{.j.}+\bar{y})^2$$
The first component can be viewed as variation explained by factor A, the second component can be viewed as variations explained by factor B, the last component, can be viewed as variations explained by these two factors jointly but not yet explained by the first two components. Another way to characterize the three components is through the following two models. The first one is simply $$ E(y_{ij}) = \mu + \alpha_i + \beta_j,$$ in which the mean response of a treatment group is determined by the main effect of factor A and the main effect of factor B. The main effects of a factor are mean response at certain levels of the factor regardless of other factors. Under this model, we can estimate the overall mean by $\hat{\mu}=\bar{y}$, and the effects of factors A and B are estimated by
$$ \hat{\alpha}_i = \bar{y}_{i..}-\bar{y}, \hat{\beta}_j = \bar{y}_{.j.}-\bar{y}.$$ The prediction for the group that was given the ith level of factor A and the $j$th level of factor B is then
$$ \hat{y}_{ij} = \hat{\mu}+\hat{\alpha_i}+\hat{\beta_j}=\bar{y}+(\bar{y}_{i..}-\bar{y})+(\bar{y}_{.j.}-\bar{y})=\bar{y}_{i..}+\bar{y}_{.j.}-\bar{y}.$$ Note that the third term in the decomposition of $\sum_{ijk}(\bar{y}_{ij.}-\bar{y})^2$, $\sum_{ijk}(\bar{y}_{ij.}-\bar{y}_{i..}-\bar{y}_{.j.}+\bar{y})^2$, is then $\sum_{ijk}(\bar{y}_{ij.}-\hat{y}_{ij})^2$, the sum square of the difference between the observed mean of each group and the prediction based on the main effect additive model.
When the main effects model does not explain things well, we need add additional parameters which are referred as interactions effects between factors A and B,
$$ E(y_{ij}) = \mu + \alpha_i + \beta_j + \alpha\beta_{ij}.$$ The three components of the ANOVA represents the variation explained by $\alpha$'s, $\beta$'s and $\alpha\beta$'s. The interaction effect $\alpha\beta_{ij}$ is estimated by $\bar{y}_{ij.}-\bar{y}_{i..}-\bar{y}_{.j.}+\bar{y}$.
Comments
Post a Comment