| compare_maps | R Documentation |
Computes the correlation between two brain maps and optionally tests significance using a spatial null model to account for spatial autocorrelation.
compare_maps(
x,
y,
method = c("pearson", "spearman"),
null_method = NULL,
n_perm = 1000L,
nulls = NULL,
distmat = NULL,
coords = NULL,
seed = NULL,
na.rm = TRUE,
verbose = TRUE,
...
)
## S3 method for class 'neuromaps_enhanced_comparison'
print(x, ...)
x, y |
Numeric vectors of brain map values, or file paths to GIFTI/NIfTI files. |
method |
Correlation method: |
null_method |
Optional null model method for empirical p-values.
One of |
n_perm |
Integer number of null permutations. |
nulls |
Pre-computed null_distribution object for |
distmat |
Distance matrix (passed to null model if needed). |
coords |
Coordinate list (passed to spin null models if needed). |
seed |
Optional integer seed for reproducibility. |
na.rm |
Logical, remove NA values before computing correlation. |
verbose |
Logical, print progress messages. |
... |
Additional arguments passed to |
A neuromaps_enhanced_comparison object (inherits
neuromaps_comparison) with additional fields p_null, null_method,
null_r, and n_perm.
Markello RD et al. (2022) Nature Methods 19:1472-1480. doi:10.1038/s41592-022-01625-w
x <- rnorm(50)
y <- x + rnorm(50)
compare_maps(x, y, verbose = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.