CFA syntax check // longitudinal data

86 views
Skip to first unread message

Eva Neumeyer

unread,
Nov 29, 2019, 4:16:39 AM11/29/19
to lavaan
Hello together,

I'm trying to run a CFA including four factors. Two of them are measured at Time 1 and Time 2: H1 and H2; T1 and T2.

I'm just wondering if I'm doing the syntax correctly or if there is anything important missing?

CFA_model <- '
H1=~ H1_phys_total_raw+H1_ment_total_raw
H2 =~ H2_phys_total_raw+H2_ment_total_raw

teamdistribution =~ DV02_01+DV02_02+DV02_03+DV02_04
workplacemobility =~ DV02_05+DV02_06+DV02_07+DV02_08+DV02_09
varietyofpractices =~ DV02_10+DV02_11+DV02_12
DV1 =~ teamdistribution+workplacemobility+varietyofpractices

task =~ SL01_01+SL01_02+SL01_03+SL01_04+SL01_05
relation =~ SL01_06+SL01_07+SL01_08+SL01_09+SL01_10
change =~ SL01_11+SL01_12+SL01_13+SL01_14+SL01_15
micropolitical =~ SL01_16+SL01_17+SL01_18+SL01_19+SL01_20
SL1 =~ task+relation+change+micropolitical

T1 =~ T102_01+T102_02+T102_03+T102_04+T102_05+T102_06+T102_07+T102_08
T2 =~ T202_01+T202_02+T202_03+T202_04+T202_05+T202_06+T202_07+T202_08

H1 ~~ H2
H1_phys_total_raw ~~ H2_phys_total_raw
H1_ment_total_raw ~~ H2_ment_total_raw
T1 ~~ T2
T102_01 ~~ T202_01
T102_02 ~~ T202_02
T102_03 ~~ T202_03
T102_04 ~~ T202_04
T102_05 ~~ T202_05
T102_06 ~~ T202_06
T102_07 ~~ T202_07
T102_08 ~~ T202_08'

fitCFA_model <- cfa(CFA_model, data=masterarbeit, estimator = "MLR", missing = "fiml", meanstructure=TRUE, std.lv=TRUE, check.gradient = FALSE)
summary(fitCFA_model, fit.measure=TRUE, standardized=TRUE, rsquare=TRUE)

The model runs and the model fit is not bad but I get two warnings:

Warning messages:
1: In lav_model_vcov(lavmodel = lavmodel2, lavsamplestats = lavsamplestats,  :
  lavaan WARNING:
    The variance-covariance matrix of the estimated parameters (vcov)
    does not appear to be positive definite! The smallest eigenvalue
    (= -5.371974e-14) is smaller than zero. This may be a symptom that
    the model is not identified.
2: In lav_object_post_check(object) :
  lavaan WARNING: covariance matrix of latent variables
                is not positive definite;
                use lavInspect(fit, "cov.lv") to investigate.


Another questions I ask myself is: Is it useful to include the H1 AND H2 // T1 AND T2 variable in the model? Or would it be more appropriate to leave Time 2 variables out like in the following?

CFA_modelt1 <- '
H1 =~ H1_phys_total_raw+H1_ment_total_raw

teamdistribution =~ DV02_01+DV02_02+DV02_03+DV02_04
workplacemobility =~ DV02_05+DV02_06+DV02_07+DV02_08+DV02_09
varietyofpractices =~ DV02_10+DV02_11+DV02_12
DV1 =~ teamdistribution+workplacemobility+varietyofpractices

task =~ SL01_01+SL01_02+SL01_03+SL01_04+SL01_05
relation =~ SL01_06+SL01_07+SL01_08+SL01_09+SL01_10
change =~ SL01_11+SL01_12+SL01_13+SL01_14+SL01_15
micropolitical =~ SL01_16+SL01_17+SL01_18+SL01_19+SL01_20
SL1 =~ task+relation+change+micropolitical

T1=~T102_01+T102_02+T102_03+T102_04+T102_05+T102_06+T102_07+T102_08'

fitCFA_modelt1 <- cfa(CFA_modelt1, data=masterarbeit, estimator = "MLR", missing = "fiml", meanstructure=TRUE, std.lv=TRUE, check.gradient = FALSE)
summary(fitCFA_modelt1, fit.measure=TRUE, standardized=TRUE, rsquare=TRUE)

Fit indices are nearly the same and the warning messages are gone.

Thank you for your help!! :)

Eva Neumeyer

unread,
Dec 12, 2019, 5:38:48 AM12/12/19
to lavaan

Hi everyone,

I now tried to use estimator WLSMV because my variables are measured with likert scale.

But then no standard errors are computed, but fit indices are a lot better!

Do you have any suggestions how to deal with it?

Thank you in advance!
Reply all
Reply to author
Forward
0 new messages