Dear Marcus,
thank you, that has already taken me a step further! Now, my model specification looks like this:
### Prepare Data (e.g., standardize and flip to the expected direction)
data_CFA <- subset(data, select=c(AAT_bias_smoking, IAT_app_av_score, IAT_val_score, EMGcorr_score, EMGzygo_score, EMGstartle_score, ACC, lAG, rThal, rStriatum, lSTG))
data_CFA <- as.data.frame(apply(data_CFA, 2, scale)) # apply scale to all columns to centralize and standardize: mean = 0 & SD = 1
# higher scores mean higher sensitization in all measures
data_CFA$EMGcorr_score <- data_CFA$EMGcorr_score * (-1)
data_CFA$EMGstartle_score <- data_CFA$EMGstartle_score * (-1)
data_CFA$lSTG <- data_CFA$lSTG * (-1)
CFAmodel <- '# measurement model
cognitivebehavioral =~ AAT_bias_smoking + IAT_app_av_score + IAT_val_score
EMG =~ EMGcorr_score + EMGzygo_score + EMGstartle_score
fMRI =~ ACC + lAG + rThal + rStriatum + lSTG
sensitization =~ cognitivebehavioral + EMG + fMRI
# structural model
ACC ~~ lAG
ACC ~~ rThal
ACC ~~ rStriatum
ACC ~~ lSTG
lAG ~~ rThal
lAG ~~ rStriatum
lAG ~~ lSTG
rThal ~~ rStriatum
rThal ~~ lSTG
rStriatum ~~ lSTG
IAT_app_av_score ~~ IAT_val_score
EMGcorr_score ~~ EMGzygo_score
EMGcorr_score ~~ EMGstartle_score
EMGstartle_score ~~ EMGzygo_score '
CFAmodel_a <- cfa(CFAmodel, data_CFA, estimator = "MLR", missing = "FIML",
std.lv = TRUE) # adressing missing values and skewed data
summary(CFAmodel_a, fit.measures = TRUE, standardized=TRUE)
I added covariances between measures which were collected within the same task, since they should share a certain amount of variance.
However, again, I run into many warning messages... (also without the added covariances)
Warning messages:
1: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats, :
lavaan WARNING:
The variance-covariance matrix of the estimated parameters (vcov)
does not appear to be positive definite! The smallest eigenvalue
(= -6.731629e-04) is smaller than zero. This may be a symptom that
the model is not identified.
2: In lav_object_post_check(object) :
lavaan WARNING: some estimated ov variances are negative
The problem is, that simplifying the model (e.g., consider only two factors) would mean that I can not answer my research questions, whether all measures share an underlying mechanism (i.e., sensitization).
Does anyone has a tip how to deals with this issues?
Best,
Franziska