Chapter 6 测量恒等性检验

用来检验,研究者提出的测量模型所具有的因素结构,在不同样本(例如男/女,主管/下属)之间是否具有等同性,或者说,这套测量工具用于不同的对象,或同一对象不同时间点时,测量分数是否表述了相同的意义。

相比于前面几章的单样本CFA分析,需要增加一个平行样本,也就是另纳入一个类别变量来反映共变结构的跨样本变化。

library(tidyverse)
library(lavaan)
library(modelsummary)
library(semPlot)
library(corrplot)
# https://cran.r-project.org/web/packages/semptools/vignettes/semptools.html
library(semptools) # 给路径图标记显著性

6.1 案例说明

在本册的第2章中,我们对《组织创新气氛量表》进行了CFA分析。本章将该CFA分析扩展到性别之间的恒等性比较,换句话说,本章旨在回答——组织创新气氛的知觉的因素结构,在不同性别之间是否具有恒等性?

回答该问题,主要操作分两个阶段:

  1. 阶段一:对全样本进行CFA分析,查看拟合情况,如果拟合情况良好,按性别分样本进行CFA分析,如每个样本的拟合状况都良好,则进入第二阶段。反之,则没有必要进行继续比较了。
  2. 阶段二:进行多样本结构方程模型分析,也就是在纳入性别变量的基础上,对全样本进行模型拟合。在这一过程中,会分别拟合多个嵌套模型,从而对不同性别因素结构中的系数恒等性进行检验。

第二阶段的模型逻辑相对比较复杂,请仔细阅读原书第九章。

6.2 第一阶段分析

首先读取数据

dat_female <- read_csv("data/Ch09f.csv") # 女性数据(n=140)
dat_male <- read_csv("data/Ch09m.csv") # 男性数据(n = 172)

# 数据组合起来
dat_all <- bind_rows(dat_female, dat_male, .id = "gender") |>
  mutate(gender = ifelse(gender == 1, "female", "male"))

分性别进行描述统计,结果见表6.1

datasummary(All(dat_all |> select(-gender)) ~ gender * (mean + sd + Histogram),
            data = dat_all,
            title = "描述统计表")
## Warning in datasummary(All(select(dat_all, -gender)) ~ gender * (mean + :
## The `All()` function does not accept tibbles. Please convert `data` to a
## `data.frame` before calling `datasummary`. A bugfix patch has been submitted
## upstream to the `tables` package.
Table 6.1: 描述统计表
female
male
mean sd Histogram mean sd Histogram
A1 4.24 1.04 ▁▃▆▇▁ 4.55 0.91 ▂▅▇▂
A2 4.14 1.08 ▂▃▇▇▁ 4.44 0.96 ▁▂▅▇▂
A3 3.97 1.04 ▁▃▇▃▁ 4.15 0.90 ▄▇▆▁
B1 3.89 1.16 ▂▇▄▇▁ 4.11 1.15 ▁▆▅▇▂
B2 4.05 1.15 ▁▁▅▇▇▂ 4.41 1.14 ▁▃▄▇▃
B3 4.04 1.13 ▁▅▇▇▂ 4.39 1.02 ▁▃▅▇▂
C1 4.28 1.05 ▁▃▆▇▂ 4.44 0.91 ▂▆▇▂
C2 4.34 1.06 ▁▃▆▇▂ 4.33 1.00 ▁▃▇▆▂
C3 4.14 1.11 ▁▁▃▇▅▂ 4.44 0.97 ▂▅▇▂
D1 4.84 0.96 ▁▄▇▄ 4.83 0.92 ▁▄▇▄
D2 4.94 0.87 ▁▄▇▅ 4.95 0.81 ▄▇▄
D3 4.74 1.01 ▂▆▇▅ 4.91 0.82 ▁▄▇▄
E1 4.48 1.05 ▂▇▇▃ 4.75 0.89 ▁▅▇▃
E2 4.54 1.11 ▁▂▆▇▄ 4.88 0.89 ▁▄▇▄
E3 4.58 1.01 ▃▅▇▃ 4.80 0.94 ▁▄▇▄
F1 4.14 1.11 ▁▄▇▄▂ 4.30 1.20 ▂▂▇▆▃
F2 4.39 1.16 ▁▂▇▅▃ 4.81 1.00 ▁▅▇▅
F3 4.22 0.99 ▂▇▄▁ 4.70 0.84 ▁▅▇▃

然后我们分别对总体,女性和男性拟合CFA模型,并将拟合度情况保存下来,如表6.2所示。

该表为原书289页的表9.3的上半部分。可以看到,拟合情形还算比较一致,而且各指数差异不大,因此进入第二阶段分析。

cfa_model<-'FA =~ NA*A1 + A2 + A3
             FB =~ NA*B1 + B2 + B3
             FC =~ NA*C1 + C2 + C3
             FD =~ NA*D1 + D2 + D3
             FE =~ NA*E1 + E2 + E3
             FF =~ NA*F1 + F2 + F3
             FA~~1*FA 
             FB~~1*FB 
             FC~~1*FC 
             FD~~1*FD 
             FE~~1*FE 
             FF~~1*FF'

# 将准备拟合cfa的各组数据放在一个list里面
dat_list <- list(全体样本 = dat_all, 男性样本 = dat_male, 女性样本 = dat_female)

# 写一个函数,执行cfa分析,并保存拟合结果
cal_fitness <- function(dat){
  
  cfa_fit <- cfa(model = cfa_model, 
               data = dat) 
  fitness <- fitmeasures(cfa_fit)[c('chisq', 'df', 'rmsea','nnfi', 'nfi', 'cfi', 'gfi')]
  split(fitness, names(fitness))
}

# 输出结果
map_dfr(dat_list, ~cal_fitness(.), .id = 'Sample') |>
  select(Sample, chisq, df, rmsea, nnfi, cfi, gfi) |> # 给列排一下序
  mutate(across(where(is.numeric), ~round(., 3))) |> # 四舍五入
  knitr::kable(caption = "阶段一的拟合度评估") 
Table 6.2: 阶段一的拟合度评估
Sample chisq df rmsea nnfi cfi gfi
全体样本 242.856 120 0.057 0.941 0.954 0.924
男性样本 194.711 120 0.060 0.925 0.941 0.897
女性样本 218.681 120 0.077 0.911 0.930 0.857

6.3 第二阶段分析

这一阶段估计的,是纳入性别变量后的多样本CFA模型。

6.3.1 模型一:基准模型

跨样本的(1)因素结构相同。其他都不同。

此时,模型卡方值为两样本分别以同一因素结构进行估计的总和(即表6.2中男、女样本卡方值的加和)。

观测数据的数目(DP值)为两性别的加总,也就是\(18 * 19 / 2 + 18 * 19 / 2 = 342\)

待估参数也是两性别模型的加和,也就是51 + 51 = 102,自由度\(df = 342 - 102 = 340\)

注意,在lavaan包中,如果使用多样本模型(即添加group选项),并且输入的数据是原始数据,summary的结果会自动带有intercept项,即截距。这些截距的估计不会影响模型的自由度和其他参数的估计,因为截距的大小与方差/协方差没有任何关系。

mod1_fit <- cfa(model=cfa_model, 
                data = dat_all, 
                group = 'gender') # 性别变量

