threshold_matrix: Threshold a correlation matrix

Description Usage Arguments Value Author(s) Examples

View source: R/threshold_matrix.R

Description

This function is used to threshold a correlation matrix in order to prune weak connections.

Usage

1
threshold_matrix(c, q.thresh = 0.9, thresh)

Arguments

c

The network either as connectivity matrix or as an igraph object.

q.thresh

The quantile to threshold. Defaults to .90, such that all below the 90th quantile are set to zero.

thresh

The number (taken to be an absolute value) below which to threshold (ie, correlation or cohen's d , etc). No default. Recommend .10 for correlation or .20 for cohen's d.

Value

The pruned correlation matrix.

Author(s)

Brandon Vaughan

Examples

1
2
3
threshold_matrix(matrix, q=.90) # This should threshold such that only positive values are returned.
threshold_matrix(abs(matrix), q=.90) # Taking the absolute value of the matrix will allow negative correlations sufficiently strong to be included as an edge. This does not preserve signs.
threshold_matrix(abs(matrix), q=.90)*sign(matrix) This will restore the signs after thresholding if desired.

abnormally-distributed/rsfcNet documentation built on March 8, 2020, 5:32 p.m.