Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninformative Error in compRelSEM with multiple factors and ordered data #130

Closed
juliuspfadt opened this issue Sep 21, 2023 · 6 comments
Closed

Comments

@juliuspfadt
Copy link

juliuspfadt commented Sep 21, 2023

With the following data
shortUpps.csv
and this code:

library(lavaan)

data <- read.csv("shortUpps.csv", sep = ";")
data <- data[complete.cases(data), ]

model <- "f1 =~ U17_r + U22_r + U29_r + U34_r
f2 =~ U4 + U14 + U19 + U27"

fit1 <- cfa(model, data, ordered = TRUE, std.lv = TRUE)
semTools::compRelSEM(fit1, tau.eq = FALSE, return.total = TRUE, ord.scale = TRUE)

I get the error: Error in diag(scales) %*% truevar : non-conformable arguments

It does not happen with a single factor:

model2 <- "f1 =~ U17_r + U22_r + U29_r + U34_r"

fit2 <- cfa(model2, data, ordered = TRUE, std.lv = TRUE)
semTools::compRelSEM(fit2, tau.eq = FALSE, return.total = TRUE, ord.scale = TRUE)

Given that the loadings and residuals are all there, and lavaan does not throw any warnings, I wonder what is going wrong?

@TDJorgensen
Copy link
Member

This example works fine in the GitHub version, so I must have already fixed that bug.

remotes::install_github("simsem/semTools/semTools")

I have some work to do getting semTools ready for CRAN, but that update should resolve the problem in JASP too.

@juliuspfadt
Copy link
Author

Thanks for the swift reply. You are right, it is fixed. Thanks :)

@juliuspfadt
Copy link
Author

Hi @TDJorgensen are there any news in regards to a CRAN version that contains the fix. Usually the JASP developers only allow CRAN packages so I can't really use your GitHub version.

@TDJorgensen
Copy link
Member

I'm working on it, but this has to happen in coordination with sending the new lavaan.mi package to CRAN. I know this has been a long time in the works, but it has been a much larger set of updates than I anticipated. I have one more feature to implement in semTools before sending to CRAN, which I need for a workshop I will teach this summer. Other deadlines just keep interrupting...

@juliuspfadt
Copy link
Author

Alright, thanks for clarifying.

@tomtomme
Copy link

@TDJorgensen
Any news on the situation regarding a CRAN-Version of this package? Would be cool if we could report this as fixed for the upcoming JASP version 0.20 (possibly 1.0) in some months. Thx for the effort!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants