Skip to content
Prev 170688 / 398506 Next

Comparison of age categories using contrasts

One approach is to create your own contrasts matrix:
Now when you use agefactor, the intercept will be the first age group and the slopes will be the differences between the pairs of groups (make sure that the order of the levels of agefactor is correct).

The difference between this method and the contr.sdif function in MASS is how the intercept will end up being interpreted (and the dimnames).

Hope this helps,