qgraph icon indicating copy to clipboard operation
qgraph copied to clipboard

cor_auto fails with missing="fiml" but does not tell the user

Open falkcarl opened this issue 1 year ago • 2 comments

Hi Sacha,

I am posting here instead of under https://github.com/SachaEpskamp/bootnet though I discovered this when calling estimateNetwork from bootnet.

There are cases where missing="fiml" and corMethod = "cor_auto are specified, bootnet calls qgraph::cor_auto which calls lavaan::lavCor, but then lavCor fails to converge. Since qgraph suppresses all warnings from lavaan, the user is not notified of this convergence failure; perhaps the covariance matrix is also passed back and treated as though there was no problem.

What should be the default behavior of qgraph or bootnet in this case?

As an aside, I was also doing this with regularization (EBICglasso), and when this problem occurs, it often results in an empty network being estimated.

Attempting to attach an example with data below.

Best regards, Carl

missexample.zip

falkcarl avatar Mar 01 '24 01:03 falkcarl

Hi Carl,

Thanks for spotting this. What do you think should be the default behavior? I can just remove the warning supression perhpas. I think if an empty network is estimated when this happens it is not that problematic as it just makes the method more conservative.

SachaEpskamp avatar Jul 24 '24 07:07 SachaEpskamp

Sorry, I'm on vacation now and just checking emails for anything pressing so my reply will be quick and I can't look at code. Ultimately up to you, but I would wonder if in the object that's returned if there is a slot for information about estimation (e.g., a list typically containing a convergence code or message, information about iterations, optimizer, etc.; for these kinds of models or for some estimation approaches, some of that info may or may not be populated). One could catch any warnings, update the convergence code so that the user knows a warning was generated, save the message in that slot as well. Removing the warning suppression would be easier though I wonder what happens if this is frequently encountered when bootstrapping is employed. Sorry I didn't cook up a fix yet as I thought it may depend on your preference.


Carl F. Falk, Associate Professor

Quantitative Psychology and Modelling Department of Psychology, McGill University 2001 McGill College, Room 753

Montreal, QC H3A 1G1, Canada

http://www.psych.mcgill.ca/perpg/fac/falk/


From: Sacha Epskamp @.> Sent: July 24, 2024 3:52 AM To: SachaEpskamp/qgraph @.> Cc: Carl F Falk, Dr @.>; Author @.> Subject: Re: [SachaEpskamp/qgraph] cor_auto fails with missing="fiml" but does not tell the user (Issue #88)

Hi Carl,

Thanks for spotting this. What do you think should be the default behavior? I can just remove the warning supression perhpas. I think if an empty network is estimated when this happens it is not that problematic as it just makes the method more conservative.

— Reply to this email directly, view it on GitHubhttps://github.com/SachaEpskamp/qgraph/issues/88#issuecomment-2247141559, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADYP6RQOO7B4ACWFAM7ISGLZN5MKPAVCNFSM6AAAAABEA6AZ2SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBXGE2DCNJVHE. You are receiving this because you authored the thread.Message ID: @.***>

falkcarl avatar Jul 25 '24 07:07 falkcarl