gauss.cor.test-methods {rococo} | R Documentation |
Gaussian rank correlation test
Description
Methods performing a Gaussian rank correlation test
Usage
## S4 method for signature 'numeric,numeric'
gauss.cor.test(x, y, ...)
## S4 method for signature 'formula,data.frame'
gauss.cor.test(x, y, na.action, ...)
Arguments
x |
a numeric vector or a formula; compulsory argument |
y |
compulsory argument; if |
na.action |
a function which indicates what should happen when the data
contain |
... |
all parameters specified are forwarded internally to the
method |
Details
If called for numeric vectors, gauss.cor.test
performs the
Gaussian gamma rank correlation test for x
and y
. This
is done by simply performing a Pearson correlation test on the normal
scores of the data.
If gauss.cor.test
is called for a formula x
and a data
frame y
, then the method checks whether the formula x
correctly
extracts two columns from y
(see examples below). If so, the
two columns are extracted and the Gaussian gamma rank correlation test
is applied to them according to the specified parameters.
Value
Upon successful completion, the function returns a list of class
htest
containing the results (see cor.test
).
Author(s)
Ulrich Bodenhofer
References
https://github.com/UBod/rococo
K. Boudt, J. Cornelissen, and C. Croux (2012). The Gaussian rank correlation estimator: robustness properties. Stat. Comput. 22(2):471-483. DOI: doi:10.1007/s11222-011-9237-0.
See Also
Examples
## create data
f <- function(x) ifelse(x > 0.9, x - 0.9, ifelse(x < -0.9, x + 0.9, 0))
x <- rnorm(25)
y <- f(x) + rnorm(25, sd=0.1)
## perform correlation tests
gauss.cor.test(x, y, alternative="greater")
## the formula variant
require(datasets)
data(iris)
gauss.cor.test(~ Petal.Width + Petal.Length, iris,
alternative="two.sided")