Simulate Data From CFA with regression between Latent Factors

43 views
Skip to first unread message

Chiel Mues

unread,
Feb 25, 2020, 12:13:22 PM2/25/20
to lavaan
Hello,

I would like to simulate data from a CFA (well technically it would be a SEM I suppose) where the latent variables follow a prespecified relationship.

sim_model <- '
V1 =~ X1 + X2 + X3 + X4
V2 =~ X5 + X6 + X7 + X8
V2 ~ abs(V1)'

Put in words, I would like to simulate from a SEM where V2 is regressed on the absolute value of V1. Preferably also assuming categorical variables.

Is this possible?

jpma...@gmail.com

unread,
Feb 25, 2020, 12:57:22 PM2/25/20
to lav...@googlegroups.com

Hi Chiel,

Yes, it is. It is this easy:

 

set.seed(123)

pop.data <- simulateData(model=sim_model, standardized = TRUE, sample.nobs=10^5, skewness = 0, kurtosis = 0)

 

see the simulateData function…

 

best,

João Marôco

--
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/9505dce7-3774-4f95-a3ef-1f4cfdbab3ef%40googlegroups.com.

Chiel

unread,
Feb 25, 2020, 1:02:02 PM2/25/20
to lav...@googlegroups.com
I know about this function, but V2 ~ abs(V1) is not syntax Lavaan accepts. 

You received this message because you are subscribed to a topic in the Google Groups "lavaan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lavaan/VrnacPvgCcs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lavaan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/003901d5ec05%2406cf05c0%24146d1140%24%40gmail.com.

Terrence Jorgensen

unread,
Feb 27, 2020, 4:09:21 PM2/27/20
to lavaan
I know about this function, but V2 ~ abs(V1) is not syntax Lavaan accepts. 

lavaan (and most SEM software) only model linear effects.  

Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Reply all
Reply to author
Forward
0 new messages