chickadee » statistics » two-way-anova

two-way-anova tableprocedure

Two-way analysis of variance for two crossed factors A and B in a balanced design. table has one element for each level of A; each of these has one cell for each level of B; and each cell holds the r values observed at that pair of levels. Every cell must hold the same number of values.

Returns three values, for A, for B and for their interaction, each a list (F p df df-error). With r of 2 or more, the error term is the within-cell sum of squares on ab(r - 1) degrees of freedom. With r = 1 the interaction cannot be told apart from error: the model is additive, the interaction sum of squares serves as the error term on (a - 1)(b - 1) degrees of freedom, and the third value is #f.

> (two-way-anova '(((12 14 13) (18 20 19) (15 14 16))
                   ((9 10 11) (22 24 23) (12 11 13))))
(2.0 0.182716762688545 1 12)
(150.5 3.17556824919085e-09 2 12)
(24.5 5.79573428394943e-05 2 12)