How I can compare three models (nested) using lavaan with R? I want to test a new model, and for doing this, as I only have cross sectional data, I need to compare different models. My model is like this:
Model <- x =~ x1 + x2 + x3
z =~ z1 + z2 + z3 + z4
v =~ v1 + v2 + v3 + v4
h =~ h1 + h2
j =~ j1 + j2 + j3
k =~ k1 + k2 + k3 + k4
y =~ y1 + y2 + y3

v ~ x
h ~ z
j ~ x + z
k ~ x + z

y ~ x + z  + j + k + v + h

I want to compare this whole model with two models made by subdimensions of this whole model, like this:
Model1 <- x =~ x1 + x2 + x3
z =~ z1 + z2 + z3 + z4
v =~ v1 + v2 + v3 + v4
h =~ h1 + h2
y =~ y1 + y2 + y3

v ~ x
h ~ z


y ~ x + z  + v + h

Model2 <- Model <- x =~ x1 + x2 + x3
z =~ z1 + z2 + z3 + z4
j =~ j1 + j2 + j3
k =~ k1 + k2 + k3 + k4
y =~ y1 + y2 + y3


j ~ x + z
k ~ x + z

y ~ x + z  + j + k

BUT as they are nested models because the whole model is made by the two models (Model1 and Model2) how can I run the syntax for this? I did this way (letting the measurement model always the same and changing the structural model), but I am wondering if I have to set paths to 0 or something else, can you help me?
This is how I proceed:
Model <- x =~ x1 + x2 + x3
z =~ z1 + z2 + z3 + z4
v =~ v1 + v2 + v3 + v4
h =~ h1 + h2
j =~ j1 + j2 + j3
k =~ k1 + k2 + k3 + k4
y =~ y1 + y2 + y3

v ~ x
h ~ z
j ~ x + z
k ~ x + z

y ~ x + z  + j + k + v + h

fit <- sem(Model, data = data,  meanstructure=T, estimator="MLR",  missing = "ml")

summary(fit, standardized=T, rsquare=T, ci=T, fit.measures=T)



Model1 <- x =~ x1 + x2 + x3
z =~ z1 + z2 + z3 + z4
v =~ v1 + v2 + v3 + v4
h =~ h1 + h2
j =~ j1 + j2 + j3
k =~ k1 + k2 + k3 + k4
y =~ y1 + y2 + y3

v ~ x
h ~ z


y ~ x + z  + v + h

fit1 <- sem(Model1, data = data,  meanstructure=T, estimator="MLR",  missing = "ml")

summary(fit1, standardized=T, rsquare=T, ci=T, fit.measures=T)

anova(fit, fit1)

Model2 <- Model <- x =~ x1 + x2 + x3
z =~ z1 + z2 + z3 + z4
v =~ v1 + v2 + v3 + v4
h =~ h1 + h2
j =~ j1 + j2 + j3
k =~ k1 + k2 + k3 + k4
y =~ y1 + y2 + y3


j ~ x + z
k ~ x + z

y ~ x + z  + j + k

fit2 <- sem(Model2, data = data,  meanstructure=T, estimator="MLR",  missing = "ml")

summary(fit2, standardized=T, rsquare=T, ci=T, fit.measures=T)

anova(fit, fit2)
anova(fit1, fit2)
````


SEM is (mean- and) covariance-structure analysis, so models are only comparable when fitted to the same data (i.e., the covariance matrix that the model reproduces must include all the same variables).  So indeed, if you want to test the H_0 that a particular (set of) effect(s) is 0, you cannot remove them from the model.  Instead, the general model must remain, but you manually fix certain parameters to be zero, according to the H_0 you want to test.
