associate: Statistical test of association between arbitrary vector...

associateR Documentation

Statistical test of association between arbitrary vector types.

Description

Statistical test of association between arbitrary vector types.

Usage

associate(a, b, ...)

## S4 method for signature 'numeric,numeric'
associate(a, b, method = "spearman")

## S4 method for signature 'factor,numeric'
associate(a, b)

## S4 method for signature 'numeric,factor'
associate(a, b)

## S4 method for signature 'factor,factor'
associate(a, b)

## S4 method for signature 'character,ANY'
associate(a, b)

## S4 method for signature 'Date,ANY'
associate(a, b)

## S4 method for signature 'ANY,Date'
associate(a, b)

## S4 method for signature 'ANY,POSIXct'
associate(a, b)

## S4 method for signature 'POSIXct,ANY'
associate(a, b)

## S4 method for signature 'ANY,POSIXt'
associate(a, b)

## S4 method for signature 'POSIXt,ANY'
associate(a, b)

## S4 method for signature 'character,character'
associate(a, b)

## S4 method for signature 'ANY,character'
associate(a, b)

## S4 method for signature 'ANY,factor'
associate(a, b)

## S4 method for signature 'logical,ANY'
associate(a, b)

## S4 method for signature 'ANY,logical'
associate(a, b)

Arguments

a, b

Vectors of covariates of arbitrary type. See Details for the specific tests used.

...

Passed to specific methods.

method

For numeric vs numeric, the correlation method (passed to cor.test)

Details

For numeric vs numeric, a correlation test. For factor vs factor, a chisq test. For numeric vs factor/character/logical, ANOVA.

Value

A p-value of an association test.

Examples

a <- rnorm(100)
b <- runif(100)
c <- sample(letters[1:2], 100, replace = TRUE)
d <- sample(letters[3:5], 100, replace = TRUE)
associate(a, b)
associate(b, a)
associate(b, c)
associate(b, d)
associate(c, d)

Alanocallaghan/nalar documentation built on Feb. 27, 2023, 3:27 p.m.