CTSEM emulation in lavaan problems #63
-
|
I was trying to get a better understanding of how ctsem works at its most basic level by emulating it in lavaan. I thought this would be fairly simple, since my fictional model was 2 variables and two time points with varying interval sizes, meaning that a lot of more complicated functions would be of no importance for this model and I expected that I could figure out how the slope in a standard clpm relates to drift for the average time interval between t1 and t2. After failing miserably at this I was hoping to get some support here. I tried entering the exp(Adelta t) formula into the standard regression path, which I then - to account for lavaan's limited capabilities - solved for Adelta t, emulating the typical regression path. That meant that my outcome variable was ln(outcome/predictor). I failed both at the simple attempt of transforming slope into drift (or drift into slope) and the more complicated attempt at emulating drift from a ct-sem by shifting around the variables within the lavaan model. So I am now still left wondering: What am I not understanding? What did I do wrong? Here is my CT-SEM model: ct_data <- sim_data %>% ct_model <- ctModel( This is how I accessed the drift values: ctStanContinuousPars(ct_fit)$DRIFT Here is how I tried to emulate the ct-sem in lavaan: sim_data$AtoA <- log(sim_data$A2 / sim_data$A1) ct_clpm_model <- ' ' The model had trouble converging and I had to heavily increase my fictional sample size to run it, but I still expected somewhat comparable drift and regression estimate values if I had done things correctly. I know it's a weird question, since most people ask about actually using ct-sem, but I feel I have to understand it properly before deciding if I want to use it for my study/studies. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Before I dive into it in any detail, at first glance -- it seems like you might be mistaking the matrix exponential for the univariate exponential, and then likewise the univariate logarithm. The conversion from discrete time to continuous is not 1 to 1, but you can try taking the matrix logarithm of the clpm temporal effects matrix to obtain the continuous time temporal effects, yes. |
Beta Was this translation helpful? Give feedback.
Before I dive into it in any detail, at first glance -- it seems like you might be mistaking the matrix exponential for the univariate exponential, and then likewise the univariate logarithm. The conversion from discrete time to continuous is not 1 to 1, but you can try taking the matrix logarithm of the clpm temporal effects matrix to obtain the continuous time temporal effects, yes.