Two way ANOVA with SAS

  1. Explain the question with an example
  2. Two way ANOVA procedure

Explain the question with an example

When there are one dependent variable and two or more independent variables, a two (or n) way ANOVA model sounds appropriate.

Iorn and Zinc fortification of milk-based fruit drinks are common practice. To better understand the effects of drink fortification on the cellular retentionof iron, researchers conducted an experiment by fortifying milk-based fruit drinks with low and high levels of iron (Fe) and zinc (Zn). The drinks were digested in a simulated gastroinatestinal tract and cellular iron retention was measured (mg Fe/mg cell protein). Data is available at Retention.csv .

For the study, there is one continuous dependent varialble (Fe retention), and two categorical independent variables, Fe (low/high) and Zn (low/high). A two-way ANOVA can be applied as follows.

Standard two-way ANOVA procedure

Open the data set from SAS. Or import with the following command.

 
  data retention;
	infile "H:\sas\data\retention.csv" dlm=',' firstobs=2;
	input retention Fe $ Zn $;
    run;

Then a two way ANOVA can be requested as following.

   proc anova data=retention;
      class Fe Zn;
	  model retention = Fe Zn Fe*Zn;
   run;

The "model" statement lists retention as dependent variable, Fe and Ze as independent variable. Further more, Fe*Zn represents the interactions between Fe and Zn. If the interaction effect is proved insignificant, one can refit the data without the interaction effect Fe*Zn.

Reading the output

	 The ANOVA procedure
	 
	 Dependent Variable: retention

                                               Sum of
       Source                      DF         Squares     Mean Square    F Value    Pr > F

       Model                        3      6.06863649      2.02287883    1082.46    <.0001

       Error                       28      0.05232581      0.00186878

       Corrected Total             31      6.12096230


                     R-Square     Coeff Var      Root MSE    retention Mean

                     0.991451      5.198064      0.043229          0.831644


       Source                      DF        Anova SS     Mean Square    F Value    Pr > F

       Fe                           1      4.40228628      4.40228628    2355.70    <.0001
       Zn                           1      0.01087812      0.01087812       5.82    0.0226
       Fe*Zn                        1      1.65547208      1.65547208     885.86    <.0001
		        

Interpreting the result

The anova results show that interaction Fe*Zn has a significant effect (p-value<.0001). When interactions are present, the main effects of the independent variables don't have their usual interpretations. It is now difficult to state the independent effect of Fe because the nature and magnitude of the effect depends on the particular level of Zn supplementation. If no evidence for an interaction effect is found, then one can proceed to testing the main effects of the independent variables.