Counterintuitive discrepancy in cross-correlation signs between ctsem and lme4 #68
-
|
Dear all, I fitted a cross-lagged models with two latent variables in ctsem to assess the cross-correlations over time. One variable measured affect (higher values mean better mood) and one variable measured difficulties in emotion regulation (higher values mean more difficulties). Weirdly the cross-correlations have a counterintuitive sign, where better mood leads to more emotion regulation problems; and more emotion regulation problems lead to better mood. Both variables are correctly coded. I also fitted a lagged model with nlme4, where the cross-correlation has the expected sign. I would really appreciate some ideas concerning this phenomenon! I could imagine I am not understanding something fundamental about ctsem. Below is my ctsem and nlme code with some outputs. Best wishes, persModel_ct_td <- ctModel(type = "ct",
n.latent = 2, # only affect and SDERS now
n.manifest = 2,
n.TDpred = 1,
manifestNames = c("affect_valence_scaled", "SDERS_Total_scaled"),
latentNames = c("affect", "SDERS"),
TDpredNames = "Stressors_scaled",
LAMBDA = diag(2), # identity matrix for manifest-latent mapping
DRIFT = matrix(c(
"drift_Affect_Affect", "drift_Regulation_Affect",
"drift_Affect_Regulation","drift_Regulation_Regulation"
), 2, 2, byrow = TRUE)
)
persModel_ct_fit2 <- ctStanFit(datalong=df,
ctstanmodel=persModel_ct_td)
ctStanDiscretePars(persModel_ct_fit2, plot=TRUE, indices = 'CR', times = seq(from=0, to=48, by = 1))Here is my nlme code, where I focused on the correlation of SDERS (emotion regulation problems) on affect at the next time point (lagged backwards). The predictors are person-mean centered. As I understood ctsem, it takes care of this by modelling a person-wise intercept per default. The distance between measurements was approximately 1-3 hours. persModel <- lme(data=df, AFFECT_ESM_X_lag_minus1 ~ affect_valence_PMcen_scaled*S.DERS_Total_PMcen_scaled,
random = list(PARTICIPANT_ID =~ 1, DayInd =~1), na.action = "na.exclude", control=lmeControl(msMaxIter = 100, opt = "optim")) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
This is exceptionally common. Cross-effects are extremely sensitive to the rest of the model specification. ctsem includes random intercepts by default, as well as measurement error and correlated random fluctuations. Ignoring any of these can dramatically bias estimates, and as far as I'm aware no other software estimates all of these by default (which is not to say that ctsem is 'correct', but hopefully less wrong by default). with nlme I assume there is no measurement error or random fluctuations considered. You probably also want to consider the random correlation to show it's influence in your temporal effect plots: For more on flipping signs, difficult inference etc under observational conditions, see these two: |
Beta Was this translation helpful? Give feedback.


This is exceptionally common. Cross-effects are extremely sensitive to the rest of the model specification. ctsem includes random intercepts by default, as well as measurement error and correlated random fluctuations. Ignoring any of these can dramatically bias estimates, and as far as I'm aware no other software estimates all of these by default (which is not to say that ctsem is 'correct', but hopefully less wrong by default). with nlme I assume there is no measurement error or random fluctuations considered. You probably also want to consider the random correlation to show it's influence in your temporal effect plots: