Performs group-level Bayesian GLM estimation and inference using the joint approach described in Mejia et al. (2020).
BayesGLM2(
results,
contrasts = NULL,
quantiles = NULL,
excursion_type = NULL,
contrast_names = NULL,
gamma = 0,
alpha = 0.05,
nsamp_theta = 50,
nsamp_beta = 100,
num_cores = NULL,
verbose = 1
)BayesGLM_group(
results,
contrasts = NULL,
quantiles = NULL,
excursion_type = NULL,
gamma = 0,
alpha = 0.05,
nsamp_theta = 50,
nsamp_beta = 100,
num_cores = NULL,
verbose = 1
)
A list containing the estimates, PPMs and areas of activation for each contrast.
Either (1) a length \(N\) list of "BayesGLM"
objects,
or (2) a length \(N\) character vector of files storing "BayesGLM"
objects saved with saveRDS
.
(Optional) A list of contrast vectors that specify the
group-level summaries of interest. If NULL
, use contrasts that compute
the average of each field (task HRF) across subjects and sessions.
Each contrast vector is length \(K * S * N\) vector specifying a group-level summary of interest, where \(K\) is the number of fields (task HRFs), \(S\) is the number of sessions, and \(N\) is the number of subjects. For a single subject-session the contrast for the first field would be:
contrast1 <- c(1, rep(0, K-1))
and so the full contrast vector representing the group average across sessions and subjects for the first task would be:
rep(rep(contrast1, S), N) /S /N
.
To obtain the group average for the first task, for just the first sessions from each subject:
rep(c(contrast1, rep(0, K*(S-1))), N) /N
.
To obtain the mean difference between the first and second sessions, for the first task:
rep(c(contrast1, -contrast1, rep(0, K-2)), N) /N
.
To obtain the mean across sessions of the first task, just for the first subject:
c(rep(contrast1, S-1), rep(0, K*S*(N-1)) /S
.
(Optional) Vector of posterior quantiles to return in addition to the posterior mean.
(For inference only) The type of excursion function for
the contrast (">", "<", "!="), or a vector thereof (each element
corresponding to one contrast). If NULL
, no inference performed.
(Optional) Names of contrasts.
(For inference only) Activation threshold for the excursion set,
or a vector thereof (each element corresponding to one contrast). Default:
0
.
(For inference only) Significance level for activation for the
excursion set, or a vector thereof (each element corresponding to one
contrast). Default: .05
.
Number of theta values to sample from posterior. Default:
50
.
Number of beta vectors to sample conditional on each theta
value sampled. Default: 100
.
The number of cores to use for sampling betas in parallel. If
NULL
(default), do not run in parallel.
Should updates be printed? Use 1
(default) for
occasional updates, 2
for occasional updates as well as running INLA
in verbose mode (if applicable), or 0
for no updates.
This function requires the INLA
package, which is not a CRAN package.
See https://www.r-inla.org/download-install for easy installation instructions.