rowPearsonCorrelationTests: Pearson's correlation test for rows of a matrix

View source: R/rowPearsonCorrelationTests.R

rowPearsonCorrelationTestsR Documentation

Pearson's correlation test for rows of a matrix

Description

Pearson's correlation test for rows of a matrix

Usage

rowPearsonCorrelationTests(X, categ, alternative = "two.sided")

Arguments

X

A m x n numeric matrix whose rows correspond to variables and columns to observations

categ

Either a numeric vector of continuous covariate for the observations

alternative

A character string specifying the alternative hypothesis. Must be one of "two.sided" (default), "greater" or "less". As in t.test, alternative = "greater" is the alternative that class 1 has a larger mean than class 0.

Details

This function is a wrapper around the row_cor_pearson function in the 'matrixTests' package.

Value

A list containing the following components:

statistic

the value of the t-statistics

parameter

the degrees of freedom for the t-statistics

p.value

the p-values for the tests

estimate

the correlation

Each of these elements is a matrix of size m x B, coerced to a vector of length m if B=1

Author(s)

Nicolas Enjalbert Courrech

See Also

matrixTests::row_cor_pearson()

Examples


m <- 300
n <- 38
mat <- matrix(rnorm(m*n), ncol=n)
categ <- rnorm(n, mean = 10)
system.time(fwt <- rowPearsonCorrelationTests(mat, categ, alternative = "greater"))
str(fwt)


pneuvial/sanssouci documentation built on Feb. 12, 2024, 4:18 a.m.