Calculates mean correlations within- and between-modules
Calculates mean correlations within- and between-modules
Uses a binary correlation matrix as a mask to calculate average within- and between-module correlations. Also calculates the ratio between them and the Modularity Hypothesis Index.
MHI: Indicates if Modularity Hypothesis Index should be calculated instead of AVG Ratio.
landmark.dim: Used if within-landmark correlations are to be excluded in geometric morphometric data. Either 2 for 2d data or 3 for 3d data. Default is NULL for non geometric morphomotric data.
Returns
a named vector with the mean correlations and derived statistics
Examples
# Module vectorsmodules = matrix(c(rep(c(1,0,0), each =5), rep(c(0,1,0), each =5), rep(c(0,0,1), each =5)),15)# Binary modular matrixcor.hypot = CreateHypotMatrix(modules)[[4]]# Modular correlation matrixhypot.mask = matrix(as.logical(cor.hypot),15,15)mod.cor = matrix(NA,15,15)mod.cor[ hypot.mask]= runif(length(mod.cor[ hypot.mask]),0.8,0.9)# within-modulesmod.cor[!hypot.mask]= runif(length(mod.cor[!hypot.mask]),0.3,0.4)# between-modulesdiag(mod.cor)=1mod.cor =(mod.cor + t(mod.cor))/2# correlation matrices should be symmetricCalcAVG(cor.hypot, mod.cor)CalcAVG(cor.hypot, mod.cor, MHI =TRUE)