SEM or CFA for two level structure

I have 20 observed factors and I want to check their validaty as a scale of 4 latent variables. For this purpose I should use the cfa function. Right?

Then I want also to check a second order model. Its structure is as follows: these 20 observed factors load on these 4 latent variables which consist 2 larger latent variables. Should I have to use the sem function for the second scenario? I'm using R studio and here is my code

MYMODEL='V1=~ Q1 + Q2 + Q3 + Q4
V2=~ Q5 + Q6 + Q7 +Q8+Q9
V3=~ Q10 + Q11 + Q12 + Q13 + Q14+ Q15
V4=~Q16+Q17+Q18+Q19+Q20
LB1=~V1+V2
LB2=~V3+V4'
MYMODEL.fit=sem(MYMODEL,data=MYDATA,missing="listwise", ordered = TRUE,estimator="WLSMV")
fitMeasures(MYMODEL.fit)


where Q... are the observed variables, V...are the first order latent variables and LB...the second order latent variables.

• By two-level do you mean multilevel, or hierarchical? Can you post model syntax or a path diagram? – Jeremy Miles Nov 12 '16 at 3:38
• Also, what package are you using? – Jeremy Miles Nov 12 '16 at 16:48
• Thanks for the response! I mean two level SEM, its not hierarchical. I'm using R. – user26400 Nov 14 '16 at 10:04
• MYMODEL='V1=~ Q1 + Q2 + Q3 + Q4 V2=~ Q5 + Q6 + Q7 +Q8+Q9 V3=~ Q10 + Q11 + Q12 + Q13 + Q14+ Q15 V4=~Q16+Q17+Q18+Q19+Q20 LB1=~V1+V2 LB2=~V3+V4' MYMODEL.fit=sem(MYMODEL,data=MYDATA,missing="listwise", ordered = TRUE,estimator="WLSMV") fitMeasures(MYMODEL.fit) where Q... are the observed variables, V...are the first level latent variables and LB...the second level latent variables. Is this correct? – user26400 Nov 14 '16 at 10:10
• Maybe it is more clear to use the definition second order rather than two level. – user26400 Nov 14 '16 at 11:04

Welcome to CV. From the style of your code, it appears you are using the lavaanpackage for R. Note that while, in principle, there are some between CFA and SEM as analyses, the functions cfa() and sem()in the lavaan package do not offer different functionality--they are both wrappers for the more general lavaan() function (see here, for a related StacksOverflow question). You could fit your higher-order measurement model using the cfa() function, and it would be fine.