prescale_fit | R Documentation |
Fit and apply a prescaling of magnetic resonance imaging (MRI) data from different sites, especially relevant for fMRI, where different devices can have varying units of measurement.
prescale_fit(dat, site, cov = NULL, n.min = 10, impute_missing_cov = FALSE,
verbose = TRUE)
prescale_apply(combat_parameters, dat, site, cov = NULL, verbose = TRUE)
dat |
matrix or data.frame with the MRI data (e.g., ROIs, voxels, vertexes, etc.). |
site |
factor specifying the site of each individual. |
cov |
matrix or data.frame with the covariates. |
combat_parameters |
a list of combat parameters returned by |
n.min |
(optional) number specifying the minimum size of a site to be analyzed. |
impute_missing_cov |
(optional) logical, whether to impute missing covariates. |
verbose |
(optional) logical, whether to print some messages during execution. |
prescale_fit
function finds a prescaling parameter for each site so that, after calling prescale_apply
, the voxelwise-median standard deviation after removing the effects of covariates is 1 (in the training data, but it might not be the case in new data).
prescale_fit
returns a list of parameters for prescale_apply
; prescale_apply
returns the list of parameters plus the prescaled data (item dat.combat
)
Joaquim Radua
Neural correlates of human fear conditioning and sources of variability: A mega-analysis and normative modeling study of fMRI data from 2,199 individuals, to be submitted.
combat_fit
, and lmm_fit
raw_mri = combat_example[,6:19]
site = factor(combat_example$site)
# Fit and apply prescale to prescale mri data across sites
mod = as.matrix(combat_example[,c("disorder", "age", "sex")])
prescaling = prescale_fit(raw_mri, site, mod)
prescaled_mri = prescale_apply(prescaling, raw_mri, site, mod)$dat.combat
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.