SachaEpskamp / qgraph

Developmental version of qgraph
GNU General Public License v2.0
68 stars 21 forks source link

Correlations between two different set of variables #12

Closed llrs closed 5 years ago

llrs commented 6 years ago

I am trying to plot the correlation between two set of variables, however I can't.
The problem arises from the check of (nrow(input) != ncol(input)) because I don't have the same number of variables for each set.

A reproducible example would be:

m <- matrix(runif(45, -1, 1), ncol = 9, nrow = 5)
qqgraph(m, graph = "cor")

Is there any workaround ?

SachaEpskamp commented 5 years ago

Hi,

qgraph expects a correlation matrix here. Perhaps you want to try estimateNetwork from bootnet that wraps around qgraph to do this by default.

llrs commented 5 years ago

Many thanks, I tried with a square correlation matrix, but I got an error.

m <- matrix(runif(25, -1, 1), ncol = 5, nrow = 5)
qgraph(m, graph = "cor")
## Error in eigen(input)$values > 0 : invalid comparison with complex values