
Calculate Spearman correlation coefficient and it's confidence interval.
SpearmanRho(x, y = NULL, use = c("everything", "all.obs", "complete.obs",
"na.or.complete","pairwise.complete.obs"),
conf.level = NA)
a numeric vector, an ordered factor, matrix or data frame. An ordered factor will be coerced to numeric.
NULL
(default) or a vector, an ordered factor, matrix or data frame with compatible dimensions to x.
An ordered factor will be coerced to numeric.
an optional character string giving a method for computing covariances in the presence of missing values.
This must be (an abbreviation of) one of the strings "everything"
, "all.obs"
, "complete.obs"
,
"na.or.complete"
, or "pairwise.complete.obs"
.
confidence level of the interval. If set to NA
(which is the default) no confidence interval will be calculated.
Either a single numeric value, if no confidence interval is required, or a vector with 3 elements for estimate, lower and upper confidence intervall.
The function calculates Spearman's rho statistic by means of cor(..., method="spearman")
.
The confidence intervals are calculated via z-Transformation.
Conover W. J. (1999) Practical Nonparametric Statistics (3rd edition). Wiley
# NOT RUN {
SpearmanRho(d.diamonds$clarity, d.diamonds$cut)
SpearmanRho(d.diamonds$clarity, d.diamonds$cut, conf.level = 0.95)
# }
Run the code above in your browser using DataLab