rhoToPValue | R Documentation |
Compute an approximate p-value against the null hypothesis that Spearman's rho is zero.
This vectorizes the approximate p-value calculation in cor.test
with method="spearman"
.
rhoToPValue(rho, n, positive = NULL)
rho |
Numeric vector of rho values. |
n |
Integer scalar specifying the number of observations used to compute |
positive |
Logical scalar indicating whether to perform a one-sided test for the alternative of a positive ( |
If positive=NULL
, a list of two numeric vectors is returned,
containing p-values for the test against the alternative hypothesis in each direction.
Otherwise, a numeric vector is returned containing the p-values for the test in the specified direction.
Aaron Lun
rhoToPValue(seq(-1, 1, 21), 50)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.