I used ID.fac = "UV" and manually freed latent variable means when generating syntax (by replacing zeroes with NAs in the "## LATENT MEANS/INTERCEPTS:" portion of the syntax).
Thanks for your reply, Terrence. I will run the models without altering the syntax (until the constraints you mention are applied).
--
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+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/d526d136-b8d1-49d7-9304-3033d1eda25c%40googlegroups.com.
Is the SRMR recommended for a model comparison or should I trust p-values from other coefficients?
Error in A %*% P.inv : requires numeric/complex matrix/vector arguments
fit.config <- measEq.syntax(configural.model = bifactor.model, data = CFA, ordered = TRUE, parameterization = "theta", estimator = "WLSMV", ID.fac = "UV", ID.cat = "Wu.Estabrook.2016", group = "Gender", return.fit = TRUE)
fit.thresh <- measEq.syntax(configural.model = bifactor.model, data = CFA, ordered = TRUE, parameterization = "theta", estimator = "WLSMV", ID.fac = "UV", ID.cat = "Wu.Estabrook.2016", group = "Gender", group.equal = "thresholds", return.fit = TRUE)
out.thresh <- permuteMeasEq(nPermute = 1000, uncon = fit.config, con = fit.thresh, param = "thresholds", AFIs = myAFIs, moreAFIs = moreAFIs, null = fit.null, parallelType = "none", iseed = 3141593)
I wonder what's happening here.
mod.cat <- ' FU1 =~ u1 + u2 + u3 + u4
FU2 =~ u5 + u6 + u7 + u8 '
## configural model: no constraints across groups or repeated measures
syntax.config <- measEq.syntax(configural.model = mod.cat, data = datCat,
ordered = paste0("u", 1:8),
parameterization = "theta",
ID.fac = "std.lv", ID.cat = "Wu.Estabrook.2016",
group = "g")
mod.config <- as.character(syntax.config)
fit.config <- cfa(mod.config, data = datCat, group = "g",
ordered = paste0("u", 1:8), parameterization = "theta")
## equal thresholds
fit.thresh <- measEq.syntax(configural.model = mod.cat, data = datCat,
ordered = paste0("u", 1:8),
parameterization = "theta",
ID.fac = "std.lv", ID.cat = "Wu.Estabrook.2016",
group = "g", group.equal = "thresholds",
return.fit = TRUE)
myAFIs <- c("chisq","chisq.scaled","df","cfi.scaled","tli.scaled","rmsea.scaled","srmr")
out.thresh <- permuteMeasEq(nPermute = 10, uncon = fit.config, con = fit.thresh,
param = "thresholds", AFIs = myAFIs, moreAFIs = NULL)
summary(out.thresh)
Again, I do not encounter the error during the other steps of measurement invariance testing.
mod.cat
(as is necessary in my applied case). Unfortunately, the model did not converge when using the datCat
dataset, so I found a reproducible dataset with a bifactor structure here. After importing it, I added a column for gender, and renamed it datCat
. When I then ran a version of your code, I still got the requires numeric/complex matrix/vector arguments error. ## configural model: no constraints across groups or repeated measures
## equal thresholds
1: In lav_model_vcov(lavmodel = lavmodel2, lavsamplestats = lavsamplestats, ... :
lavaan WARNING:
The variance-covariance matrix of the estimated parameters (vcov)
does not appear to be positive definite! The smallest eigenvalue
(= 2.902788e-14) is close to zero. This may be a symptom that the
model is not identified.