test.xcor: Test for correlation between multiple variables samples

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/test.xcor.R

Description

Test for Pearson correlation between paired samples across many variables.

Usage

1
2
3
## S3 method for class 'xcor'
test(X, Y, alternative = c("two.sided", "less",
  "greater"), conf.level = 0.95, null = 0)

Arguments

X

numeric matrix or vector of data values.

Y

numeric matrix or vector of data values. If matrices, X and Y must have the same number of rows. If vectors, X and Y mush have the same length.

alternative

specifies the alternative hypothesis.

conf.level

confidence level for the returned confidence interval.

null

The null to test against. Either a single number of or a matrix of size ncol(X) times ncol(Y).

Details

The test and confidence interval is based Fisher's Z transform.

Value

If matrices are given a list of matrices are returned where the ijth entry corresponds to the results of stats::cor.test(X[,i], Y[,j]).
If vectors are given a vector of the results is given.

Author(s)

Anders Ellern Bilgrau <anders.ellern.bilgrau (at) gmail.com>

See Also

cor.test

Examples

1
2
3
4
X <- createData(10, 2)
Y <- createData(10, 4)
test.xcor(X, Y)
test.xcor(X[,1], Y[,1])

AEBilgrau/correlateR documentation built on Nov. 15, 2019, 9:21 a.m.