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

Support sequential data generation with Lavaan model specification #23

Closed
mronkko opened this issue Nov 8, 2014 · 1 comment
Closed

Comments

@mronkko
Copy link
Contributor

mronkko commented Nov 8, 2014

This code illustrates the problem

library(simsem)

MODEL <- "
A =~ .8*a1 + .7*a2 + .6*a3
a1~~(1-.8^2)*a1
a2~~(1-.7^2)*a2
a3~~(1-.6^2)*a3
A~~1*A
B =~ .8*b1 + .7*b2 + .6*b3
b1~~(1-.8^2)*b1
b2~~(1-.7^2)*b2
b3~~(1-.6^2)*b3
B ~ .3*A
B~~(1-.3^2)*B
"
d1 <- sim(nRep = 1, MODEL, 100, dataOnly = TRUE, sequential = TRUE,
          saveLatentVar = TRUE)

attributes(d1[[1]])

I requested sequential data generation and saving of latent variable scores. However, the scores are not saved. The reason for this seems to be that data generation was done with lavaan, which does not use LV scores. I think that SimSem should print a warning that sequential data generation cannot be used with lavaan templates or alternatively to convert the lavaan model to a simsem template internally (see #22)

@psunthud
Copy link
Member

Yes, the sequential feature does not support with the lavaan script. I have made the error message if requested. I will discuss the model.lavaan function in #22

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