0

I'm trying to text measurement invariance in a sample with continuous measures, no missing data, and 190 and 208 samples in each group. Whenever I try to test configural invariance I get the following error message:

Error in crossprod(Diff, Sigma.inv) : non-conformable arguments In addition: Warning message: In lavaan::lavaan(model = cfamodel, data = usegrant, group = "RACE_S", : lavaan WARNING: Model estimation FAILED! Returning starting values.

I've copied my code below. I tested the same data in MPlus and was able to run it and get results without issue, but I want to make sure I can get this code to work in R. I've tried quitting and reopening R, updating/uninstalling and reinstalling all the packages and nothing seems to solve the issue. Does anyone have any other ideas to troubleshoot this before I give up and switch to MPlus entirely?

Sample of data: > dput(head(usegrant)) structure(list(...1 = c(1, 2, 3, 5, 6, 7), RACE_3 = c(2, 2, 1, 2, 1, 2), RACE_S = c(2, 2, 1, 2, 1, 2), SOI_01PRE = c(1, 2, 1, 1, 1, 3), SOI_02PRE = c(4, 2, 1, 2, 1, 1), SOI_03PRE = c(3, 2, 1, 2, 1, 2), SOI_04PRE = c(4, 8, 1, 5, 1, 7), SOI_05PRE = c(5, 6, 1, 3, 1, 3), SOI_06PRE = c(5, 5, 1, 7, 1, 3), SOI_07PRE = c(7, 5, 6, 8, 1, 2), SOI_08PRE = c(7, 3, 2, 6, 1, 2), SOI_09PRE = c(6, 5, 2, 8, 1, 2)), row.names = c(NA, -6L), class = c("tbl_df", "tbl", "data.frame"))

grant.model<-'
behavior=~SOI_01PRE+SOI_02PRE+SOI_03PRE
attitude=~SOI_04PRE+SOI_05PRE+SOI_06PRE
desire=~SOI_07PRE+SOI_08PRE+SOI_09PRE
behavior~~attitude
attitude~~desire
desire~~behavior'

cfamodel<-cfa(model = grant.model, data=usegrant)
summary(cfamodel, fit.measures=TRUE, standardized=TRUE)

fit.config<-cfa(cfamodel, data=usegrant, group = "RACE_S")```
  • 1
    Please share some data using `dput(usegrant)`? – Quinten Apr 30 '22 at 15:56
  • > dput(head(usegrant)) structure(list(...1 = c(1, 2, 3, 5, 6, 7), RACE_3 = c(2, 2, 1, 2, 1, 2), RACE_S = c(2, 2, 1, 2, 1, 2), SOI_01PRE = c(1, 2, 1, 1, 1, 3), SOI_02PRE = c(4, 2, 1, 2, 1, 1), SOI_03PRE = c(3, 2, 1, 2, 1, 2), SOI_04PRE = c(4, 8, 1, 5, 1, 7), SOI_05PRE = c(5, 6, 1, 3, 1, 3), SOI_06PRE = c(5, 5, 1, 7, 1, 3), SOI_07PRE = c(7, 5, 6, 8, 1, 2), SOI_08PRE = c(7, 3, 2, 6, 1, 2), SOI_09PRE = c(6, 5, 2, 8, 1, 2)), row.names = c(NA, -6L), class = c("tbl_df", "tbl", "data.frame")) – Christina Gillezeau Apr 30 '22 at 16:29
  • @ChristinaGillezeau, while the top 6 rows clearly show the structure, are not enough to reproduce your error in this case – Andrew Brown Apr 30 '22 at 21:03
  • structure(list(...1 = c(1, 2, 3, 5, 6, 7, 8, 9, 10, 12), RACE_S = c(2, 2, 1, 2, 1, 2, 1, 2, 1, 2), SOI_01PRE = c(1, 2, 1, 1, 1, 3, 4, 1, 2, 1), SOI_02PRE = c(4, 2, 1, 2, 1, 1, 3, 1, 2, 1), SOI_03PRE = c(3, 2, 1, 2, 1, 2, 4, 1, 2, 1), SOI_04PRE = c(4, 8, 1, 5, 1, 7, 6, 1, 5, 5), SOI_05PRE = c(5, 6, 1, 3, 1, 3, 3, 1, 6, 7), SOI_06PRE = c(5, 5, 1, 7, 1, 3, 6, 1, 5, 6), SOI_07PRE = c(7, 5, 6, 8, 1, 2, 4, 4, 8, 6), SOI_08PRE = c(7, 3, 2, 6, 1, 2, 2, 2, 7, 3), SOI_09PRE = c(6, 5, 2, 8, 1, 2, 1, 2, 2, 6)), row.names = c(NA, -10L), class = c("tbl_df", "tbl", "data.frame")) – Christina Gillezeau Apr 30 '22 at 21:52
  • @AndrewBrown I just added the first 10 rows. It's the largest number of rows I can add without going over the character limit, but since it's a large sample technique I don't know that it will be sufficient – Christina Gillezeau Apr 30 '22 at 21:53

0 Answers0