Skip to contents

Turn a contrast into a set of contrasts, one for each basis function of a multi-basis HRF. With an FIR basis this gives the contrast's time course, one contrast per time bin.

Usage

per_basis_contrasts(con, basis)

Arguments

con

A contrast specification that has a basis argument: pair_contrast(), unit_contrast(), oneway_contrast() or poly_contrast().

basis

Integer vector of basis-function indices, e.g. 1:8 for an HRF with eight basis functions.

Value

A contrast_set() with one copy of con per index, restricted to that basis function and named <name>_b01, <name>_b02, ...

See also

pair_contrast() for averaging over or weighting basis functions.

Examples

# A - B in each of the 8 bins of an FIR basis
per_basis_contrasts(
  pair_contrast(~ cond == "A", ~ cond == "B", name = "AvB"),
  basis = 1:8
)
#> 
#> === Contrast Set ===
#> 
#>  Overview:
#>   * Number of contrasts: 8 
#>   * Types of contrasts:
#>     - pair_contrast_spec : 8 
#> 
#>   Individual Contrasts:
#> 
#> [1] AvB_b01 (pair_contrast_spec)
#>     Formula: ~cond == "A" vs  ~cond == "B"
#> 
#> [2] AvB_b02 (pair_contrast_spec)
#>     Formula: ~cond == "A" vs  ~cond == "B"
#> 
#> [3] AvB_b03 (pair_contrast_spec)
#>     Formula: ~cond == "A" vs  ~cond == "B"
#> 
#> [4] AvB_b04 (pair_contrast_spec)
#>     Formula: ~cond == "A" vs  ~cond == "B"
#> 
#> [5] AvB_b05 (pair_contrast_spec)
#>     Formula: ~cond == "A" vs  ~cond == "B"
#> 
#> [6] AvB_b06 (pair_contrast_spec)
#>     Formula: ~cond == "A" vs  ~cond == "B"
#> 
#> [7] AvB_b07 (pair_contrast_spec)
#>     Formula: ~cond == "A" vs  ~cond == "B"
#> 
#> [8] AvB_b08 (pair_contrast_spec)
#>     Formula: ~cond == "A" vs  ~cond == "B"
#>