การเปรียบเทียบโมเดล

Structural Equation Modeling ด้วย lavaan ใน R

Erin Buchanan

Professor

สร้างสองโมเดล

twofactor.model <- 'visual =~ x1 + x2 + x3 
                        speed =~ x7 + x8 + x9'
twofactor.model1 <- 'visual =~ x1 + x2 + x3 
                        speed =~ x7 + x8 + x9
                        x7 ~~ x8'
twofactor.fit <- cfa(model = twofactor.model,
                     data = HolzingerSwineford1939)
twofactor.fit1 <- cfa(model = twofactor.model1,
                     data = HolzingerSwineford1939)
Structural Equation Modeling ด้วย lavaan ใน R

การเปรียบเทียบ Chi-Square

anova(twofactor.fit, twofactor.fit1)
Chi Square Difference Test

               Df    AIC    BIC  Chisq Chisq diff Df diff    Pr(>Chisq)    
twofactor.fit1  7 5150.5 5202.4 14.753                                     
twofactor.fit   8 5181.2 5229.4 47.413     32.661       1 0.00000001097 ***

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 . 0.1 ' ' 1
  • ค่า Chi-square difference ได้จากการลบค่าระหว่างโมเดล
  • ต้องเพิ่มขึ้นอย่างน้อย 3.84 จึงจะมีนัยสำคัญที่ p < .05
  • ใช้ได้เฉพาะโมเดลที่มีตัวแปรชุดเดียวกัน
Structural Equation Modeling ด้วย lavaan ใน R

การเปรียบเทียบ Fit Index

  • เปรียบเทียบ fit index สำหรับโมเดลที่ไม่ซ้อนกัน
  • ดู fit index เพิ่มเติมด้วย fitmeasures()
fitmeasures(twofactor.fit)
                aic                 bic              ntotal 
           5181.168            5229.361             301.000 
               bic2               rmsea      rmsea.ci.lower 
           5188.132               0.128               0.094 
     rmsea.ci.upper        rmsea.pvalue                 rmr 
              0.164               0.000               0.096
                                _ _ _
Structural Equation Modeling ด้วย lavaan ใน R

การเปรียบเทียบ Fit Index

fitmeasures(twofactor.fit, c("aic", "ecvi"))
     aic     ecvi 
5181.168    0.244 
fitmeasures(twofactor.fit1, c("aic", "ecvi"))
     aic     ecvi 
5150.508    0.142 
Structural Equation Modeling ด้วย lavaan ใน R

มาฝึกกันเถอะ!

Structural Equation Modeling ด้วย lavaan ใน R

Preparing Video For Download...