cor.diff.test {brainGraph}R Documentation

Calculate the p-value for differences in correlation coefficients

Description

Given two sets of correlation coefficients and sample sizes, this function calculates and returns the z-scores and p-values associated with the difference between correlation coefficients.

Usage

cor.diff.test(r1, r2, n, alternative = c("two.sided", "less", "greater"))

Arguments

r1, r2

Numeric (vector or matrix) of correlation coefficients for both groups

n

Integer vector; number of observations for both groups

alternative

Character string, whether to do a two- or one-sided test. Default: 'two.sided'

Value

A list with elements p and z, the p-values and z-scores for the difference in correlations.

Author(s)

Christopher G. Watson, cgwatson@bu.edu

Examples

## Not run: 
kNumSubjs <- summary(covars$Group)
corr.diffs <- cor.diff.test(corrs$R[, , 1], corrs$R[, , 2], kNumSubjs)
edge.diffs <- t(sapply(which(corr.diffs$p < .05), function(x)
                       mapply('[[',
                              dimnames(corr.diffs$p),
                              arrayInd(x, dim(corr.diffs$p)))
                              ))

## End(Not run)

[Package brainGraph version 3.1.0 Index]