mod1_res <- summary(mod1_fit, fit.measures=TRUE, standard=TRUE)
print(mod1_res)
## lavaan 0.6.15 ended normally after 36 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                       138
## 
##   Number of observations per group:                   
##     female                                         140
##     male                                           172
## 
## Model Test User Model:
##                                                       
##   Test statistic                               413.391
##   Degrees of freedom                               240
##   P-value (Chi-square)                           0.000
##   Test statistic for each group:
##     female                                     218.681
##     male                                       194.711
## 
## Model Test Baseline Model:
## 
##   Test statistic                              2997.338
##   Degrees of freedom                               306
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.936
##   Tucker-Lewis Index (TLI)                       0.918
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)              -6654.498
##   Loglikelihood unrestricted model (H1)      -6447.803
##                                                       
##   Akaike (AIC)                               13584.997
##   Bayesian (BIC)                             14101.531
##   Sample-size adjusted Bayesian (SABIC)      13663.841
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.068
##   90 Percent confidence interval - lower         0.057
##   90 Percent confidence interval - upper         0.079
##   P-value H_0: RMSEA <= 0.050                    0.005
##   P-value H_0: RMSEA >= 0.080                    0.036
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.061
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## 
## Group 1 [female]:
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   FA =~                                                                 
##     A1                0.939    0.075   12.561    0.000    0.939    0.909
##     A2                0.757    0.085    8.957    0.000    0.757    0.703
##     A3                0.734    0.081    9.057    0.000    0.734    0.709
##   FB =~                                                                 
##     B1                0.864    0.088    9.769    0.000    0.864    0.747
##     B2                0.907    0.085   10.631    0.000    0.907    0.794
##     B3                0.915    0.083   10.971    0.000    0.915    0.812
##   FC =~                                                                 
##     C1                0.785    0.081    9.630    0.000    0.785    0.753
##     C2                0.752    0.084    8.919    0.000    0.752    0.709
##     C3                0.733    0.090    8.149    0.000    0.733    0.661
##   FD =~                                                                 
##     D1                0.842    0.066   12.845    0.000    0.842    0.883
##     D2                0.803    0.058   13.722    0.000    0.803    0.921
##     D3                0.770    0.074   10.438    0.000    0.770    0.766
##   FE =~                                                                 
##     E1                0.839    0.076   11.091    0.000    0.839    0.802
##     E2                1.028    0.074   13.888    0.000    1.028    0.931
##     E3                0.787    0.074   10.662    0.000    0.787    0.781
##   FF =~                                                                 
##     F1                0.723    0.089    8.123    0.000    0.723    0.652
##     F2                0.947    0.086   10.975    0.000    0.947    0.818
##     F3                0.836    0.073   11.515    0.000    0.836    0.847
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   FA ~~                                                                 
##     FB                0.451    0.083    5.441    0.000    0.451    0.451
##     FC                0.380    0.093    4.097    0.000    0.380    0.380
##     FD                0.253    0.090    2.822    0.005    0.253    0.253
##     FE                0.453    0.078    5.786    0.000    0.453    0.453
##     FF                0.628    0.067    9.335    0.000    0.628    0.628
##   FB ~~                                                                 
##     FC                0.807    0.056   14.296    0.000    0.807    0.807
##     FD                0.521    0.075    6.984    0.000    0.521    0.521
##     FE                0.639    0.064    9.976    0.000    0.639    0.639
##     FF                0.327    0.092    3.547    0.000    0.327    0.327
##   FC ~~                                                                 
##     FD                0.606    0.072    8.407    0.000    0.606    0.606
##     FE                0.619    0.071    8.656    0.000    0.619    0.619
##     FF                0.577    0.080    7.255    0.000    0.577    0.577
##   FD ~~                                                                 
##     FE                0.626    0.060   10.359    0.000    0.626    0.626
##     FF                0.403    0.083    4.858    0.000    0.403    0.403
##   FE ~~                                                                 
##     FF                0.495    0.077    6.462    0.000    0.495    0.495
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .A1                4.236    0.087   48.544    0.000    4.236    4.103
##    .A2                4.136    0.091   45.431    0.000    4.136    3.840
##    .A3                3.971    0.087   45.414    0.000    3.971    3.838
##    .B1                3.893    0.098   39.813    0.000    3.893    3.365
##    .B2                4.050    0.097   41.954    0.000    4.050    3.546
##    .B3                4.043    0.095   42.454    0.000    4.043    3.588
##    .C1                4.279    0.088   48.564    0.000    4.279    4.104
##    .C2                4.343    0.090   48.440    0.000    4.343    4.094
##    .C3                4.136    0.094   44.094    0.000    4.136    3.727
##    .D1                4.836    0.081   60.022    0.000    4.836    5.073
##    .D2                4.936    0.074   66.983    0.000    4.936    5.661
##    .D3                4.736    0.085   55.791    0.000    4.736    4.715
##    .E1                4.479    0.088   50.701    0.000    4.479    4.285
##    .E2                4.543    0.093   48.673    0.000    4.543    4.114
##    .E3                4.579    0.085   53.766    0.000    4.579    4.544
##    .F1                4.136    0.094   44.094    0.000    4.136    3.727
##    .F2                4.393    0.098   44.926    0.000    4.393    3.797
##    .F3                4.221    0.083   50.653    0.000    4.221    4.281
##     FA                0.000                               0.000    0.000
##     FB                0.000                               0.000    0.000
##     FC                0.000                               0.000    0.000
##     FD                0.000                               0.000    0.000
##     FE                0.000                               0.000    0.000
##     FF                0.000                               0.000    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##     FA                1.000                               1.000    1.000
##     FB                1.000                               1.000    1.000
##     FC                1.000                               1.000    1.000
##     FD                1.000                               1.000    1.000
##     FE                1.000                               1.000    1.000
##     FF                1.000                               1.000    1.000
##    .A1                0.185    0.067    2.780    0.005    0.185    0.173
##    .A2                0.587    0.084    7.013    0.000    0.587    0.506
##    .A3                0.532    0.077    6.953    0.000    0.532    0.497
##    .B1                0.592    0.088    6.707    0.000    0.592    0.442
##    .B2                0.483    0.079    6.100    0.000    0.483    0.370
##    .B3                0.433    0.075    5.791    0.000    0.433    0.341
##    .C1                0.471    0.076    6.172    0.000    0.471    0.433
##    .C2                0.559    0.083    6.709    0.000    0.559    0.497
##    .C3                0.694    0.097    7.120    0.000    0.694    0.564
##    .D1                0.200    0.039    5.153    0.000    0.200    0.221
##    .D2                0.116    0.031    3.771    0.000    0.116    0.153
##    .D3                0.416    0.057    7.238    0.000    0.416    0.413
##    .E1                0.389    0.058    6.703    0.000    0.389    0.356
##    .E2                0.163    0.052    3.165    0.002    0.163    0.134
##    .E3                0.397    0.057    6.971    0.000    0.397    0.391
##    .F1                0.709    0.096    7.365    0.000    0.709    0.575
##    .F2                0.442    0.082    5.415    0.000    0.442    0.330
##    .F3                0.274    0.058    4.736    0.000    0.274    0.282
## 
## 
## Group 2 [male]:
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   FA =~                                                                 
##     A1                0.673    0.067   10.013    0.000    0.673    0.739
##     A2                0.615    0.072    8.537    0.000    0.615    0.644
##     A3                0.482    0.070    6.921    0.000    0.482    0.540
##   FB =~                                                                 
##     B1                0.701    0.086    8.131    0.000    0.701    0.610
##     B2                0.979    0.079   12.395    0.000    0.979    0.863
##     B3                0.751    0.074   10.206    0.000    0.751    0.736
##   FC =~                                                                 
##     C1                0.612    0.068    8.930    0.000    0.612    0.677
##     C2                0.754    0.074   10.157    0.000    0.754    0.755
##     C3                0.609    0.075    8.146    0.000    0.609    0.627
##   FD =~                                                                 
##     D1                0.797    0.061   13.129    0.000    0.797    0.865
##     D2                0.682    0.054   12.745    0.000    0.682    0.847
##     D3                0.548    0.059    9.352    0.000    0.548    0.668
##   FE =~                                                                 
##     E1                0.759    0.056   13.592    0.000    0.759    0.860
##     E2                0.768    0.056   13.702    0.000    0.768    0.864
##     E3                0.807    0.059   13.563    0.000    0.807    0.858
##   FF =~                                                                 
##     F1                0.559    0.098    5.707    0.000    0.559    0.465
##     F2                0.668    0.077    8.633    0.000    0.668    0.670
##     F3                0.659    0.064   10.271    0.000    0.659    0.789
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   FA ~~                                                                 
##     FB                0.604    0.076    7.980    0.000    0.604    0.604
##     FC                0.565    0.085    6.673    0.000    0.565    0.565
##     FD                0.627    0.071    8.851    0.000    0.627    0.627
##     FE                0.525    0.077    6.815    0.000    0.525    0.525
##     FF                0.717    0.074    9.681    0.000    0.717    0.717
##   FB ~~                                                                 
##     FC                0.601    0.073    8.272    0.000    0.601    0.601
##     FD                0.377    0.080    4.704    0.000    0.377    0.377
##     FE                0.491    0.071    6.896    0.000    0.491    0.491
##     FF                0.395    0.087    4.514    0.000    0.395    0.395
##   FC ~~                                                                 
##     FD                0.426    0.082    5.169    0.000    0.426    0.426
##     FE                0.555    0.072    7.750    0.000    0.555    0.555
##     FF                0.596    0.080    7.438    0.000    0.596    0.596
##   FD ~~                                                                 
##     FE                0.477    0.070    6.850    0.000    0.477    0.477
##     FF                0.224    0.092    2.428    0.015    0.224    0.224
##   FE ~~                                                                 
##     FF                0.314    0.087    3.603    0.000    0.314    0.314
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .A1                4.552    0.069   65.586    0.000    4.552    5.001
##    .A2                4.442    0.073   61.087    0.000    4.442    4.658
##    .A3                4.145    0.068   60.834    0.000    4.145    4.639
##    .B1                4.110    0.088   46.935    0.000    4.110    3.579
##    .B2                4.407    0.087   50.930    0.000    4.407    3.883
##    .B3                4.390    0.078   56.447    0.000    4.390    4.304
##    .C1                4.442    0.069   64.473    0.000    4.442    4.916
##    .C2                4.326    0.076   56.768    0.000    4.326    4.329
##    .C3                4.442    0.074   59.948    0.000    4.442    4.571
##    .D1                4.831    0.070   68.748    0.000    4.831    5.242
##    .D2                4.953    0.061   80.641    0.000    4.953    6.149
##    .D3                4.913    0.063   78.561    0.000    4.913    5.990
##    .E1                4.750    0.067   70.512    0.000    4.750    5.377
##    .E2                4.884    0.068   72.116    0.000    4.884    5.499
##    .E3                4.797    0.072   66.943    0.000    4.797    5.104
##    .F1                4.297    0.092   46.938    0.000    4.297    3.579
##    .F2                4.808    0.076   63.304    0.000    4.808    4.827
##    .F3                4.703    0.064   73.889    0.000    4.703    5.634
##     FA                0.000                               0.000    0.000
##     FB                0.000                               0.000    0.000
##     FC                0.000                               0.000    0.000
##     FD                0.000                               0.000    0.000
##     FE                0.000                               0.000    0.000
##     FF                0.000                               0.000    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##     FA                1.000                               1.000    1.000
##     FB                1.000                               1.000    1.000
##     FC                1.000                               1.000    1.000
##     FD                1.000                               1.000    1.000
##     FE                1.000                               1.000    1.000
##     FF                1.000                               1.000    1.000
##    .A1                0.376    0.059    6.380    0.000    0.376    0.454
##    .A2                0.532    0.069    7.684    0.000    0.532    0.585
##    .A3                0.566    0.067    8.386    0.000    0.566    0.709
##    .B1                0.828    0.102    8.155    0.000    0.828    0.628
##    .B2                0.329    0.085    3.896    0.000    0.329    0.256
##    .B3                0.476    0.070    6.801    0.000    0.476    0.458
##    .C1                0.442    0.062    7.156    0.000    0.442    0.542
##    .C2                0.430    0.072    5.931    0.000    0.430    0.430
##    .C3                0.573    0.075    7.670    0.000    0.573    0.607
##    .D1                0.214    0.045    4.711    0.000    0.214    0.251
##    .D2                0.184    0.035    5.263    0.000    0.184    0.283
##    .D3                0.372    0.046    8.141    0.000    0.372    0.553
##    .E1                0.204    0.033    6.182    0.000    0.204    0.261
##    .E2                0.200    0.033    6.048    0.000    0.200    0.253
##    .E3                0.232    0.037    6.216    0.000    0.232    0.263
##    .F1                1.129    0.132    8.544    0.000    1.129    0.783
##    .F2                0.547    0.078    6.967    0.000    0.547    0.551
##    .F3                0.263    0.056    4.732    0.000    0.263    0.378

