Skip to contents

This function is to be used in formulas for fitting functions, e.g. onsets ~ trialwise() ...

Usage

trialwise(
  label = "trialwise",
  basis = "spmg1",
  onsets = NULL,
  durations = NULL,
  prefix = NULL,
  subset = NULL,
  precision = 0.3,
  id = NULL,
  add_sum = FALSE
)

Arguments

label

the label for the generated variable.

basis

the impulse response function or the name of a pre-supplied function, one of: "gamma", "spmg1", "spmg2", "spmg3", "bspline", "gaussian".

onsets

optional onsets override. If missing, onsets will be taken from the event_model

durations

optional durations override. If missing, onsets will be taken from the event_model

prefix

a character string that is prepended to the variable names and used to identify the term. Can be used to disambiguate two hrf terms with the same variable(s) but different onsets or basis functions.

subset

an expression indicating the subset of 'onsets' to keep

precision

sampling precision in seconds

id

a unique character identifier used to refer to term, otherwise will be determined from variable names.

add_sum

add the sum of all trialwise regressors to the set. This can be sued to model the average effect.

Examples

x <- trialwise(basis="gaussian", onsets=c(1,17,25), durations=c(1,2,3))