Skip to contents

Contrasts for factors using effect coding (when k > 2) or dummy coding (when k = 2)

Usage

contr.dummy_or_effect(...)

Arguments

...

Passed to contr.treatment()

Value

Matrix with contrasts

Examples

contr.dummy_or_effect(3)
#>    2  3
#> 1 -1 -1
#> 2  1  0
#> 3  0  1
options(contrasts=c(unordered="contr.dummy_or_effect", ordered="contr.poly"))