Create a one-way contrast specification
Arguments
- A
A formula specifying the contrast
- name
The name of the contrast
- where
An optional formula specifying the subset over which the contrast is computed.
- basis
NULL (default: use all basis functions), an integer vector specifying which basis function indices to include, or
"all". Seepair_contrastfor details on basis filtering.- basis_weights
NULL (default: equal weights), or a numeric vector of weights to apply to the selected basis functions. Must have the same length as
basisselection and will be normalized to sum to 1. Seepair_contrastfor details on basis weighting.
See also
interaction_contrast for testing interactions,
pair_contrast for pairwise comparisons
Examples
# Create a one-way contrast for a factor 'basis'
con <- oneway_contrast(~ basis, name = "Main_basis")
# Create a one-way contrast with a 'where' clause
con <- oneway_contrast(~ basis, name = "Main_basis",
where = ~ block == 1)
# Test only first two basis functions
con <- oneway_contrast(~ condition, name = "Main_early", basis = 1:2)