estimate_betas.fmri_dataset | R Documentation |
This function estimates betas (regression coefficients) for fixed and random effects using various regression methods including mixed models, least squares, and PLS.
## S3 method for class 'fmri_dataset'
estimate_betas(
x,
fixed = NULL,
ran,
block,
method = c("mixed", "mixed_cpp", "lss", "lss_naive", "lss_cpp", "pls", "pls_global",
"ols"),
basemod = NULL,
maxit = 1000,
fracs = 0.5,
progress = TRUE,
...
)
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", "mixed_cpp", "lss", "lss_naive", "lss_cpp", "pls", "pls_global", or "ols". |
basemod |
A |
maxit |
Maximum number of iterations for optimization methods (default: 1000). |
fracs |
Fraction of voxels used for prewhitening. |
progress |
Logical; show progress bar. |
... |
Additional arguments passed to the estimation method. |
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.
estimated_hrf: The estimated HRF vector (NULL for most methods).
fmri_dataset
, baseline_model
, event_model
## Not run:
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, method="mixed")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.