You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

纳入观测协变量后SEM拟合度异常:lavaan.mi设定疑问

lavaan.mi纳入观测协变量后拟合异常的问题咨询

使用lavaan.mi拟合多重插补数据集,采用稳健WLSMV估计。将年龄(age_random.cent)、性别(male)作为协变量纳入结构模型后,模型拟合指标异常优异,怀疑lavaan代码设定存在错误。曾尝试将潜变量/结果回归到外生观测变量,或让潜因子与协变量协变,但出现NPD(非正定矩阵)警告,特寻求相关分析建议。


1. 无协变量模型

模型代码

sc.cdss.1 <- '#specifying measurement model portion
pos =~ NA*SCS_SF_q2 + SCS_SF_q5 + SCS_SF_q10  + SCS_SF_q3 + SCS_SF_q7
neg =~ NA*SCS_SF_q11 + SCS_SF_q4 + SCS_SF_q8 + SCS_SF_q1 + SCS_SF_q9
pos ~~ 1*pos
neg ~~ 1*neg

dep =~ NA*CDSS_q1 + CDSS_q2 + CDSS_q3 + CDSS_q4 + CDSS_q5 + CDSS_q6 + CDSS_q7 + CDSS_q8 + CDSS_q9
dep ~~ 1*dep

#Specifying structural portion
dep ~ pos + neg' 
sc.cdss.1.out = sem.mi(sc.cdss.1, data=imp2final,
ordered=c("SCS_SF_q1", "SCS_SF_q2", "SCS_SF_q3", "SCS_SF_q4", "SCS_SF_q5",
"SCS_SF_q7", "SCS_SF_q8", "SCS_SF_q9", "SCS_SF_q10", "SCS_SF_q11",
"CDSS_q1", "CDSS_q2", "CDSS_q3", "CDSS_q4", "CDSS_q5", "CDSS_q6", "CDSS_q7", "CDSS_q8", "CDSS_q9"), estimator = "WLSMV", std.lv = TRUE)
summary(sc.cdss.1.out, standardized = TRUE, rsquare=TRUE, fit.measures = TRUE) 

拟合结果

lavaan.mi object fit to 20 imputed data sets using:
 - lavaan    (0.6-19)
 - lavaan.mi (0.1-0)
See class?lavaan.mi help page for available methods. 

Convergence information:
The model converged on 20 imputed data sets.
Standard errors were available for all imputations.

  Estimator                                       DWLS
  Optimization method                           NLMINB
  Number of model parameters                        86

  Number of observations                           170

Model Test User Model:

                                                Standard      Scaled
  Test statistic                                  47.661     105.532
  Degrees of freedom                                 149         149
  P-value                                          1.000       0.997
  Average scaling correction factor                            1.285
  Average shift parameter                                     68.452
    simple second-order correction                                  
  Pooling method                                      D2            
    Pooled statistic                          “standard”            
    “scaled.shifted” correction applied            AFTER     pooling

Model Test Baseline Model:

  Test statistic                              1039.465     564.542
  Degrees of freedom                               171         171
  P-value                                        0.000       0.000
  Scaling correction factor                                  2.207

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    1.000       1.000
  Tucker-Lewis Index (TLI)                       1.134       1.127
                                                                  
  Robust Comparative Fit Index (CFI)                         0.796
  Robust Tucker-Lewis Index (TLI)                            0.766

Root Mean Square Error of Approximation:

  RMSEA                                          0.000       0.000
  90 Percent confidence interval - lower         0.000       0.000
  90 Percent confidence interval - upper         0.000       0.000
  P-value H_0: RMSEA <= 0.050                    1.000       1.000
  P-value H_0: RMSEA >= 0.080                    0.000       0.000
                                                                  
  Robust RMSEA                                               0.117
  90 Percent confidence interval - lower                     0.098
  90 Percent confidence interval - upper                     0.136
  P-value H_0: Robust RMSEA <= 0.050                         0.000
  P-value H_0: Robust RMSEA >= 0.080                         0.999

Standardized Root Mean Square Residual:

  SRMR                                           0.083       0.083

2. 纳入协变量模型

