spearmanRho | R Documentation |
Calculates Spearmans's rho, Kendall's tau, or Pearson's r with confidence intervals by bootstrap
spearmanRho(
formula = NULL,
data = NULL,
x = NULL,
y = NULL,
method = "spearman",
ci = FALSE,
conf = 0.95,
type = "perc",
R = 1000,
histogram = FALSE,
digits = 3,
reportIncomplete = FALSE,
...
)
formula |
A formula indicating the two paired variables,
e.g. |
data |
The data frame to use. |
x |
If no formula is given, the values for one variable. |
y |
The values for the other variable. |
method |
One of "spearman", "kendall", or "pearson".
Passed to |
ci |
If |
conf |
The level for the confidence interval. |
type |
The type of confidence interval to use.
Can be any of " |
R |
The number of replications to use for bootstrap. |
histogram |
If |
digits |
The number of significant digits in the output. |
reportIncomplete |
If |
... |
Additional arguments passed to the |
This function is a wrapper for stats::cor
with the addition of confidence intervals.
The input should include either formula
and data
;
or x
, and y
.
Currently, the function makes no provisions for NA
values in the data. It is recommended that NA
s be removed
beforehand.
When the returned statistic is close to -1 or close to 1, or with small sample size, the confidence intervals determined by this method may not be reliable, or the procedure may fail.
A single statistic, rho, tau, or r. Or a small data frame consisting of rho, tau, or r, and the lower and upper confidence limits.
Salvatore Mangiafico, mangiafico@njaes.rutgers.edu
https://rcompanion.org/handbook/I_10.html
data(Catbus)
spearmanRho( ~ Steps + Rating, data=Catbus)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.