estimate_betas.fmri_dataset | R Documentation |
This function estimates betas (regression coefficients) for fixed and random effects in an fMRI dataset using various methods.
## S3 method for class 'fmri_dataset'
estimate_betas(
x,
fixed = NULL,
ran,
block,
method = c("mixed", "pls", "pls_searchlight", "pls_global", "ols"),
basemod = NULL,
radius = 8,
niter = 8,
ncomp = 4,
lambda = 0.01,
...
)
x |
An object of class |
fixed |
A formula specifying the fixed regressors that model constant effects (i.e., non-varying over trials) |
ran |
A formula specifying the random (trialwise) regressors that model single trial effects |
block |
A formula specifying the block factor |
method |
The regression method for estimating trialwise betas; one of "mixed", "pls", "pls_searchlight", "pls_global", or "ols" (default: "mixed") |
basemod |
A |
radius |
The radius in mm for the |
niter |
Number of searchlight iterations for the "pls_searchlight" method (default: 8) |
ncomp |
Number of PLS components for the "pls", "pls_searchlight", and "pls_global" methods (default: 4) |
lambda |
Lambda parameter (not currently used; default: 0.01) |
... |
Additional arguments passed to the estimation method |
The method
argument allows for several beta estimation approaches:
"mixed": Uses a linear mixed-effects modeling of trialwise random effects as implemented in the rrBLUP
package.
"pls": Uses separate partial least squares for each voxel to estimate trialwise betas.
"pls_searchlight": Estimates PLS solutions over searchlight windows and averages the beta estimates.
"pls_global": Estimates a single multiresponse PLS solution, where the Y
matrix is the full data matrix.
"ols": Ordinary least squares estimate of betas – no regularization.
A list of class "fmri_betas" containing the following components:
betas_fixed: NeuroVec object representing the fixed effect betas
betas_ran: NeuroVec object representing the random effect betas
design_ran: Design matrix for random effects
design_fixed: Design matrix for fixed effects
design_base: Design matrix for baseline model
basemod: Baseline model object
fixed_model: Fixed effect model object
ran_model: Random effect model object
fmri_dataset
, baseline_model
facedes <- read.table(system.file("extdata", "face_design.txt", package = "fmrireg"), header=TRUE)
facedes$frun <- factor(facedes$run)
scans <- paste0("rscan0", 1:6, ".nii")
dset <- fmri_dataset(scans=scans,mask="mask.nii",TR=1.5,run_length=rep(436,6),event_table=facedes)
fixed = onset ~ hrf(run)
ran = onset ~ trialwise()
block = ~ run
betas <- estimate_betas(dset, fixed=fixed, ran=ran, block=block
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.