模型代码

sc.cdss.1.covariate <- '#specifying measurement model portion
pos =~ NA*SCS_SF_q2 + SCS_SF_q5 + SCS_SF_q10  + SCS_SF_q3 + SCS_SF_q7
neg =~ NA*SCS_SF_q11 + SCS_SF_q4 + SCS_SF_q8 + SCS_SF_q1 + SCS_SF_q9
pos ~~ 1*pos
neg ~~ 1*neg

dep =~ NA*CDSS_q1 + CDSS_q2 + CDSS_q3 + CDSS_q5 + CDSS_q6 + CDSS_q8 + CDSS_q9
dep ~~ 1*dep

#specifying structural model portion
  dep ~ pos + neg + age_random.cent + male' 
sc.cdss.1.covariate.out = sem.mi(sc.cdss.1.covariate, data=imp2final,
ordered=c("SCS_SF_q1", "SCS_SF_q2", "SCS_SF_q3", "SCS_SF_q4", "SCS_SF_q5",
"SCS_SF_q7", "SCS_SF_q8", "SCS_SF_q9", "SCS_SF_q10", "SCS_SF_q11",
 "CDSS_q1", "CDSS_q2", "CDSS_q3", "CDSS_q4", "CDSS_q5", "CDSS_q6", "CDSS_q7", "CDSS_q8", "CDSS_q9"), estimator = "WLSMV", std.lv = TRUE)
summary(sc.cdss.1.covariate.out, standardized = FALSE, rsquare=TRUE, fit.measures = TRUE) 

拟合结果

lavaan.mi object fit to 20 imputed data sets using:
 - lavaan    (0.6-19)
 - lavaan.mi (0.1-0)
See class?lavaan.mi help page for available methods. 

Convergence information:
The model converged on 20 imputed data sets.
Standard errors were available for all imputations.

  Estimator                                       DWLS
  Optimization method                           NLMINB
  Number of model parameters                        81

  Number of observations                           170

Model Test User Model:

                                                Standard      Scaled
  Test statistic                                  45.356      98.401
  Degrees of freedom                                 148         148
  P-value                                          1.000       0.999
  Average scaling correction factor                            1.256
  Average shift parameter                                     62.277
    simple second-order correction                                  
  Pooling method                                      D2            
    Pooled statistic                          “standard”            
    “scaled.shifted” correction applied            AFTER     pooling

Model Test Baseline Model:

  Test statistic                              1007.645     553.194
  Degrees of freedom                               136         136
  P-value                                        0.000       0.000
  Scaling correction factor                                  2.089

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    1.000       1.000
  Tucker-Lewis Index (TLI)                       1.108       1.109
                                                                  
  Robust Comparative Fit Index (CFI)                            NA
  Robust Tucker-Lewis Index (TLI)                               NA

Root Mean Square Error of Approximation:

  RMSEA                                          0.000       0.000
  90 Percent confidence interval - lower         0.000       0.000
  90 Percent confidence interval - upper         0.000       0.000
  P-value H_0: RMSEA <= 0.050                    1.000       1.000
  P-value H_0: RMSEA >= 0.080                    0.000       0.000
                                                                  
  Robust RMSEA                                                  NA
  90 Percent confidence interval - lower                        NA
  90 Percent confidence interval - upper                        NA
  P-value H_0: Robust RMSEA <= 0.050                            NA
  P-value H_0: Robust RMSEA >= 0.080                            NA

Standardized Root Mean Square Residual:

  SRMR                                           0.078       0.078

核心疑问

纳入协变量后,模型拟合指标(如RMSEA、CFI)提升幅度过大,且稳健拟合统计量出现NA,对路径估计的可信度存疑。怀疑模型代码中遗漏了与观测协变量相关的必要设定,尝试过两种协变量纳入方式:

  • 将潜变量/结果变量回归到外生观测协变量
  • 设定潜因子与观测协变量的协方差
    但上述尝试均触发NPD警告,希望得到关于模型设定错误排查、协变量正确纳入方式的建议。

内容的提问来源于stack exchange,提问作者Bryan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.13 04:39:53