fit_glm: Fit a linear model to EEG data

View source: R/glm_fitting.R

fit_glmR Documentation

Fit a linear model to EEG data

Description

Fits a linear model to each timepoint separately for each electrode.

Usage

fit_glm(formula, data, ...)

## S3 method for class 'eeg_epochs'
fit_glm(formula, data, time_lim = NULL, ...)

Arguments

formula

An object of class formula. Right-hand side A regression formula for a GLM. See ?formula and notes on use below

data

An eegUtils object.

...

Any other arguments passed to (LM/GLM)

time_lim

Numeric vector of length 2 specifying time period to be used as a baseline.

Methods (by class)

  • eeg_epochs: GLM fitting for eeg_epochs

Notes On Usage

The fit_glm function will fit a linear model to each timepoint for each electrode in the input dataset.

The formula is a standard R formula. Specify only the right-hand side of the formula i.e. any predictors.

The function allows flexible fitting of a baseline covariate, recognising the term baseline in the specified formula.

Author(s)

Matt Craddock, matt@mattcraddock.com


craddm/eegUtils documentation built on March 24, 2022, 9:17 a.m.