Skip to contents

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

Usage

hrf(
  ...,
  basis = "spmg1",
  onsets = NULL,
  durations = NULL,
  prefix = NULL,
  subset = NULL,
  precision = 0.3,
  nbasis = 1,
  contrasts = NULL,
  id = NULL,
  lag = 0,
  summate = TRUE
)

Arguments

...

the variable names, all of which must be present in the enclosing environment (e.g. an event_model object)

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

nbasis

number of basis functions -- only used for hemodynamic response functions (e.g. bspline) that take a variable number of bases.

contrasts

one or more contrast_spec objects created with the contrast function. If multiple contrasts are required, then these should be wrapped in a list or contrast_set.

id

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

lag

a temporal offset in seconds which is added to onset before convolution

summate

whether impulse amplitudes sum up when duration is greater than 0.

Examples


## 'hrf' is typically used in the context of \code{formula}s.

form <- onsets ~ hrf(x) + hrf(y) + hrf(x,y)