get.correlation.p.and.corr {BoutrosLab.plotting.general} | R Documentation |
Returns the correlation and p-value for two variables using a user-specified correlation metric. P-values are estimated analytically, not via permutation-testing.
get.correlation.p.and.corr(x, y, alternative = 'two.sided', method = 'pearson');
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) |
Returns a two-element vector containing the correlation and its p-value.
Paul C. Boutros
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'
);