6.3.2 模型二:因素载荷恒等模型

跨样本的(1)因素结构相同,(2)因素载荷相同,其他都不相同。

和上一模型相比,待估参数减去少估计的一半载荷参数,也就是102-18 = 84,自由度\(df = 342 - 84 = 258\)

mod2_fit <- cfa(model=cfa_model, 
                data = dat_all, 
                group.equal=c("loadings"), # 跨样本因素载荷相同
                group = 'gender') # 性别变量

mod2_res <- summary(mod2_fit, fit.measures=TRUE, standard=TRUE)
print(mod2_res)
## lavaan 0.6.15 ended normally after 34 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                       138
##   Number of equality constraints                    18
## 
##   Number of observations per group:                   
##     female                                         140
##     male                                           172
## 
## Model Test User Model:
##                                                       
##   Test statistic                               448.511
##   Degrees of freedom                               258
##   P-value (Chi-square)                           0.000
##   Test statistic for each group:
##     female                                     235.170
##     male                                       213.341
## 
## Model Test Baseline Model:
## 
##   Test statistic                              2997.338
##   Degrees of freedom                               306
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.929
##   Tucker-Lewis Index (TLI)                       0.916
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)              -6672.058
##   Loglikelihood unrestricted model (H1)      -6447.803
##                                                       
##   Akaike (AIC)                               13584.116
##   Bayesian (BIC)                             14033.277
##   Sample-size adjusted Bayesian (SABIC)      13652.677
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.069
##   90 Percent confidence interval - lower         0.058
##   90 Percent confidence interval - upper         0.079
##   P-value H_0: RMSEA <= 0.050                    0.003
##   P-value H_0: RMSEA >= 0.080                    0.040
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.112
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## 
## Group 1 [female]:
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   FA =~                                                                 
##     A1      (.p1.)    0.818    0.050   16.372    0.000    0.818    0.868
##     A2      (.p2.)    0.697    0.054   12.808    0.000    0.697    0.680
##     A3      (.p3.)    0.619    0.053   11.770    0.000    0.619    0.642
##   FB =~                                                                 
##     B1      (.p4.)    0.801    0.061   13.053    0.000    0.801    0.719
##     B2      (.p5.)    0.939    0.058   16.247    0.000    0.939    0.812
##     B3      (.p6.)    0.846    0.055   15.429    0.000    0.846    0.784
##   FC =~                                                                 
##     C1      (.p7.)    0.700    0.052   13.368    0.000    0.700    0.707
##     C2      (.p8.)    0.762    0.055   13.734    0.000    0.762    0.719
##     C3      (.p9.)    0.675    0.057   11.763    0.000    0.675    0.629
##   FD =~                                                                 
##     D1      (.10.)    0.819    0.044   18.576    0.000    0.819    0.884
##     D2      (.11.)    0.750    0.039   19.184    0.000    0.750    0.907
##     D3      (.12.)    0.657    0.046   14.307    0.000    0.657    0.706
##   FE =~                                                                 
##     E1      (.13.)    0.804    0.045   17.802    0.000    0.804    0.797
##     E2      (.14.)    0.882    0.045   19.446    0.000    0.882    0.882
##     E3      (.15.)    0.806    0.047   17.298    0.000    0.806    0.791
##   FF =~                                                                 
##     F1      (.16.)    0.645    0.065    9.891    0.000    0.645    0.607
##     F2      (.17.)    0.812    0.057   14.212    0.000    0.812    0.765
##     F3      (.18.)    0.751    0.047   15.906    0.000    0.751    0.822
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   FA ~~                                                                 
##     FB                0.420    0.087    4.819    0.000    0.420    0.420
##     FC                0.339    0.098    3.467    0.001    0.339    0.339
##     FD                0.216    0.092    2.348    0.019    0.216    0.216
##     FE                0.428    0.083    5.150    0.000    0.428    0.428
##     FF                0.593    0.075    7.882    0.000    0.593    0.593
##   FB ~~                                                                 
##     FC                0.781    0.062   12.666    0.000    0.781    0.781
##     FD                0.486    0.076    6.415    0.000    0.486    0.486
##     FE                0.617    0.066    9.300    0.000    0.617    0.617
##     FF                0.273    0.095    2.867    0.004    0.273    0.273
##   FC ~~                                                                 
##     FD                0.572    0.076    7.559    0.000    0.572    0.572
##     FE                0.582    0.076    7.627    0.000    0.582    0.582
##     FF                0.536    0.086    6.203    0.000    0.536    0.536
##   FD ~~                                                                 
##     FE                0.610    0.062    9.910    0.000    0.610    0.610
##     FF                0.360    0.087    4.155    0.000    0.360    0.360
##   FE ~~                                                                 
##     FF                0.446    0.083    5.387    0.000    0.446    0.446
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .A1                4.236    0.080   53.125    0.000    4.236    4.490
##    .A2                4.136    0.087   47.722    0.000    4.136    4.033
##    .A3                3.971    0.081   48.772    0.000    3.971    4.122
##    .B1                3.893    0.094   41.359    0.000    3.893    3.495
##    .B2                4.050    0.098   41.461    0.000    4.050    3.504
##    .B3                4.043    0.091   44.338    0.000    4.043    3.747
##    .C1                4.279    0.084   51.138    0.000    4.279    4.322
##    .C2                4.343    0.090   48.521    0.000    4.343    4.101
##    .C3                4.136    0.091   45.552    0.000    4.136    3.850
##    .D1                4.836    0.078   61.728    0.000    4.836    5.217
##    .D2                4.936    0.070   70.653    0.000    4.936    5.971
##    .D3                4.736    0.079   60.189    0.000    4.736    5.087
##    .E1                4.479    0.085   52.534    0.000    4.479    4.440
##    .E2                4.543    0.085   53.739    0.000    4.543    4.542
##    .E3                4.579    0.086   53.140    0.000    4.579    4.491
##    .F1                4.136    0.090   46.081    0.000    4.136    3.895
##    .F2                4.393    0.090   48.961    0.000    4.393    4.138
##    .F3                4.221    0.077   54.702    0.000    4.221    4.623
##     FA                0.000                               0.000    0.000
##     FB                0.000                               0.000    0.000
##     FC                0.000                               0.000    0.000
##     FD                0.000                               0.000    0.000
##     FE                0.000                               0.000    0.000
##     FF                0.000                               0.000    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##     FA                1.000                               1.000    1.000
##     FB                1.000                               1.000    1.000
##     FC                1.000                               1.000    1.000
##     FD                1.000                               1.000    1.000
##     FE                1.000                               1.000    1.000
##     FF                1.000                               1.000    1.000
##    .A1                0.220    0.060    3.650    0.000    0.220    0.247
##    .A2                0.566    0.081    6.953    0.000    0.566    0.538
##    .A3                0.545    0.075    7.235    0.000    0.545    0.587
##    .B1                0.599    0.086    6.934    0.000    0.599    0.483
##    .B2                0.455    0.079    5.739    0.000    0.455    0.341
##    .B3                0.448    0.072    6.203    0.000    0.448    0.385
##    .C1                0.490    0.074    6.613    0.000    0.490    0.500
##    .C2                0.541    0.084    6.480    0.000    0.541    0.483
##    .C3                0.698    0.096    7.262    0.000    0.698    0.605
##    .D1                0.188    0.038    4.895    0.000    0.188    0.219
##    .D2                0.121    0.030    4.097    0.000    0.121    0.178
##    .D3                0.434    0.058    7.535    0.000    0.434    0.501
##    .E1                0.372    0.057    6.558    0.000    0.372    0.365
##    .E2                0.223    0.047    4.752    0.000    0.223    0.223
##    .E3                0.389    0.059    6.626    0.000    0.389    0.374
##    .F1                0.712    0.096    7.417    0.000    0.712    0.631
##    .F2                0.468    0.078    5.975    0.000    0.468    0.415
##    .F3                0.270    0.055    4.891    0.000    0.270    0.324
## 
## 
## Group 2 [male]:
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   FA =~                                                                 
##     A1      (.p1.)    0.818    0.050   16.372    0.000    0.818    0.807
##     A2      (.p2.)    0.697    0.054   12.808    0.000    0.697    0.689
##     A3      (.p3.)    0.619    0.053   11.770    0.000    0.619    0.640
##   FB =~                                                                 
##     B1      (.p4.)    0.801    0.061   13.053    0.000    0.801    0.669
##     B2      (.p5.)    0.939    0.058   16.247    0.000    0.939    0.824
##     B3      (.p6.)    0.846    0.055   15.429    0.000    0.846    0.790
##   FC =~                                                                 
##     C1      (.p7.)    0.700    0.052   13.368    0.000    0.700    0.730
##     C2      (.p8.)    0.762    0.055   13.734    0.000    0.762    0.748
##     C3      (.p9.)    0.675    0.057   11.763    0.000    0.675    0.667
##   FD =~                                                                 
##     D1      (.10.)    0.819    0.044   18.576    0.000    0.819    0.859
##     D2      (.11.)    0.750    0.039   19.184    0.000    0.750    0.873
##     D3      (.12.)    0.657    0.046   14.307    0.000    0.657    0.739
##   FE =~                                                                 
##     E1      (.13.)    0.804    0.045   17.802    0.000    0.804    0.869
##     E2      (.14.)    0.882    0.045   19.446    0.000    0.882    0.900
##     E3      (.15.)    0.806    0.047   17.298    0.000    0.806    0.848
##   FF =~                                                                 
##     F1      (.16.)    0.645    0.065    9.891    0.000    0.645    0.519
##     F2      (.17.)    0.812    0.057   14.212    0.000    0.812    0.745
##     F3      (.18.)    0.751    0.047   15.906    0.000    0.751    0.828
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   FA ~~                                                                 
##     FB                0.640    0.065    9.846    0.000    0.640    0.640
##     FC                0.626    0.070    8.937    0.000    0.626    0.626
##     FD                0.661    0.059   11.148    0.000    0.661    0.661
##     FE                0.585    0.064    9.150    0.000    0.585    0.585
##     FF                0.760    0.057   13.301    0.000    0.760    0.760
##   FB ~~                                                                 
##     FC                0.634    0.066    9.550    0.000    0.634    0.634
##     FD                0.436    0.073    5.934    0.000    0.436    0.436
##     FE                0.529    0.065    8.093    0.000    0.529    0.529
##     FF                0.457    0.077    5.912    0.000    0.457    0.457
##   FC ~~                                                                 
##     FD                0.492    0.074    6.691    0.000    0.492    0.492
##     FE                0.609    0.063    9.682    0.000    0.609    0.609
##     FF                0.652    0.067    9.682    0.000    0.652    0.652
##   FD ~~                                                                 
##     FE                0.533    0.062    8.632    0.000    0.533    0.533
##     FF                0.316    0.081    3.895    0.000    0.316    0.316
##   FE ~~                                                                 
##     FF                0.389    0.076    5.098    0.000    0.389    0.389
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .A1                4.552    0.077   58.890    0.000    4.552    4.490
##    .A2                4.442    0.077   57.548    0.000    4.442    4.388
##    .A3                4.145    0.074   56.174    0.000    4.145    4.283
##    .B1                4.110    0.091   45.047    0.000    4.110    3.435
##    .B2                4.407    0.087   50.750    0.000    4.407    3.870
##    .B3                4.390    0.082   53.752    0.000    4.390    4.099
##    .C1                4.442    0.073   60.707    0.000    4.442    4.629
##    .C2                4.326    0.078   55.725    0.000    4.326    4.249
##    .C3                4.442    0.077   57.554    0.000    4.442    4.388
##    .D1                4.831    0.073   66.461    0.000    4.831    5.068
##    .D2                4.953    0.065   75.687    0.000    4.953    5.771
##    .D3                4.913    0.068   72.397    0.000    4.913    5.520
##    .E1                4.750    0.070   67.379    0.000    4.750    5.138
##    .E2                4.884    0.075   65.395    0.000    4.884    4.986
##    .E3                4.797    0.072   66.171    0.000    4.797    5.046
##    .F1                4.297    0.095   45.350    0.000    4.297    3.458
##    .F2                4.808    0.083   57.855    0.000    4.808    4.411
##    .F3                4.703    0.069   68.017    0.000    4.703    5.186
##     FA                0.000                               0.000    0.000
##     FB                0.000                               0.000    0.000
##     FC                0.000                               0.000    0.000
##     FD                0.000                               0.000    0.000
##     FE                0.000                               0.000    0.000
##     FF                0.000                               0.000    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##     FA                1.000                               1.000    1.000
##     FB                1.000                               1.000    1.000
##     FC                1.000                               1.000    1.000
##     FD                1.000                               1.000    1.000
##     FE                1.000                               1.000    1.000
##     FF                1.000                               1.000    1.000
##    .A1                0.358    0.057    6.237    0.000    0.358    0.348
##    .A2                0.539    0.068    7.922    0.000    0.539    0.526
##    .A3                0.554    0.067    8.254    0.000    0.554    0.591
##    .B1                0.791    0.100    7.943    0.000    0.791    0.552
##    .B2                0.416    0.074    5.648    0.000    0.416    0.321
##    .B3                0.431    0.067    6.394    0.000    0.431    0.376
##    .C1                0.430    0.061    7.036    0.000    0.430    0.467
##    .C2                0.456    0.067    6.761    0.000    0.456    0.440
##    .C3                0.569    0.074    7.720    0.000    0.569    0.555
##    .D1                0.238    0.041    5.833    0.000    0.238    0.262
##    .D2                0.175    0.032    5.405    0.000    0.175    0.237
##    .D3                0.360    0.046    7.885    0.000    0.360    0.454
##    .E1                0.209    0.033    6.431    0.000    0.209    0.245
##    .E2                0.182    0.034    5.394    0.000    0.182    0.189
##    .E3                0.253    0.036    6.953    0.000    0.253    0.280
##    .F1                1.128    0.131    8.639    0.000    1.128    0.731
##    .F2                0.529    0.076    6.942    0.000    0.529    0.445
##    .F3                0.259    0.050    5.212    0.000    0.259    0.315

