Trying to run some examples that were working as of 4f3e2bd9b4a17c8325274ac02e2155f163fc4b97 but now fail with the message:
Error in (function (nPermute, modelType, con, uncon, null, param, freeParam, :
con@Data@data.type != "full" is not TRUE
Here's the code:
library("lavaan")
library("semTools")
## create 3-group data in lavaan example(cfa) data
HS <- lavaan::HolzingerSwineford1939
HS$ageGroup <- ifelse(HS$ageyr < 13, "preteen",
ifelse(HS$ageyr > 13, "teen", "thirteen"))
## fit target model with varying levels of measurement equivalence
mod.config <- '
visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9
'
fit.config <- cfa(mod.config, data = HS, std.lv = TRUE, group = "ageGroup")
####################### Permutation Method
## fit indices of interest for multiparameter omnibus test
myAFIs <- c("chisq","cfi","rmsea","mfi","aic")
moreAFIs <- c("gammaHat","adjGammaHat")
## Use only 20 permutations for a demo. In practice,
## use > 1000 to reduce sampling variability of estimated p values
## test configural invariance
set.seed(12345)
print(fit.config@Data@data.type)
out.config <- permuteMeasEq(nPermute = 20, con = fit.config)
Trying to run some examples that were working as of 4f3e2bd9b4a17c8325274ac02e2155f163fc4b97 but now fail with the message:
Here's the code:
Looking at commit b8af51e the message says "check @DaTa$data.type=="full" before permuting" but it looks like the code is checking the opposite: https://github.com/simsem/semTools/blob/7e646e4e46b633eb573b0dae9a4a40b5439d16bf/semTools/R/permuteMeasEq.R#L1148-L1157