Hi everyone!
Does anyone here have experience with adding time-invariant predictors (such as dummy variable for treatment condition) at the within-level in LCM-SR models?
Someone has suggested the following to me: just adding the predictor on the residuals along with the cross-lags (the red is the predictor added as constrained over time (the syntax is from Curran et al., 2014):
# DEPRESSION
sdep2 ~ p3*sdep1 + p5*salc1 + p6*x
sdep3 ~ p3*sdep2 + p5*salc2 + p6*x
sdep4 ~ p3*sdep3 + p5*salc3s + p6*x
sdep5 ~ p3*sdep4 + p5*salc4 + p6*x
I have also seen the following syntax (From an article Orth et al., 2021), where they do something similar, adding the predictor as constrained over time :
#### LCM-SR (tic as constant effect)
####
lcmsr_tic.mod <- '
# Define intercept and growth factors
ix =~ 1*sat6.1 + 1*sat6.2 + 1*sat6.3 + 1*sat6.4
iy =~ 1*log_inc.1 + 1*log_inc.2 + 1*log_inc.3 + 1*log_inc.4
sx =~ 0*sat6.1 + 1*sat6.2 + 2*sat6.3 + 3*sat6.4
sy =~ 0*log_inc.1 + 1*log_inc.2 + 2*log_inc.3 + 3*log_inc.4
# Define phantom latent variables
etax1 =~ 1*sat6.1
etax2 =~ 1*sat6.2
etax3 =~ 1*sat6.3
etax4 =~ 1*sat6.4
etay1 =~ 1*log_inc.1
etay2 =~ 1*log_inc.2
etay3 =~ 1*log_inc.3
etay4 =~ 1*log_inc.4
# Autoregressive effects
etax2 ~ a1*etax1
etax3 ~ a1*etax2
etax4 ~ a1*etax3
etay2 ~ a2*etay1
etay3 ~ a2*etay2
etay4 ~ a2*etay3
# Crosslagged effects
etay2 ~ c1*etax1
etay3 ~ c1*etax2
etay4 ~ c1*etax3
etax2 ~ c2*etay1
etax3 ~ c2*etay2
etax4 ~ c2*etay3
# Some further constraints on the variance structure
# 1. Set error variances of the observed variables to zero
sat6.1 ~~ 0*sat6.1
sat6.2 ~~ 0*sat6.2
sat6.3 ~~ 0*sat6.3
sat6.4 ~~ 0*sat6.4
log_inc.1 ~~ 0*log_inc.1
log_inc.2 ~~ 0*log_inc.2
log_inc.3 ~~ 0*log_inc.3
log_inc.4 ~~ 0*log_inc.4
# 2. Let lavaan estimate the variance of the latent variables
etax1 ~~ varx1*etax1
etax2 ~~ varx2*etax2
etax3 ~~ varx3*etax3
etax4 ~~ varx4*etax4
etay1 ~~ vary1*etay1
etay2 ~~ vary2*etay2
etay3 ~~ vary3*etay3
etay4 ~~ vary4*etay4
# 3. We also want estimates of the intercept factor variances, the slope
# variances and the different covariances
ix ~~ varix*ix
iy ~~ variy*iy
sx ~~ varsx*sx
sy ~~ varsy*sy
ix ~~ covi*iy
ix ~~ covixsx*sx
ix ~~ covixsy*sy
iy ~~ coviysx*sx
iy ~~ coviysy*sy
sx ~~ covs*sy
# 4. We have to define that the covariance between the intercepts and
# the slopes and the latents of the first time point are zero
etax1 ~~ 0*ix
etay1 ~~ 0*ix
etax1 ~~ 0*sx
etay1 ~~ 0*sx
etax1 ~~ 0*iy
etay1 ~~ 0*iy
etax1 ~~ 0*sy
etay1 ~~ 0*sy
# 5. Finally, we estimate the covariance between the latents of x and y
# of the first time point, the second time-point and so on. note that
# for the second to fourth time point the correlation is constrained to
# the same value
etax1 ~~ cov1*etay1
etax2 ~~ cove*etay2
etax3 ~~ cove*etay3
etax4 ~~ cove*etay4
# The model also contains a mean structure and we have to define some
# constraints for this part of the model. we estimate the interecepts
# of the time point-specific manifest variable and constrain the
# mean of the intercept and slope factors to 0
sat6.1 ~ 0*1
sat6.2 ~ 0*1
sat6.3 ~ 0*1
sat6.4 ~ 0*1
log_inc.1 ~ 0*1
log_inc.2 ~ 0*1
log_inc.3 ~ 0*1
log_inc.4 ~ 0*1
etax1 ~ 0*1
etax2 ~ 0*1
etax3 ~ 0*1
etax4 ~ 0*1
etay1 ~ 0*1
etay2 ~ 0*1
etay3 ~ 0*1
etay4 ~ 0*1
ix ~ 1
iy ~ 1
sx ~ 1
sy ~ 1
# incorporating tic
etax1 + etax2 + etax3 + etax4 ~ ticx*sex_gen
etay1 + etay2 + etay3 + etay4 ~ ticy*sex_gen
sex_gen ~~ sex_gen
# define correlations for CI
cori := covi / (sqrt(varix) * sqrt(variy))
cors := covs / (sqrt(varsx) * sqrt(varsy))
corixsx := covixsx / (sqrt(varix) * sqrt(varsx))
corixsy := covixsy / (sqrt(varix) * sqrt(varsy))
coriysx := coviysx / (sqrt(variy) * sqrt(varsx))
coriysy := covixsx / (sqrt(variy) * sqrt(varsy))
cort1 := cov1 / (sqrt(varx1) * sqrt(vary1))
cort2 := cove / (sqrt(varx2) * sqrt(vary2))
cort3 := cove / (sqrt(varx3) * sqrt(vary4))
cort4 := cove / (sqrt(varx4) * sqrt(vary4))
'
lcmsr_tic.fit <- sem(lcmsr_tic.mod, missing = "fiml", data = pf, verbose = T)
capture.output(summary(lcmsr_tic.fit, fit.measures = T, std = T, ci = T), file = "./results/TIC/LCM-SR.txt")
My questions are: these two ways of adding TICs to within-level in LCM-SR are slightly different, where the syntax from Orth includes a covariance specification between the TIC "sex_gen ~~ sex_gen". So the two different ways of adding the predictor in my case, gives slightly different results. Can anyone explain what the difference between these two approaches mean?
AND: In my study the predictor I want to add at the within-patient level is a dummy variable for treatment condition. The LCM-SR model is built so that it investigates 3 variables: emotional clarity, rumination and symptom distress. So before I add treatment condition here is my syntax for the cross-lagged effects:
# RUM #
sRUM2 ~ p2*sRUM1 + p4*sPHQ_ADS2 + p7*sUA1
sRUM3 ~ p2*sRUM2 + p4*sPHQ_ADS3 + p7*sUA2
sRUM4 ~ p2*sRUM3 + p4*sPHQ_ADS4 + p7*sUA3
sRUM5 ~ p2*sRUM4 + p4*sPHQ_ADS5 + p7*sUA4
sRUM6 ~ p2*sRUM5 + p4*sPHQ_ADS6 + p7*sUA5
sRUM7 ~ p2*sRUM6 + p4*sPHQ_ADS7 + p7*sUA6
sRUM8 ~ p2*sRUM7 + p4*sPHQ_ADS8 + p7*sUA7
sRUM9 ~ p2*sRUM8 + p4*sPHQ_ADS9 + p7*sUA8
sRUM10 ~ p2*sRUM9 + p4*sPHQ_ADS10 + p7*sUA9
sRUM11 ~ p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 p1*sUA11 + p9*sRUM11 + p8*sPHQ_ADS12
What I really want to find out is whether treatment condition interacts with pathways of these variables. For instance, I wonder whether rumination is predictive of symptom distress only in one of the treatment conditions. Looking at my output (when I add the predictor at the within-level) I am uncertain whether this way of adding the predictor is the right way (i.e I am not sure the output can tell me about the things I want to know). So question 2 would be: how do we interpret the results of a dummy variable which does not change over measurement time-points when we add it to the within-level/structured residuals?
And last questions: I have seen debates regarding random intercept models where people suggest to add such predictors only at the between level (slope and intercept). Do anyone have opinions on what is appropriate in this case?
ANY thoughts/input on (or experience with) how to handle predictors at within-level/between-level in LCM-SR are very welcome :)
Ingvild