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, baseline = NULL, ...)
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
Matt Craddock, matt@mattcraddock.com
Examples
fit_glm(~epoch_labels, demo_spatial)
#> EEG Linear Model
#>
#> Formula: ~ epoch_labels
#>
#> Number of fitted channels : 23
#> Channel names : Fp1 F3 F7 C3 T7 P3 P7 Oz Pz Fpz Fp2 Fz F4 F8 Cz C4 T8 P4 P8 EXG1 EXG2 EXG3 EXG4
#> Epoch limits : -0.301 - 0.488 seconds
fit_glm(~epoch_labels + baseline, demo_spatial, baseline = c(-.1, 0))
#> EEG Linear Model
#>
#> Formula: ~ epoch_labels + baseline
#>
#> Number of fitted channels : 23
#> Channel names : Fp1 F3 F7 C3 T7 P3 P7 Oz Pz Fpz Fp2 Fz F4 F8 Cz C4 T8 P4 P8 EXG1 EXG2 EXG3 EXG4
#> Epoch limits : -0.301 - 0.488 seconds