Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cor_test

Correlation significance testing using Fisher's z-transformation


Description

Correlation significance testing using Fisher's z-transformation.

Usage

cor_test(y, x, type = "pearson", rho = 0, a = 0.05 )

Arguments

y

A numerical vector.

x

A numerical vector.

type

The type of correlation you want. "pearson" and "spearman" are the two supported types because their standard error is easily calculated.

rho

The value of the hypothesised correlation to be used in the hypothesis testing.

a

The significance level used for the confidence intervals.

Details

The function uses the built-in function "cor" which is very fast, then computes a confidence interval and produces a p-value for the hypothesis test.

Value

A vector with 5 numbers; the correlation, the p-value for the hypothesis test that each of them is equal to "rho", the test statistic and the $a/2%$ lower and upper confidence limits.

Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

See Also

Examples

x <- rcauchy(60)
y <- rnorm(60)
cor_test(y, x)

Rfast2

A Collection of Efficient and Extremely Fast R Functions II

v0.0.9
GPL (>= 2.0)
Authors
Manos Papadakis, Michail Tsagris, Stefanos Fafalios and Marios Dimitriadis.
Initial release
2021-03-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.