corByColumns {rapidsplithalf}R Documentation

Correlate two matrices by column

Description

Correlate each column of 1 matrix with the same column in another matrix

Usage

corByColumns(x, y)

corByColumns_mask(x, y, mask)

Arguments

x, y

Matrices whose values to correlate by column.

mask

Logical matrix marking which data points to include.

Details

The primary use for these functions is to rapidly compute the correlations between two sets of split-half scores stored in matrix columns.

Value

A numeric vector of correlations per column.

Examples

m1<-matrix((1:9)+rnorm(9),ncol=3)
m2<-matrix((9:1)+rnorm(9),ncol=3)
corByColumns(m1,m2)

mask<-1-diag(3)
corByColumns_mask(m1,m2,mask)


[Package rapidsplithalf version 0.2 Index]