I would like to use lavaan for SEM. Specifically I want to use the paper: "Original Article Maximum Likelihood for Cross-lagged Panel Models with Fixed Effects", by Paul D. Allison, Richard Williams, and Enrique Moral-Benito.

I am have however struggling to get things running (I went through al the examples, but they always deal with these perfect datasets). I would like to, bit by bit, create a better grasp of what I should do.

I have a quite large two period panel data set. The data consists of many survey questions (ordinal and categorical), some numerical data, and, not unimportantly, it has a lot of scattered NA's.

I read that for most estimations the data has to be complete.

  1. What exactly does this entail? Does lavaan, not like lm, just use only complete observations?
  2. Here, it says that if I have no full dataset, but I do have a sample covariance matrix, you can still fit your model. As explained, my dataset however has many variables, some are numerical, some are categorical, some ordinal. How do I create a sample covariance for something like that?
  • 1
    $\begingroup$ Just a remark but variance or standard error are well defined for continuous variables or ordered catagorical variables but for non ordered categorical variables it is much harder. $\endgroup$ Commented Nov 22, 2020 at 14:04

1 Answer 1

  • Yes, most estimators need complete data. If you don't have complete data, don't use one of them. I tend to use MLR the most.

  • Don't create a covariance matrix, analyze the data. (Many years ago, the analysis was a two stage process - first, create covariance matrix, then analyze it. Nowadays, you just analyze the data directly).

P.S. I have edited your question because this is true of every SEM package, not just lavaan.

  • $\begingroup$ Thank you very much for your answer (and for editing my question). Could you perhaps elaborate a little bit more on the reasoning behind your comments? With respect to the first answer, are you saying that I should not use SEM because my data is incomplete? And if so, is that because the sample (of complete observations) would no longer be random? Or are you simply saying that I should first remove all incomplete observations (of which I do not immediately see the purpose, see my comment about lm). With respect to the second answer. Do you mean that the text/link I quoted is outdated? $\endgroup$
    – Tom
    Commented Aug 26, 2019 at 19:28
  • 1
    $\begingroup$ Is MLR "maximum likelihood with robust standard errors"? $\endgroup$
    – Galen
    Commented Oct 17, 2022 at 14:27
  • $\begingroup$ Yes. ""MLR": maximum likelihood estimation with robust (Huber-White) standard errors and a scaled test statistic that is (asymptotically) equal to the Yuan-Bentler test statistic. For both complete and incomplete data." From lavaan.ugent.be/tutorial/est.html. $\endgroup$ Commented Oct 17, 2022 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.