6.3.3 模型三:因素载荷与测量残差恒等模型

跨样本的(1)因素结构相同,(2)因素载荷相同,(3)测量变量残差相同。

和上一模型相比,待估参数再减去一半的测量变量残差方差,也就是84-18=66,自由度\(df = 342 - 66 = 276\)

mod3_fit <- cfa(model=cfa_model, 
                data = dat_all, 
                group.equal=c("loadings", "residuals"), 
                group = 'gender') # 性别变量

mod3_res <- summary(mod3_fit, fit.measures=TRUE, standard=TRUE)
print(mod3_res)
## lavaan 0.6.15 ended normally after 29 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                       138
##   Number of equality constraints                    36
## 
##   Number of observations per group:                   
##     female                                         140
##     male                                           172
## 
## Model Test User Model:
##                                                       
##   Test statistic                               481.176
##   Degrees of freedom                               276
##   P-value (Chi-square)                           0.000
##   Test statistic for each group:
##     female                                     250.957
##     male                                       230.219
## 
## Model Test Baseline Model:
## 
##   Test statistic                              2997.338
##   Degrees of freedom                               306
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.924
##   Tucker-Lewis Index (TLI)                       0.915
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)              -6688.391
##   Loglikelihood unrestricted model (H1)      -6447.803
##                                                       
##   Akaike (AIC)                               13580.782
##   Bayesian (BIC)                             13962.568
##   Sample-size adjusted Bayesian (SABIC)      13639.058
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.069
##   90 Percent confidence interval - lower         0.059
##   90 Percent confidence interval - upper         0.079
##   P-value H_0: RMSEA <= 0.050                    0.002
##   P-value H_0: RMSEA >= 0.080                    0.038
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.110
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## 
## Group 1 [female]:
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   FA =~                                                                 
##     A1      (.p1.)    0.797    0.050   15.976    0.000    0.797    0.816
##     A2      (.p2.)    0.707    0.054   12.985    0.000    0.707    0.695
##     A3      (.p3.)    0.614    0.053   11.602    0.000    0.614    0.636
##   FB =~                                                                 
##     B1      (.p4.)    0.794    0.062   12.869    0.000    0.794    0.687
##     B2      (.p5.)    0.929    0.058   16.072    0.000    0.929    0.814
##     B3      (.p6.)    0.848    0.055   15.485    0.000    0.848    0.791
##   FC =~                                                                 
##     C1      (.p7.)    0.703    0.053   13.384    0.000    0.703    0.722
##     C2      (.p8.)    0.759    0.056   13.663    0.000    0.759    0.733
##     C3      (.p9.)    0.676    0.058   11.716    0.000    0.676    0.649
##   FD =~                                                                 
##     D1      (.10.)    0.818    0.044   18.529    0.000    0.818    0.870
##     D2      (.11.)    0.744    0.039   19.039    0.000    0.744    0.886
##     D3      (.12.)    0.660    0.046   14.294    0.000    0.660    0.725
##   FE =~                                                                 
##     E1      (.13.)    0.795    0.046   17.294    0.000    0.795    0.827
##     E2      (.14.)    0.897    0.045   19.748    0.000    0.897    0.903
##     E3      (.15.)    0.788    0.047   16.775    0.000    0.788    0.810
##   FF =~                                                                 
##     F1      (.16.)    0.637    0.066    9.593    0.000    0.637    0.548
##     F2      (.17.)    0.806    0.057   14.066    0.000    0.806    0.750
##     F3      (.18.)    0.750    0.047   15.820    0.000    0.750    0.825
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   FA ~~                                                                 
##     FB                0.439    0.088    4.971    0.000    0.439    0.439
##     FC                0.360    0.098    3.685    0.000    0.360    0.360
##     FD                0.223    0.095    2.354    0.019    0.223    0.223
##     FE                0.457    0.082    5.592    0.000    0.457    0.457
##     FF                0.617    0.075    8.194    0.000    0.617    0.617
##   FB ~~                                                                 
##     FC                0.762    0.061   12.471    0.000    0.762    0.762
##     FD                0.494    0.076    6.512    0.000    0.494    0.494
##     FE                0.607    0.066    9.227    0.000    0.607    0.607
##     FF                0.270    0.096    2.817    0.005    0.270    0.270
##   FC ~~                                                                 
##     FD                0.573    0.075    7.679    0.000    0.573    0.573
##     FE                0.562    0.075    7.514    0.000    0.562    0.562
##     FF                0.526    0.086    6.110    0.000    0.526    0.526
##   FD ~~                                                                 
##     FE                0.609    0.061    9.999    0.000    0.609    0.609
##     FF                0.353    0.088    4.002    0.000    0.353    0.353
##   FE ~~                                                                 
##     FF                0.439    0.082    5.334    0.000    0.439    0.439
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .A1                4.236    0.082   51.354    0.000    4.236    4.340
##    .A2                4.136    0.086   48.086    0.000    4.136    4.064
##    .A3                3.971    0.082   48.701    0.000    3.971    4.116
##    .B1                3.893    0.098   39.881    0.000    3.893    3.371
##    .B2                4.050    0.096   41.970    0.000    4.050    3.547
##    .B3                4.043    0.091   44.607    0.000    4.043    3.770
##    .C1                4.279    0.082   51.936    0.000    4.279    4.389
##    .C2                4.343    0.087   49.676    0.000    4.343    4.198
##    .C3                4.136    0.088   46.984    0.000    4.136    3.971
##    .D1                4.836    0.079   60.849    0.000    4.836    5.143
##    .D2                4.936    0.071   69.525    0.000    4.936    5.876
##    .D3                4.736    0.077   61.553    0.000    4.736    5.202
##    .E1                4.479    0.081   55.144    0.000    4.479    4.661
##    .E2                4.543    0.084   54.135    0.000    4.543    4.575
##    .E3                4.579    0.082   55.720    0.000    4.579    4.709
##    .F1                4.136    0.098   42.102    0.000    4.136    3.558
##    .F2                4.393    0.091   48.391    0.000    4.393    4.090
##    .F3                4.221    0.077   54.965    0.000    4.221    4.645
##     FA                0.000                               0.000    0.000
##     FB                0.000                               0.000    0.000
##     FC                0.000                               0.000    0.000
##     FD                0.000                               0.000    0.000
##     FE                0.000                               0.000    0.000
##     FF                0.000                               0.000    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##     FA                1.000                               1.000    1.000
##     FB                1.000                               1.000    1.000
##     FC                1.000                               1.000    1.000
##     FD                1.000                               1.000    1.000
##     FE                1.000                               1.000    1.000
##     FF                1.000                               1.000    1.000
##    .A1      (.25.)    0.318    0.043    7.308    0.000    0.318    0.333
##    .A2      (.26.)    0.535    0.053   10.115    0.000    0.535    0.517
##    .A3      (.27.)    0.554    0.051   10.788    0.000    0.554    0.595
##    .B1      (.28.)    0.703    0.068   10.393    0.000    0.703    0.527
##    .B2      (.29.)    0.441    0.057    7.791    0.000    0.441    0.338
##    .B3      (.30.)    0.430    0.051    8.444    0.000    0.430    0.374
##    .C1      (.31.)    0.456    0.049    9.347    0.000    0.456    0.479
##    .C2      (.32.)    0.494    0.054    9.108    0.000    0.494    0.462
##    .C3      (.33.)    0.628    0.060   10.423    0.000    0.628    0.579
##    .D1      (.34.)    0.214    0.030    7.182    0.000    0.214    0.242
##    .D2      (.35.)    0.151    0.023    6.458    0.000    0.151    0.215
##    .D3      (.36.)    0.394    0.036   10.807    0.000    0.394    0.475
##    .E1      (.37.)    0.291    0.032    9.246    0.000    0.291    0.315
##    .E2      (.38.)    0.182    0.029    6.195    0.000    0.182    0.185
##    .E3      (.39.)    0.325    0.034    9.679    0.000    0.325    0.343
##    .F1      (.40.)    0.945    0.083   11.353    0.000    0.945    0.699
##    .F2      (.41.)    0.505    0.057    8.816    0.000    0.505    0.438
##    .F3      (.42.)    0.264    0.040    6.602    0.000    0.264    0.319
## 
## 
## Group 2 [male]:
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   FA =~                                                                 
##     A1      (.p1.)    0.797    0.050   15.976    0.000    0.797    0.816
##     A2      (.p2.)    0.707    0.054   12.985    0.000    0.707    0.695
##     A3      (.p3.)    0.614    0.053   11.602    0.000    0.614    0.636
##   FB =~                                                                 
##     B1      (.p4.)    0.794    0.062   12.869    0.000    0.794    0.687
##     B2      (.p5.)    0.929    0.058   16.072    0.000    0.929    0.814
##     B3      (.p6.)    0.848    0.055   15.485    0.000    0.848    0.791
##   FC =~                                                                 
##     C1      (.p7.)    0.703    0.053   13.384    0.000    0.703    0.722
##     C2      (.p8.)    0.759    0.056   13.663    0.000    0.759    0.733
##     C3      (.p9.)    0.676    0.058   11.716    0.000    0.676    0.649
##   FD =~                                                                 
##     D1      (.10.)    0.818    0.044   18.529    0.000    0.818    0.870
##     D2      (.11.)    0.744    0.039   19.039    0.000    0.744    0.886
##     D3      (.12.)    0.660    0.046   14.294    0.000    0.660    0.725
##   FE =~                                                                 
##     E1      (.13.)    0.795    0.046   17.294    0.000    0.795    0.827
##     E2      (.14.)    0.897    0.045   19.748    0.000    0.897    0.903
##     E3      (.15.)    0.788    0.047   16.775    0.000    0.788    0.810
##   FF =~                                                                 
##     F1      (.16.)    0.637    0.066    9.593    0.000    0.637    0.548
##     F2      (.17.)    0.806    0.057   14.066    0.000    0.806    0.750
##     F3      (.18.)    0.750    0.047   15.820    0.000    0.750    0.825
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   FA ~~                                                                 
##     FB                0.627    0.065    9.604    0.000    0.627    0.627
##     FC                0.625    0.070    8.917    0.000    0.625    0.625
##     FD                0.643    0.059   10.808    0.000    0.643    0.643
##     FE                0.585    0.064    9.159    0.000    0.585    0.585
##     FF                0.750    0.056   13.345    0.000    0.750    0.750
##   FB ~~                                                                 
##     FC                0.636    0.067    9.492    0.000    0.636    0.636
##     FD                0.425    0.074    5.770    0.000    0.425    0.425
##     FE                0.525    0.066    7.895    0.000    0.525    0.525
##     FF                0.448    0.078    5.767    0.000    0.448    0.448
##   FC ~~                                                                 
##     FD                0.482    0.075    6.466    0.000    0.482    0.482
##     FE                0.626    0.063    9.946    0.000    0.626    0.626
##     FF                0.663    0.067    9.948    0.000    0.663    0.663
##   FD ~~                                                                 
##     FE                0.523    0.063    8.349    0.000    0.523    0.523
##     FF                0.306    0.081    3.779    0.000    0.306    0.306
##   FE ~~                                                                 
##     FF                0.397    0.076    5.196    0.000    0.397    0.397
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .A1                4.552    0.074   61.176    0.000    4.552    4.665
##    .A2                4.442    0.078   57.244    0.000    4.442    4.365
##    .A3                4.145    0.074   56.345    0.000    4.145    4.296
##    .B1                4.110    0.088   46.676    0.000    4.110    3.559
##    .B2                4.407    0.087   50.620    0.000    4.407    3.860
##    .B3                4.390    0.082   53.683    0.000    4.390    4.093
##    .C1                4.442    0.074   59.763    0.000    4.442    4.557
##    .C2                4.326    0.079   54.842    0.000    4.326    4.182
##    .C3                4.442    0.079   55.933    0.000    4.442    4.265
##    .D1                4.831    0.072   67.386    0.000    4.831    5.138
##    .D2                4.953    0.064   77.339    0.000    4.953    5.897
##    .D3                4.913    0.069   70.777    0.000    4.913    5.397
##    .E1                4.750    0.073   64.826    0.000    4.750    4.943
##    .E2                4.884    0.076   64.506    0.000    4.884    4.919
##    .E3                4.797    0.074   64.701    0.000    4.797    4.933
##    .F1                4.297    0.089   48.481    0.000    4.297    3.697
##    .F2                4.808    0.082   58.708    0.000    4.808    4.476
##    .F3                4.703    0.069   67.881    0.000    4.703    5.176
##     FA                0.000                               0.000    0.000
##     FB                0.000                               0.000    0.000
##     FC                0.000                               0.000    0.000
##     FD                0.000                               0.000    0.000
##     FE                0.000                               0.000    0.000
##     FF                0.000                               0.000    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##     FA                1.000                               1.000    1.000
##     FB                1.000                               1.000    1.000
##     FC                1.000                               1.000    1.000
##     FD                1.000                               1.000    1.000
##     FE                1.000                               1.000    1.000
##     FF                1.000                               1.000    1.000
##    .A1      (.25.)    0.318    0.043    7.308    0.000    0.318    0.333
##    .A2      (.26.)    0.535    0.053   10.115    0.000    0.535    0.517
##    .A3      (.27.)    0.554    0.051   10.788    0.000    0.554    0.595
##    .B1      (.28.)    0.703    0.068   10.393    0.000    0.703    0.527
##    .B2      (.29.)    0.441    0.057    7.791    0.000    0.441    0.338
##    .B3      (.30.)    0.430    0.051    8.444    0.000    0.430    0.374
##    .C1      (.31.)    0.456    0.049    9.347    0.000    0.456    0.479
##    .C2      (.32.)    0.494    0.054    9.108    0.000    0.494    0.462
##    .C3      (.33.)    0.628    0.060   10.423    0.000    0.628    0.579
##    .D1      (.34.)    0.214    0.030    7.182    0.000    0.214    0.242
##    .D2      (.35.)    0.151    0.023    6.458    0.000    0.151    0.215
##    .D3      (.36.)    0.394    0.036   10.807    0.000    0.394    0.475
##    .E1      (.37.)    0.291    0.032    9.246    0.000    0.291    0.315
##    .E2      (.38.)    0.182    0.029    6.195    0.000    0.182    0.185
##    .E3      (.39.)    0.325    0.034    9.679    0.000    0.325    0.343
##    .F1      (.40.)    0.945    0.083   11.353    0.000    0.945    0.699
##    .F2      (.41.)    0.505    0.057    8.816    0.000    0.505    0.438
##    .F3      (.42.)    0.264    0.040    6.602    0.000    0.264    0.319

