View source: R/perm.cor.test.R
| perm.cor.test | R Documentation |
A permutation test is performed based on Pearson and Spearman correlations.
perm.cor.test(x, y = NULL, alternative = c("two.sided", "less", "greater"),
method = c("pearson", "spearman"), num.sim = 20000)
x |
Numeric vector of design variable if |
y |
Numeric vector of response variable, and should be |
alternative |
A character string specifying the alternative hypothesis, and
must be one of |
method |
A character string specifying the type of correlation, and
must be one of |
num.sim |
The number of simulations generated. |
The p-value is estimated by randomly generating the permutations,
and is hence not exact.
The larger the value of num.sim the more precise the estimate of
the p-value, but also the greater the computing time.
Thus, the p-value is not based on asymptotic approximation.
The output states more details about the permutation test, such as the values of method and num.sim.
alternative |
Same as the input. |
p.value |
The p-value of the permutation test. |
The formulas computed within perm.cor.test are based on the textbook by Higgins (2004).
Steven T. Garren, James Madison University, Harrisonburg, Virginia, USA
Higgins, J. J. (2004) Introduction to Modern Nonparametric Statistics.
cor, cor.test, and perm.test.
perm.cor.test( c( 4, 6, 8, 11 ), c( 19, 44, 15, 13 ), "less", "pearson" )
perm.cor.test( c( 4, 6, 8, 11 ), c( 19, 44, 15, 13 ), "less", "spearman" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.