lavaan warning Model estimation FAILED - userGWAS

102 views
Skip to first unread message

Patricia Pombo Segura

unread,
Feb 10, 2025, 10:32:50 AMFeb 10
to Genomic SEM Users
Hi all,

We are running a multivariate GWAS analysis using the userGWAS() function on a cluster, processing 12 phenotypes. 

We followed the wiki steps for the munge function, LDSC, and sumstats preparation before the userGWAS() step. Our model is based on Figure 3b from this paper (https://pmc.ncbi.nlm.nih.gov/articles/PMC10600728/), and it looks like this:
CFA_model <- 'F1 =~ 0.99*Foldingindex + 0.94*Intrinsic + 0.89*SA + 0.84*LGI + 0.67*Volume
              F2 =~ 1.05*Meancurvature + 0.59*Gaussiancurvature
              F3 =~ -0.79*OD + 0.28*FA + 0.95*ICVF
              F4 =~ 0.83*MD + 1.01*ISOVF

              Foldingindex ~~ 0.01*Foldingindex
              Intrinsic ~~ 0.12*Intrinsic
              SA ~~ 0.22*SA
              LGI ~~ 0.29*LGI
              Volume ~~ 0.56*Volume
              Meancurvature ~~ 0.00*Meancurvature
              Gaussiancurvature ~~ 0.66*Gaussiancurvature
              OD ~~ 0.38*OD
              FA ~~ 0.10*FA
              ICVF ~~ 0.92*ICVF
              MD ~~ 0.32*MD
              ISOVF ~~ 0.00*ISOVF
             
              F1 ~~ 1*F1
              F2 ~~ 1*F2
              F3 ~~ 1*F3
              F4 ~~ 1*F4
             
              F1 ~ SNP
              F2 ~ SNP
              F3 ~ SNP
              F4 ~ SNP'
CorrelatedFactors<-userGWAS(covstruc = LDSCoutput,
                            SNPs = NI_sumstats,
                            model = CFA_model,
                            sub=c("F1 ~ SNP",
                                  "F2 ~ SNP",
                                  "F3 ~ SNP",
                                  "F4 ~ SNP"),
                            smooth_check=TRUE,
                            fix_measurement=TRUE,
                            Q_SNP=TRUE,
                            #parallel=TRUE,
                            cores = cores,
                            toler=1e-60)
All steps ran smoothly, except for a warning related to lavaan affecting ~44% of our total SNPs: "lavaan->lav_lavaan_step11_estoptim(): Model estimation FAILED! Returning starting values." The error columns are all 0s, but we are unsure what this warning means, especially since it appears for nearly half of the SNPs.
We would appreciate any guidance on how to interpret and handle this warning, since we are interested in obtaining sumstats specific to each of these 4 factors.
Thanks a lot in advance (and thanks for such a great package!)
Patricia

Thanh Le

unread,
Mar 28, 2025, 7:57:49 AMMar 28
to Genomic SEM Users
Hi Patricia,

Were you able to troubleshoot this problem? I encountered the same problem too.

Best regards,
Thanh Le

Patricia Pombo Segura

unread,
Apr 2, 2025, 10:01:37 AMApr 2
to Genomic SEM Users
Hi Thanh Le,

We actually modified the model used for userGWAS() and, while the warning still appears for some SNPs, it has significantly decreased from nearly 45% to about 7-10%. Our model is now more simple, and accounts for traits with ov negative variances:

CFAofEFA <- "F1 =~ NA*SA+ Volume + Foldingindex + Intrinsic + LGI
             F2 =~ NA*Meancurvature+Gaussiancurvature
             F3 =~ NA*OD + FA + ICVF + ISOVF
             F4 =~ NA*MD+ ISOVF

             Foldingindex ~~a*Foldingindex
             Meancurvature~~b*Meancurvature
             ISOVF~~c*ISOVF
             a > .001
             b > .001
             c > .001

             
             F1 ~~ 1*F1
             F2 ~~ 1*F2
             F3 ~~ 1*F3
             F4 ~~ 1*F4

             F1 ~~ F2
             F1 ~~ F3
             F1 ~~ F4
             F2 ~~ F3
             F2 ~~ F4
             F3 ~~ F4

             F1~SNP
             F2~SNP
             F3~SNP
             F4~SNP
"

Although we still do not fully understand the cause of the warning, we have decided to exclude these SNPs with the warning from our analysis for now. We tried to troubleshoot further, but there does not seem to be anything specific that stands out with those SNPs. However, we are also getting a new warning for 5% of the SNPs that we are also unsure how to handle "lavaan->lav_model_vcov(): The variance-covariance matrix of the estimated parameters (vcov) does not appear to be positive definite! The smallest eigenvalue (= 1.122731e-20) is close to zero. This may be a symptom that the model is not identified."

If you’ve made any progress on understanding this warning, we’d love to hear about it!

Best regards,
Patricia

Reply all
Reply to author
Forward
0 new messages