SachaEpskamp / qgraph

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

Help! EBICglasso return an empty network #74

Closed Lilyeveryday closed 1 year ago

Lilyeveryday commented 1 year ago

Hi Sacha, I am trying to use the following codes to estimate my network, while I get the massage.

my code: EBICgraph<-EBICglasso(cor1a,ncol(df1a),0.5,threshold = FALSE)

the massage: "An empty network was selected to be the best fitting network. Possibly set 'lambda.min.ratio' higher to search more sparse networks. You can also change the 'gamma' parameter to improve sensitivity (at the cost of specificity)."

I chang the "gamma"(gamma=0.1/0.01), and then I get the same massage.

what does this massage mean? what can I do? @SachaEpskamp

Best regards Lily

SachaEpskamp commented 1 year ago

Hi Lily,

This coul dbe if there is a small sample size or if there are small correlations between the variables. What is your sample size?

Best, Sacha

Lilyeveryday commented 1 year ago

Thank you for replying very much.

I changed my sample size and tried to estimate my network again. I got the following massage:

Note: Network with lowest lambda selected as best network: assumption of sparsity might be violated.

what does this massage mean? what can I do?

Thanks again! Lily

SachaEpskamp commented 1 year ago

Hi Lily,

I see, you put ncol(df1a) as sample size, but this should be nrow(df1a) I think? That warning can often safely be ignored, but it does mean that you should be careful with not interpreting very small edges that are non-zero as being substantial pathways, as the EBICglasso can have low specificity (estimate many false small edges) in this case. It could be that your sample size is very large and that a non regularized approach might be better. See also this paper:

https://psycnet.apa.org/doiLanding?doi=10.1037%2Fmet0000439

Best, Sacha

Lilyeveryday commented 1 year ago

Thanks Sacha,

The EBICglasso worked well, after I put nrow(df1a) as sample size and chose the cor(x,method="pearson") in my codes.

_corcg<-cor(data_cg,method="pearson") EBICgraph<-EBICglasso(corcg,nrow(datacg),0.5,nlambda = 100,lambda.min.ratio = 0.01,threshold = TRUE)

And I am also reading the following paper. It helps me a lot!

Epskamp, S., & Fried, E. I. (2018). A tutorial on regularized partial correlation networks. Psychological Methods, 23(4), 617–634. https://doi.org/10.1037/met0000167

Thanks very much again!