Learn R Programming

rococo (version 1.1.7)

gauss.cor.test-methods: Gaussian rank correlation test

Description

Methods performing a Gaussian rank correlation test

Usage

# S4 method for numeric,numeric
gauss.cor.test(x, y, ...)
# S4 method for formula,data.frame
gauss.cor.test(x, y, na.action, ...)

Arguments

x

a numeric vector or a formula; compulsory argument

y

compulsory argument; if x is a vector, y must be vector of the same length as x. If x is a formula, y must be a data frame.

na.action

a function which indicates what should happen when the data contain NA's. Defaults to getOption("na.action").

...

all parameters specified are forwarded internally to the method cor.test, in particular, the alternative parameter.

Value

Upon successful completion, the function returns a list of class htest containing the results (see cor.test).

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.

References

http://www.bioinf.jku.at/software/rococo/

K. Boudt, J. Cornelissen and C. Croux (2012). The Gaussian rank correlation estimator: robustness properties. Stat. Comput. 22(2):471-483.

See Also

gauss.cor

Examples

Run this code
# NOT RUN {
## 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")
# }

Run the code above in your browser using DataLab