corr: Bivariate correlations

correlationR Documentation

Bivariate correlations

Description

This is a function that creates correlation matrix objects that can be printed with the corresponding N and p-values. It is a wrapper for cor and cor.test.

Usage

correlation(x, y = NULL, method = "pearson",
            alternative = "two.sided", exact = NULL,
            use = "pairwise.complete.obs",
            continuity = FALSE, data = NULL)
## S3 method for class 'corr'
print(x, ... , toLatex = FALSE, cutstr = NULL, toMarkdown = FALSE)

Arguments

x

x is a matrix/data.frame or a formula defining which variable to use in the correlation matrix (see details).

y

y is a matrix/data.frame to correlate against x. If x is a formula y is passed to data argument

method

Method used to compute correlations.

alternative

Unilateral (one.sided) test or bilateral (two.sided) test. See help(cor) for more details.

exact

Logical value to know if a p.value is exact or asymptotic. See help(cor) for more details.

use

Methods to deal with missing values.

continuity

Logical value to know if continuity correction must be used. See help(cor) for more details.

...

Unused in this function

data

data.frame to use in conjuction with formula

toLatex

Logical value to know if output displayed as a latex tabular environment.

cutstr

Optional digits that cut the length of variable names

toMarkdown

Logical value to know if output should be displayed as a markdown table for report

Value

Returns a list with correlations, N for each pair of correlations and p.value for each correlations.

Author(s)

Charles-Édouard Giguère

Examples

require(CUFF)
X=rnorm(10)
Y=rnorm(10)
correlation(cbind(X,Y))

giguerch/CUFF documentation built on March 27, 2024, 5:36 p.m.