Skip to contents

This function fits a linear regression model for fMRI data analysis using the specified model formula, block structure, and dataset. The model can be fit using either a runwise or chunkwise data splitting strategy, and robust fitting can be enabled if desired.

Usage

fmri_lm(
  formula,
  block,
  baseline_model = NULL,
  dataset,
  durations,
  drop_empty = TRUE,
  robust = FALSE,
  strategy = c("runwise", "chunkwise"),
  nchunks = 10,
  ...
)

Arguments

formula

The model formula for experimental events.

block

The model formula for block structure.

baseline_model

(Optional) The baseline_model object. Default is NULL.

dataset

An object derived from fmri_dataset containing the time-series data.

durations

A vector of event durations.

drop_empty

Whether to remove factor levels with a size of zero. Default is TRUE.

robust

Whether to use robust fitting. Default is FALSE.

strategy

The data splitting strategy, either "runwise" or "chunkwise". Default is "runwise".

nchunks

Number of data chunks when strategy is chunkwise. Default is 10.

...

Extra arguments.

Value

A fitted linear regression model for fMRI data analysis.

See also

fmri_dataset, fmri_lm_fit

Examples

# Example usage of fmri_lm function
# ...