Because the results are deemed to be not significant then the next step is to test for the main effects of the treatment.

We now define a new variable equal to the sum of the observations for each animal. To test for the main treatment effect, consider the following linear combination of the observations for each dog; that is, the sum of all the data points collected for animal *j* receiving treatment *i*.

\(Z_{ij} = Y_{ij1}+Y_{ij2}+\dots + Y_{ijt}\)

This is going to be a random variable and a scalar quantity. We could then define the mean as:

\(E(Z_{ij}) = \mu_{Z_i} \)

Consider testing the following hypothesis that all of these means are equal to one another against the alternative that at least two of them are different, or:

\(H_0\colon \mathbf{\mu}_{Z_1} =\mathbf{\mu}_{Z_2} = \dots = \mathbf{\mu}_{Z_a} \)

ANOVA on the data *Z _{ij}* is carried out using the following MANOVA statement in the SAS program as shown below:

**Note**: In the upper right-hand corner of the code block you will have the option of copying (* *) the code to your clipboard or downloading (* *) the file to your computer.

```
options ls=78;
title "Repeated Measures - Coronary Sinus Potassium in Dogs";
data dogs;
infile "D:\Statistics\STAT 505\data\dog1.csv" firstobs=2 delimiter=',';
input treat dog p1 p2 p3 p4;
run;
proc print data=dogs;
run;
/* The class statement specifies treat as a categorical variable.
* The model statement specifies p1 through p4 as the responses
* and treat as the factor.
* The h= option in the manova statement is used to specify over
* which groups the mean response vectors are to be compared.
* The m= option specifies the transformation (if any) to be
* applied to the responses before the means are calculated.
*/
proc glm data=dogs;
class treat;
model p1 p2 p3 p4=treat;
manova h=treat / printe;
manova h=treat m=p1+p2+p3+p4;
manova h=treat m=p2-p1,p3-p2,p4-p3;
run;
```

**h=treat** sets the hypothesis test about treatments.

Then we set **m = p1+p2+p3+p4** to define the random variable Z as in the above.

Now, we must make sure that we are looking at the correct part of the output! We have defined a new variable MVAR in this case, a single variable that indicates that we are summing these four.

Results for Wilks Lambda:

Statistic | Value | F Value | Num DF | Den DF | Pr > F |
---|---|---|---|---|---|

Wilks' Lambda | 0.63985247 | 6.00 | 3 | 32 | 0.0023 |

Pillai's Trace | 0.3601453 | 6.00 | 3 | 32 | 0.0023 |

Hotelling-Lawley Trace | 0.56286025 | 6.00 | 3 | 32 | 0.0023 |

Roy's Greatest Root | 0.56286025 | 6.00 | 3 | 32 | 0.0023 |

This indicates that there is a significant main effect of treatment. That is that the mean response of our four-time variables differs significantly among treatments.

To fit the MANOVA model and test for treatment main effect

**Open**the ‘dog1’ data set in a new worksheet**Rename the columns**treat, dog, p1, p2, p3, and p4, from left to right.- Name a new column in the worksheet sum.
**Calc**>**Calculator**- Highlight and select sum for the Store result window
- In the expression window, enter p1+p2+p3+p4, and choose OK. The sum of the responses appears in the sum column in the worksheet.

**Stat**>**ANOVA**>**One-way**- Choose Response data are in one column.
- Highlight and select sum to move this to the Responses window.
- Highlight and select treat to move it to the Factor window.
- Choose OK. The results are shown in the results area.

## Conclusion

Treatments have a significant effect on the average coronary sinus potassium over the first four time points following occlusion \( \left( \Lambda = 0.640; F = 6.00; d. f. = 3, 32; p = 0.0023 \right) \).

In comparing this result with the results obtained from the split-plot ANOVA, we find that they are identical. The *F*-value, *p*-value, and degrees of freedom are all identical. This is not an accident! This is mathematical equality.