| permtest_metric | R Documentation |
Computes a user-specified metric between two vectors and tests significance using either spatially-constrained null surrogates or simple random permutation.
permtest_metric(
x,
y,
metric_func = stats::cor,
n_perm = 1000L,
seed = NULL,
null_method = NULL,
distmat = NULL,
coords = NULL,
parcellation = NULL,
...
)
x, y |
Numeric vectors. |
metric_func |
Function taking |
n_perm |
Integer number of permutations. |
seed |
Optional integer seed for reproducibility. |
null_method |
Optional null model method passed to |
distmat |
Distance matrix (passed to |
coords |
Coordinate list (passed to |
parcellation |
Integer vector (passed to |
... |
Additional arguments passed to |
List with $observed, $null_values, $p_value, and $n_perm.
Markello RD et al. (2022) Nature Methods 19:1472-1480. doi:10.1038/s41592-022-01625-w
x <- rnorm(100)
y <- x + rnorm(100)
result <- permtest_metric(x, y, n_perm = 99L, seed = 1L)
result$observed
result$p_value
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.