6.3.4 模型四:协方差恒等模型

最严格的CFA恒等检测,跨样本的(1)因素结构相同,(2)因素载荷相同,(3)测量变量残差相同,(4)新增方差和协方差恒等

和上一模型相比,待估参数再减去一半的潜变量的协方差,也就是66-15=51,自由度\(df = 342 - 51 = 291\)

mod4_fit <- cfa(model=cfa_model, 
                data = dat_all, 
                group.equal=c("loadings", "residuals", "lv.covariances"), 
                group = 'gender') # 性别变量

mod4_res <- summary(mod4_fit, fit.measures=TRUE, standard=TRUE)
print(mod4_res)
## lavaan 0.6.15 ended normally after 25 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                       138
##   Number of equality constraints                    51
## 
##   Number of observations per group:                   
##     female                                         140
##     male                                           172
## 
## Model Test User Model:
##                                                       
##   Test statistic                               522.269
##   Degrees of freedom                               291
##   P-value (Chi-square)                           0.000
##   Test statistic for each group:
##     female                                     270.584
##     male                                       251.685
## 
## Model Test Baseline Model:
## 
##   Test statistic                              2997.338
##   Degrees of freedom                               306
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.914
##   Tucker-Lewis Index (TLI)                       0.910
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)              -6708.937
##   Loglikelihood unrestricted model (H1)      -6447.803
##                                                       
##   Akaike (AIC)                               13591.874
##   Bayesian (BIC)                             13917.516
##   Sample-size adjusted Bayesian (SABIC)      13641.581
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.071
##   90 Percent confidence interval - lower         0.061
##   90 Percent confidence interval - upper         0.081
##   P-value H_0: RMSEA <= 0.050                    0.000
##   P-value H_0: RMSEA >= 0.080                    0.075
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.105
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## 
## Group 1 [female]:
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   FA =~                                                                 
##     A1      (.p1.)    0.795    0.051   15.562    0.000    0.795    0.822
##     A2      (.p2.)    0.691    0.056   12.433    0.000    0.691    0.684
##     A3      (.p3.)    0.603    0.054   11.206    0.000    0.603    0.628
##   FB =~                                                                 
##     B1      (.p4.)    0.784    0.062   12.641    0.000    0.784    0.680
##     B2      (.p5.)    0.941    0.058   16.272    0.000    0.941    0.826
##     B3      (.p6.)    0.833    0.055   15.069    0.000    0.833    0.779
##   FC =~                                                                 
##     C1      (.p7.)    0.690    0.053   13.014    0.000    0.690    0.712
##     C2      (.p8.)    0.749    0.056   13.387    0.000    0.749    0.729
##     C3      (.p9.)    0.673    0.058   11.613    0.000    0.673    0.649
##   FD =~                                                                 
##     D1      (.10.)    0.815    0.045   18.275    0.000    0.815    0.870
##     D2      (.11.)    0.740    0.040   18.722    0.000    0.740    0.885
##     D3      (.12.)    0.654    0.046   14.096    0.000    0.654    0.721
##   FE =~                                                                 
##     E1      (.13.)    0.792    0.046   17.168    0.000    0.792    0.825
##     E2      (.14.)    0.894    0.046   19.639    0.000    0.894    0.902
##     E3      (.15.)    0.788    0.047   16.763    0.000    0.788    0.812
##   FF =~                                                                 
##     F1      (.16.)    0.639    0.067    9.583    0.000    0.639    0.550
##     F2      (.17.)    0.801    0.058   13.844    0.000    0.801    0.747
##     F3      (.18.)    0.745    0.048   15.528    0.000    0.745    0.822
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   FA ~~                                                                 
##     FB      (.43.)    0.520    0.056    9.249    0.000    0.520    0.520
##     FC      (.44.)    0.475    0.062    7.613    0.000    0.475    0.475
##     FD      (.45.)    0.419    0.058    7.163    0.000    0.419    0.419
##     FE      (.46.)    0.507    0.054    9.423    0.000    0.507    0.507
##     FF      (.47.)    0.677    0.048   13.978    0.000    0.677    0.677
##   FB ~~                                                                 
##     FC      (.48.)    0.687    0.048   14.331    0.000    0.687    0.687
##     FD      (.49.)    0.449    0.055    8.126    0.000    0.449    0.449
##     FE      (.50.)    0.558    0.049   11.381    0.000    0.558    0.558
##     FF      (.51.)    0.353    0.064    5.561    0.000    0.353    0.353
##   FC ~~                                                                 
##     FD      (.52.)    0.520    0.055    9.411    0.000    0.520    0.520
##     FE      (.53.)    0.591    0.051   11.658    0.000    0.591    0.591
##     FF      (.54.)    0.589    0.056   10.560    0.000    0.589    0.589
##   FD ~~                                                                 
##     FE      (.55.)    0.560    0.046   12.127    0.000    0.560    0.560
##     FF      (.56.)    0.321    0.062    5.170    0.000    0.321    0.321
##   FE ~~                                                                 
##     FF      (.57.)    0.416    0.058    7.176    0.000    0.416    0.416
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .A1                4.236    0.082   51.828    0.000    4.236    4.380
##    .A2                4.136    0.085   48.407    0.000    4.136    4.091
##    .A3                3.971    0.081   48.973    0.000    3.971    4.139
##    .B1                3.893    0.097   39.972    0.000    3.893    3.378
##    .B2                4.050    0.096   42.104    0.000    4.050    3.558
##    .B3                4.043    0.090   44.742    0.000    4.043    3.781
##    .C1                4.279    0.082   52.280    0.000    4.279    4.418
##    .C2                4.343    0.087   50.017    0.000    4.343    4.227
##    .C3                4.136    0.088   47.236    0.000    4.136    3.992
##    .D1                4.836    0.079   61.130    0.000    4.836    5.166
##    .D2                4.936    0.071   69.858    0.000    4.936    5.904
##    .D3                4.736    0.077   61.750    0.000    4.736    5.219
##    .E1                4.479    0.081   55.233    0.000    4.479    4.668
##    .E2                4.543    0.084   54.239    0.000    4.543    4.584
##    .E3                4.579    0.082   55.807    0.000    4.579    4.717
##    .F1                4.136    0.098   42.161    0.000    4.136    3.563
##    .F2                4.393    0.091   48.519    0.000    4.393    4.101
##    .F3                4.221    0.077   55.140    0.000    4.221    4.660
##     FA                0.000                               0.000    0.000
##     FB                0.000                               0.000    0.000
##     FC                0.000                               0.000    0.000
##     FD                0.000                               0.000    0.000
##     FE                0.000                               0.000    0.000
##     FF                0.000                               0.000    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##     FA                1.000                               1.000    1.000
##     FB                1.000                               1.000    1.000
##     FC                1.000                               1.000    1.000
##     FD                1.000                               1.000    1.000
##     FE                1.000                               1.000    1.000
##     FF                1.000                               1.000    1.000
##    .A1      (.25.)    0.303    0.047    6.499    0.000    0.303    0.324
##    .A2      (.26.)    0.544    0.055    9.920    0.000    0.544    0.532
##    .A3      (.27.)    0.558    0.052   10.627    0.000    0.558    0.606
##    .B1      (.28.)    0.713    0.068   10.429    0.000    0.713    0.537
##    .B2      (.29.)    0.411    0.057    7.225    0.000    0.411    0.317
##    .B3      (.30.)    0.449    0.052    8.631    0.000    0.449    0.392
##    .C1      (.31.)    0.462    0.049    9.348    0.000    0.462    0.493
##    .C2      (.32.)    0.495    0.055    9.019    0.000    0.495    0.469
##    .C3      (.33.)    0.621    0.060   10.297    0.000    0.621    0.578
##    .D1      (.34.)    0.212    0.031    6.952    0.000    0.212    0.242
##    .D2      (.35.)    0.152    0.024    6.287    0.000    0.152    0.217
##    .D3      (.36.)    0.396    0.037   10.793    0.000    0.396    0.481
##    .E1      (.37.)    0.294    0.032    9.261    0.000    0.294    0.319
##    .E2      (.38.)    0.182    0.030    6.160    0.000    0.182    0.186
##    .E3      (.39.)    0.321    0.033    9.607    0.000    0.321    0.341
##    .F1      (.40.)    0.939    0.083   11.282    0.000    0.939    0.697
##    .F2      (.41.)    0.507    0.058    8.662    0.000    0.507    0.442
##    .F3      (.42.)    0.266    0.041    6.448    0.000    0.266    0.324
## 
## 
## Group 2 [male]:
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   FA =~                                                                 
##     A1      (.p1.)    0.795    0.051   15.562    0.000    0.795    0.822
##     A2      (.p2.)    0.691    0.056   12.433    0.000    0.691    0.684
##     A3      (.p3.)    0.603    0.054   11.206    0.000    0.603    0.628
##   FB =~                                                                 
##     B1      (.p4.)    0.784    0.062   12.641    0.000    0.784    0.680
##     B2      (.p5.)    0.941    0.058   16.272    0.000    0.941    0.826
##     B3      (.p6.)    0.833    0.055   15.069    0.000    0.833    0.779
##   FC =~                                                                 
##     C1      (.p7.)    0.690    0.053   13.014    0.000    0.690    0.712
##     C2      (.p8.)    0.749    0.056   13.387    0.000    0.749    0.729
##     C3      (.p9.)    0.673    0.058   11.613    0.000    0.673    0.649
##   FD =~                                                                 
##     D1      (.10.)    0.815    0.045   18.275    0.000    0.815    0.870
##     D2      (.11.)    0.740    0.040   18.722    0.000    0.740    0.885
##     D3      (.12.)    0.654    0.046   14.096    0.000    0.654    0.721
##   FE =~                                                                 
##     E1      (.13.)    0.792    0.046   17.168    0.000    0.792    0.825
##     E2      (.14.)    0.894    0.046   19.639    0.000    0.894    0.902
##     E3      (.15.)    0.788    0.047   16.763    0.000    0.788    0.812
##   FF =~                                                                 
##     F1      (.16.)    0.639    0.067    9.583    0.000    0.639    0.550
##     F2      (.17.)    0.801    0.058   13.844    0.000    0.801    0.747
##     F3      (.18.)    0.745    0.048   15.528    0.000    0.745    0.822
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   FA ~~                                                                 
##     FB      (.43.)    0.520    0.056    9.249    0.000    0.520    0.520
##     FC      (.44.)    0.475    0.062    7.613    0.000    0.475    0.475
##     FD      (.45.)    0.419    0.058    7.163    0.000    0.419    0.419
##     FE      (.46.)    0.507    0.054    9.423    0.000    0.507    0.507
##     FF      (.47.)    0.677    0.048   13.978    0.000    0.677    0.677
##   FB ~~                                                                 
##     FC      (.48.)    0.687    0.048   14.331    0.000    0.687    0.687
##     FD      (.49.)    0.449    0.055    8.126    0.000    0.449    0.449
##     FE      (.50.)    0.558    0.049   11.381    0.000    0.558    0.558
##     FF      (.51.)    0.353    0.064    5.561    0.000    0.353    0.353
##   FC ~~                                                                 
##     FD      (.52.)    0.520    0.055    9.411    0.000    0.520    0.520
##     FE      (.53.)    0.591    0.051   11.658    0.000    0.591    0.591
##     FF      (.54.)    0.589    0.056   10.560    0.000    0.589    0.589
##   FD ~~                                                                 
##     FE      (.55.)    0.560    0.046   12.127    0.000    0.560    0.560
##     FF      (.56.)    0.321    0.062    5.170    0.000    0.321    0.321
##   FE ~~                                                                 
##     FF      (.57.)    0.416    0.058    7.176    0.000    0.416    0.416
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .A1                4.552    0.074   61.740    0.000    4.552    4.708
##    .A2                4.442    0.077   57.626    0.000    4.442    4.394
##    .A3                4.145    0.073   56.659    0.000    4.145    4.320
##    .B1                4.110    0.088   46.782    0.000    4.110    3.567
##    .B2                4.407    0.087   50.781    0.000    4.407    3.872
##    .B3                4.390    0.082   53.845    0.000    4.390    4.106
##    .C1                4.442    0.074   60.159    0.000    4.442    4.587
##    .C2                4.326    0.078   55.218    0.000    4.326    4.210
##    .C3                4.442    0.079   56.233    0.000    4.442    4.288
##    .D1                4.831    0.071   67.697    0.000    4.831    5.162
##    .D2                4.953    0.064   77.710    0.000    4.953    5.925
##    .D3                4.913    0.069   71.003    0.000    4.913    5.414
##    .E1                4.750    0.073   64.931    0.000    4.750    4.951
##    .E2                4.884    0.076   64.630    0.000    4.884    4.928
##    .E3                4.797    0.074   64.801    0.000    4.797    4.941
##    .F1                4.297    0.088   48.549    0.000    4.297    3.702
##    .F2                4.808    0.082   58.863    0.000    4.808    4.488
##    .F3                4.703    0.069   68.097    0.000    4.703    5.192
##     FA                0.000                               0.000    0.000
##     FB                0.000                               0.000    0.000
##     FC                0.000                               0.000    0.000
##     FD                0.000                               0.000    0.000
##     FE                0.000                               0.000    0.000
##     FF                0.000                               0.000    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##     FA                1.000                               1.000    1.000
##     FB                1.000                               1.000    1.000
##     FC                1.000                               1.000    1.000
##     FD                1.000                               1.000    1.000
##     FE                1.000                               1.000    1.000
##     FF                1.000                               1.000    1.000
##    .A1      (.25.)    0.303    0.047    6.499    0.000    0.303    0.324
##    .A2      (.26.)    0.544    0.055    9.920    0.000    0.544    0.532
##    .A3      (.27.)    0.558    0.052   10.627    0.000    0.558    0.606
##    .B1      (.28.)    0.713    0.068   10.429    0.000    0.713    0.537
##    .B2      (.29.)    0.411    0.057    7.225    0.000    0.411    0.317
##    .B3      (.30.)    0.449    0.052    8.631    0.000    0.449    0.392
##    .C1      (.31.)    0.462    0.049    9.348    0.000    0.462    0.493
##    .C2      (.32.)    0.495    0.055    9.019    0.000    0.495    0.469
##    .C3      (.33.)    0.621    0.060   10.297    0.000    0.621    0.578
##    .D1      (.34.)    0.212    0.031    6.952    0.000    0.212    0.242
##    .D2      (.35.)    0.152    0.024    6.287    0.000    0.152    0.217
##    .D3      (.36.)    0.396    0.037   10.793    0.000    0.396    0.481
##    .E1      (.37.)    0.294    0.032    9.261    0.000    0.294    0.319
##    .E2      (.38.)    0.182    0.030    6.160    0.000    0.182    0.186
##    .E3      (.39.)    0.321    0.033    9.607    0.000    0.321    0.341
##    .F1      (.40.)    0.939    0.083   11.282    0.000    0.939    0.697
##    .F2      (.41.)    0.507    0.058    8.662    0.000    0.507    0.442
##    .F3      (.42.)    0.266    0.041    6.448    0.000    0.266    0.324

