3

I diffed the R lavaan package cfa() and sem() help pages. There are no differences.

The code below gives same estimates.

If that is the case, what is the point of having two different names to same thing?

model <- ' 
  # latent variable definitions
     ind60 =~ x1 + x2 + x3
dem60 =~ y1 + a*y2 + b*y3 + c*y4
dem65 =~ y5 + a*y6 + b*y7 + c*y8

# regressions
dem60 ~ ind60
dem65 ~ ind60 + dem60

# residual correlations
y1 ~~ y5
y2 ~~ y4 + y6
y3 ~~ y7
y4 ~~ y8
y6 ~~ y8
'

fit <- sem(model, data=PoliticalDemocracy)
summary(fit, fit.measures=TRUE)
parameterEstimates(fit)

fit <- cfa(model, data=PoliticalDemocracy)
parameterEstimates(fit)
L. Bakker
  • 147
  • 1
  • 13
adam
  • 655
  • 1
  • 10
  • 31

1 Answers1

4

From the lavaan website tutorial:

The function sem() is very similar to the function cfa(). In fact, the two functions are currently almost identical, but this may change in the future.

If you look further at the reference manual, you can see that both cfa and sem are wrappers for the general lavaan function, and they share they same default model specifications. So it seems that the distinction is currently not all that useful, but that the two commands may eventually possess different functionality. Perhaps the package developer simply wanted to support this future possibility, early on.

jsakaluk
  • 549
  • 4
  • 19