## 8.1 Interation in ANOVA

**Oneway ANOVA** means there is a single factor with two or more levels (e.g., book formats such as hard cover, paperback and eBook). **Factorial ANOVA** means there are two or more independent factors with two or more levels.
**Fully crossed** means that all combinations of the levels of the factors “(beef/high protein + beef/low protein + cereal/high protein + cereal/low protein)” are present in the experiment.

```
<- aov(weightgain ~ source * type, data=weightgain)
aovOut summary(aovOut)
## Df Sum Sq Mean Sq F value Pr(>F)
## source 1 221 220.9 0.988 0.3269
## type 1 1300 1299.6 5.812 0.0211 *
## source:type 1 884 883.6 3.952 0.0545 .
## Residuals 36 8049 223.6
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
```

The p-value suggests that there is no statistically significant interaction between food source and diet type. There is no significant effect for the main effect of source (F(1,36)=0.988, N.S.)

```
<- rf(n=10000, df1=1, df2=36) # Generate random Fs for F(1,36)
testF hist(testF)
abline(v=quantile(testF,c(0.95)),col="black")
```

```
quantile(testF,c(0.95))
## 95%
## 4.00811
```

The code above draws a vertical line at the point where the F distribution is split into a tail on the right and a central region on the left, each of which contains 5% of the points. The statistical significance criterion is indicated by that vertical line.