6.3.5 结果

首先,我们复现原书289页表9.3的下半部分,结果见表6.3

原书进行数据拟合时,输入的是协方差矩阵;而我们输入的是原始数据,这造成部分拟合指数不一样。不过卡方值和自由度一致就可以了。

get_fit <- function(my_fit){
  fitness <- fitmeasures(my_fit)[c('chisq', 'df', 'rmsea','nnfi', 'nfi', 'cfi', 'gfi', 'pvalue')]
  split(fitness, names(fitness))
}

nest_models <- list(
  模型一 = mod1_fit,
  模型二 = mod2_fit,
  模型三 = mod3_fit,
  模型四 = mod4_fit
)

map_dfr(nest_models, .f = get_fit, .id = "Model") |>
  mutate(Delta_chisq = chisq - lag(chisq),
         Delta_df = df - lag(df),
         across(where(is.numeric), ~round(., 3))) |>
  select(Model, chisq, Delta_chisq, df, Delta_df, pvalue, rmsea, nnfi, cfi, gfi) |>
  knitr::kable(caption = "阶段二的拟合度评估") 
Table 6.3: 阶段二的拟合度评估
Model chisq Delta_chisq df Delta_df pvalue rmsea nnfi cfi gfi
模型一 413.391 NA 240 NA 0 0.068 0.918 0.936 0.983
模型二 448.511 35.120 258 18 0 0.069 0.916 0.929 0.981
模型三 481.176 32.665 276 18 0 0.069 0.915 0.924 0.980
模型四 522.269 41.093 291 15 0 0.071 0.910 0.914 0.978

我们对模型二和模型一间的差异进行检验。可以看到,二者的拟合程度存在显著差异,也就是增加了因素载荷的限制之后,模型的拟合度降低了。研究者应该停止进一步的恒等性检验,就两个样本的因素载荷的数值内容进行讨论。

anova(mod1_fit, mod2_fit)
## 
## Chi-Squared Difference Test
## 
##           Df   AIC   BIC  Chisq Chisq diff    RMSEA Df diff Pr(>Chisq)   
## mod1_fit 240 13585 14102 413.39                                          
## mod2_fit 258 13584 14033 448.51      35.12 0.078081      18    0.00913 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

进一步说,研究者应该找到两套参数数值,分别计算男性和女性工作者的得分,从而更有效的反应两个性别的测量结构。