I fitted two models using sem(). Both models run perfectly fine and summary() returns estimates for all variables. Using lavInspect(model1, what="cov.ov") I get a covariance matrix from model 1 in which the exogenous categorical variables landscapeforest.fragment, landscapeisland, sexM and season2014.2015 (all are dummy coded) are missing. Other categorical variables (supertypes3x1, etc.) do however appear in the covariance matrix. In model 2 the exogenous variables landscapeforest.fragment and landscapeisland are present in the covariance matrix.
Is there something wrong in my script or is there another reason for this? See below for the script:
model1 = "#regressions
#direct effects
hepaci.inf ~ landscapeforest.fragment + landscapeisland + sexM + supertype1x1
picobirna ~ season2014.2015
picorna ~ a*juliDensity + s*season2014.2015 + t*supertype10x1 + u*supertype3x1 + v*supertype5x1 + w*supertype9x1
tryp.inf0 ~ b*marsu.density + landscapeforest.fragment + mean_pdist
n1.2 ~ d*SimpsonInv2018ed.in + c*juliDensity + landscapeisland
n15.29 ~ f*SimpsonInv2018ed.in + landscapeisland + e*juliDensity + x*supertype6x1
n23 ~ h*SimpsonInv2018ed.in + g*juliDensity
SimpsonInv2018ed.in ~ k*landscapeforest.fragment
juliDensity ~ i*landscapeisland
marsu.density ~ j*landscapeforest.fragment + season2014.2015
supertype3x1 ~ l*season2014.2015 + m*landscapeisland
supertype5x1 ~ n*landscapeisland
supertype6x1 ~ o*landscapeforest.fragment + p*landscapeisland
supertype9x1 ~ q*landscapeisland
supertype10x1 ~ r*season2014.2015
#indirect effects
#landscapeisland~picorna via juliDensity
ai := a*i
#landscapeforest.fragment~tryp.inf0 via marsu.density
bj := b*j
#landscapeforest.fragment/landscapeisland~n1.2 via juliDensity,SimpsonInv2018ed.in
ci := c*i
dk := d*k
#landscapeforest.fragment/island~n15.29 via juliDensity, SimpsonInv2018ed.in
ei := e*i
fk := f*k
#landscapeisland/forest.fragment~n23 via juliDensity, SimpsonInv2018ed.in
gi := g*i
hk := h*k
#season2014.2015/landscapeisland~picorna via st3
sl := s*l
um := u*m
#landscapeisland~picorna via st5
vn := v*n
#landscapeforest.fragment/landscapeisland~n15.29 via st6
xo := x*o
xp := x*p
#landscapeisland~picorna via st9
wq := w*q
#season2014.2015~picorna via st10
tr := t*r"
model1 = sem(model1, data2, estimator = "WLSMV")
model 2 = "#regressions
#direct effects
multi.inf ~ landscapeforest.fragment + b*SimpsonInv2018ed.in + a*juliDensity
SimpsonInv2018ed.in ~ d*landscapeforest.fragment
juliDensity ~ c*landscapeisland
#indirect effects
#landscapeisland~multi.inf via juliDensity
ac := a*c
#landscapeforest.fragment~multi.inf via SimpsonInv2018ed.in
bd := b*d"
sem(model2, data2, estimator = "MLM")