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

Combining Continuous and Categorical Indicators in LCA #103

Open
linem7 opened this issue Sep 9, 2024 · 3 comments
Open

Combining Continuous and Categorical Indicators in LCA #103

linem7 opened this issue Sep 9, 2024 · 3 comments

Comments

@linem7
Copy link

linem7 commented Sep 9, 2024

Dear Dr. Van Lissa,

I’ve been using the tidySEM package, following recommendations from your paper, "Recommended Practices in Latent Class Analysis Using the Open-Source R-Package tidySEM", to conduct my study. However, I’ve encountered a situation where my latent class analysis model includes both continuous and categorical indicators. Since this scenario wasn't explicitly covered in the paper, I’m wondering if it’s possible to handle such a model using the tidySEM package.

Could you please advise if tidySEM supports models with both continuous and categorical indicators, or if I should consider alternative approaches (e.g., using Mplus) to address this issue?

Thank you for your assistance!

Best,
Lin

@cjvanlissa
Copy link
Owner

Dear Lin,

in theory, this is possible - in practice, I've had severe convergence issues with this setup. You might be able to get it to work, but I'm not able to devote time to it right now.

@linem7
Copy link
Author

linem7 commented Sep 10, 2024

Dear Dr. Van Lissa,

Thank you so much for your quick response! I truly appreciate your insights. As I’m not confident that I can resolve this issue on my own, I will likely proceed with the Mplus approach for now. If I do manage to find a solution, I’d be honored to share it with you.

Your paper has been incredibly helpful for my research, and I’m very grateful for the guidance you’ve provided. Thank you once again for your support!

Best regards,
Lin

@cjvanlissa
Copy link
Owner

Dear Lin,

you can give it a try, the model is not hard to specify using lavaan syntax. E.g.:

library(tidySEM)
dat <- read.table("https://www.statmodel.com/usersguide/chap7/ex7.12.dat")
dat[[6]] <- NULL
df <- dat
df[1:4] <- lapply(df[1:4], factor)
df <- mx_dummies(df)
df[grep("c0", names(df))] <- NULL
names(df) <- gsub(".c1", "", names(df))

res <- mx_mixture(model =
"V5 ~ m{C}*1
V5 ~~ varV5*V5
V1 | t1{C}
V2 | t2{C}
V3 | t3{C}
V4 | t4{C}", classes = 2, data = df, run = TRUE)

table_fit(res)

You can also send me your code + data for a double-check; my university email is in the package documentation.

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

2 participants