### Stata FAQ How can I test for nonadditivity in a randomized block ANOVA in Stata?

Now, let's read in an example dataset, rb4a, which is adapted from Kirk (1982, 2nd Edition). This example has eight subjects with four repeated measures on each subject.
use http://www.ats.ucla.edu/stat/stata/faq/rb4a, clear
Let's look at a table of the data.
table s a, contents(mean y)

----------+-----------------------
|           a
s |    1     2     3     4
----------+-----------------------
1 |    3     4     7     7
2 |    6     5     8     8
3 |    3     4     7     9
4 |    3     3     6     8
5 |    1     2     5    10
6 |    2     3     6    10
7 |    2     4     5     9
8 |    2     3     6    11
----------+-----------------------
Now let's compute the randomized block ANOVA.
anova y a s

Number of obs =      32     R-squared     =  0.8790
Root MSE      = 1.16496     Adj R-squared =  0.8214

Source |  Partial SS    df       MS           F     Prob > F
-----------+----------------------------------------------------
Model |      207.00    10       20.70      15.25     0.0000
|
a |      194.50     3  64.8333333      47.77     0.0000
s |       12.50     7  1.78571429       1.32     0.2914
|
Residual |       28.50    21  1.35714286
-----------+----------------------------------------------------
Total |      235.50    31  7.59677419
Next, we'll do the test for nonadditivity. Note that the variables are entered the same way as for the randomized block analysis.
nonadd y a s

Tukey's test of nonadditivity for randomized block designs
F (1,20) = 7.8345468   Pr > F: .01108091
In this case the test for nonadditivity was statistically significant, the data are nonadditive.

Here is a second example, rb4b, this time from Kirk's 3rd edition. Again, it has eight subjects with four repeated measures on each subject.
use http://www.ats.ucla.edu/stat/stata/faq/rb4b, clear

table s a, contents(mean y)

----------+-----------------------
|           a
s |    1     2     3     4
----------+-----------------------
1 |    3     4     4     3
2 |    2     4     4     5
3 |    2     3     3     6
4 |    3     3     3     5
5 |    1     2     4     7
6 |    3     3     6     6
7 |    4     4     5    10
8 |    6     5     5     8
----------+-----------------------
anova y a s

Number of obs =      32     R-squared     =  0.7318
Root MSE      = 1.18523     Adj R-squared =  0.6041

Source |  Partial SS    df       MS           F     Prob > F
-----------+----------------------------------------------------
Model |       80.50    10        8.05       5.73     0.0004
|
a |       49.00     3  16.3333333      11.63     0.0001
s |       31.50     7        4.50       3.20     0.0180
|
Residual |       29.50    21   1.4047619
-----------+----------------------------------------------------
Total |      110.00    31   3.5483871

Tukey's test of nonadditivity for randomized block designs
F (1,20) = 1.2795813   Pr > F: .27135918
This time the test for nonadditivity was not significant, that is, there is no indication of a treatment by block interaction.

The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.