`COMPARISON(f;s;m)`

estimates the comparisons amongst the levels of factor `f`

specified by the first `s`

rows of the matrix `m`

.

In regression models, the first argument may be a variate instead of a factor; `COMP(v;s;m)`

then fits a set of associated variates stored in the first `s`

rows of the rows of the matrix `m`

. In either case, the comparisons define explanatory variates to be included in the regression, and their parameter estimates are the resulting regression coefficients.

In `TREATMENTSTRUCTURE`

formulae (specifying a model for analysis-of-variance), the parameter estimates are the estimates of the comparisons themselves (i.e. `m*+e`

, where `e`

is the vector of estimated effects of factor `f`

). This differs from the use of `COMPARISON`

in regression models (and the use of the `REG`

function in either regression or analysis of variance) as there the parameter estimates are regression coefficients. Another difference is that in analysis of variance each comparison is fitted ignoring the other comparisons, but in regression they are adjusted for each other.