get.correlation.p.and.corr {BoutrosLab.plotting.general}R Documentation

Calculate a correlation and its statistical significance

Description

Returns the correlation and p-value for two variables using a user-specified correlation metric. P-values are estimated analytically, not via permutation-testing.

Usage

get.correlation.p.and.corr(x, y, alternative = 'two.sided', method = 'pearson');

Arguments

x

Vector of numbers to analyze

y

Vector of numbers to analyze

alternative

What is the null-hypothesis?

method

The correlation technique to use (passed directly to cor.test)

Value

Returns a two-element vector containing the correlation and its p-value.

Author(s)

Paul C. Boutros

Examples

get.correlation.p.and.corr(
	x = runif(100),
	y = runif(100),
	method = 'pearson'
	);

get.correlation.p.and.corr(
	x = sample(1:10, 100, replace = TRUE),
	y = runif(100),
	method = 'spearman'
	);

[Package BoutrosLab.plotting.general version 6.0.3 Index]