Computes a user-specified metric between two vectors and tests significance using either spatially-constrained null surrogates or simple random permutation.
Usage
permtest_metric(
x,
y,
metric_func = stats::cor,
n_perm = 1000L,
seed = NULL,
null_method = NULL,
distmat = NULL,
coords = NULL,
parcellation = NULL,
...
)Arguments
- x, y
Numeric vectors.
- metric_func
Function taking
(x, y)and returning a scalar.- n_perm
Integer number of permutations.
- seed
Optional integer seed for reproducibility.
- null_method
Optional null model method passed to
generate_nulls(). IfNULL, uses simple random permutation.- distmat
Distance matrix (passed to
generate_nulls()if needed).- coords
Coordinate list (passed to
generate_nulls()if needed).- parcellation
Integer vector (passed to
generate_nulls()if needed).- ...
Additional arguments passed to
generate_nulls().