#Invariance testing
syntax.config <- measEq.syntax(configural.model = mft_fact, data=mft_dat, parameterization="theta",
ID.fac="std.lv", ID.cat = "Wu.Estabrook.2016", group = g1)
cat(as.character(syntax.config))
summary(syntax.config)
## threshold invariance
syntax.thresh <- measEq.syntax(configural.model = mft_fact, data = mft_dat,
parameterization = "theta",
ID.fac = "std.lv", ID.cat = "Wu.Estabrook.2016",
group = g1, group.equal = "thresholds",
long.equal = "thresholds")
## notice that constraining 4 thresholds allows intercepts and residual
## variances to be freely estimated in all but the first group & occasion
cat(as.character(syntax.thresh))
## print a summary of model features
summary(syntax.thresh)
## Fit a model to the data either in a subsequent step:
mod.config <- as.character(syntax.config)
fit.config <- cfa(mod.config, data = mft_dat, group = g1,
parameterization = "theta")
## or in a single step:
fit.thresh <- measEq.syntax(configural.model = mft_fact, data = mft_dat,
parameterization = "theta",
ID.fac = "std.lv", ID.cat = "Wu.Estabrook.2016",
group = g1, group.equal = "thresholds",
long.equal = "thresholds", return.fit = TRUE)
## compare their fit to test threshold invariance
anova(fit.config, fit.thresh)> compareFit(fit.config, fit.thresh, fit.metric, fit.scalar)################### Nested Model Comparison #########################Chi-Squared Difference Test
Df AIC BIC Chisq Chisq diff Df diff Pr(>Chisq) fit.config 32 13887 14256 58.579 fit.thresh 32 13887 14256 58.579 0.000 0 fit.metric 47 13881 14177 82.684 24.105 15 0.06334 . fit.scalar 62 13908 14131 139.644 56.960 15 8.336e-07 ***---Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
####################### Model Fit Indices ########################### chisq df pvalue cfi tli aic bic rmsea srmrfit.config 58.579† 32 .003 .983† .968 13886.745 14256.156 .059 .028†fit.thresh 58.579† 32 .003 .983† .968 13886.745 14256.156 .059 .028†fit.metric 82.684 47 .001 .977 .971† 13880.850† 14177.351 .056† .051 fit.scalar 139.644 62 .000 .951 .952 13907.810 14131.401† .072 .062
################## Differences in Fit Indices ####################### df cfi tli aic bic rmsea srmrfit.thresh - fit.config 0 0.000 0.000 0.000 0.000 0.000 0.000fit.metric - fit.thresh 15 -0.006 0.003 -5.895 -78.805 -0.003 0.023fit.scalar - fit.metric 15 -0.027 -0.019 26.960 -45.950 0.016 0.011
Warning message:In (function (object, ..., method = "default", A.method = "delta", : lavaan WARNING: some models have the same degrees of freedom--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/d4e65cf2-e7b1-426e-8158-55c98f63eef3%40googlegroups.com.
When I run the syntax, the "fit.config" and "fit.thresh" are always the same and I get an error message indicating that some models "have the same degrees of freedom."
--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/d7c76838-a78d-4ed0-9a27-c1cdabb1e134%40googlegroups.com.
cpa <- '
cpa =~ Q1_2 + Q1_8 + Q2_2 + Q3_2 + Q4_2 + Q5_2
'
Chi-Squared Difference Test
Df AIC BIC Chisq Chisq diff Df diff Pr(>Chisq) fit.config 36 15477 15827 46.739 fit.thresh 36 15477 15827 46.739 0.000 0 fit.metric 51 15473 15750 72.645 25.905 15 0.0390291 * fit.scalar 66 15486 15690 115.471 42.826 15 0.0001675 ***I'm not sure what you mean by "categories." ... each indicator has 5 response options