Skip to contents

robust linear modeling of fmri data

Usage

fmri_rlm(
  formula,
  block,
  baseline_model = NULL,
  dataset,
  durations,
  drop_empty = TRUE,
  nchunks = 10,
  strategy = c("runwise", "slicewise", "all")
)

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.

nchunks

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

strategy

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

Examples

etab <- data.frame(onset=c(1,30,15,25), fac=factor(c("A", "B", "A", "B")), run=c(1,1,2,2))
etab2 <- data.frame(onset=c(1,30,65,75), fac=factor(c("A", "B", "A", "B")), run=c(1,1,1,1))
mat <- matrix(rnorm(100*100), 100,100)
dset <- matrix_dataset(mat, TR=1, run_length=c(50,50),event_table=etab)
dset2 <- matrix_dataset(mat, TR=1, run_length=c(100),event_table=etab2)
#lm.1 <- fmri_rlm(onset ~ hrf(fac), block= ~ run,dataset=dset)
#lm.2 <- fmri_rlm(onset ~ hrf(fac), block= ~ run,dataset=dset2)