Define a linear contrast using a formula expression.
Usage
contrast(form, name, where = NULL)
Arguments
- form
A formula describing the contrast.
- name
A character label for the contrast.
- where
An expression defining the subset over which the contrast is applied (default: NULL).
Value
A list containing the contrast specification.
Examples
# A minus B contrast
contrast(~ A - B, name="A_B")
#> $A
#> ~A - B
#> <environment: 0x7f8f6113bac0>
#>
#> $B
#> NULL
#>
#> $where
#> NULL
#>
#> $name
#> [1] "A_B"
#>
#> attr(,"class")
#> [1] "contrast_formula_spec" "contrast_spec" "list"