Description Usage Arguments Details Value Note Author(s) References See Also Examples
View source: R/perm.cor.test.R
A permutation test is performed based on Pearson and Spearman correlations.
1 2 | 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.
1 2 | 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" )
|
[[1]]
[1] "Permutation correlation test. Method is pearson"
[[2]]
[1] "p-value was estimated based on 20000 simulations."
$alternative
[1] "less"
$p.value
[1] 0.28875
[[1]]
[1] "Permutation correlation test. Method is spearman"
[[2]]
[1] "p-value was estimated based on 20000 simulations."
$alternative
[1] "less"
$p.value
[1] 0.171
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.