PermutationCorr | R Documentation |
Calculate permutation based p-value for Pearson's correlation coefficient.
PermutationCorr(x, y, R = 999, seed = 1, return.permutation = FALSE)
x |
A numerical vector with the first variable. |
y |
A numerical vector with the second variable. |
R |
The number of permutations to be conducted, set to 999 by default. |
seed |
Random seed used. Default is 1. |
return.permutation |
Return permutations. Default is |
It's adapted from permcor
function in Rfast with corrections in calculating the number of permutations and the p-values.
A list containing the following:
correlation, Pearson's correlation coefficient.
p.val, permutation based p-value.
return.permutation, permutation used if returned.
{ x <- iris[, 1] y <- iris[, 2] res <- PermutationCorr(x, y, R = 9999) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.