Construct pairwise contrasts for all combinations of factor levels.
Arguments
- levels
A vector of factor levels to be compared.
- where
An optional formula specifying the subset over which the contrast is computed.
Examples
pairwise_contrasts(c("A", "B", "C"))
#> [[1]]
#> $A
#> ~A
#> <environment: 0x7f8f66a215a8>
#>
#> $B
#> ~B
#> <environment: 0x7f8f66a215a8>
#>
#> $where
#> NULL
#>
#> $name
#> [1] "con_A_B"
#>
#> attr(,"class")
#> [1] "pair_contrast_spec" "contrast_spec" "list"
#>
#> [[2]]
#> $A
#> ~A
#> <environment: 0x7f8f66a2e950>
#>
#> $B
#> ~C
#> <environment: 0x7f8f66a2e950>
#>
#> $where
#> NULL
#>
#> $name
#> [1] "con_A_C"
#>
#> attr(,"class")
#> [1] "pair_contrast_spec" "contrast_spec" "list"
#>
#> [[3]]
#> $A
#> ~B
#> <environment: 0x7f8f66a390f8>
#>
#> $B
#> ~C
#> <environment: 0x7f8f66a390f8>
#>
#> $where
#> NULL
#>
#> $name
#> [1] "con_B_C"
#>
#> attr(,"class")
#> [1] "pair_contrast_spec" "contrast_spec" "list"
#>
#> attr(,"class")
#> [1] "contrast_set" "list"