11 votes
Accepted

How to predict factor scores in Lavaan

This question has received a number of views since it was first posed, but no answers. Here is a solution, which may be useful to future readers of this question. To demonstrate it works I will ...
Matt Barstead's user avatar
7 votes
Accepted

SEM model in lavaan: Can't compute standard errors

The model is not identified, which means there is no unique solution to the estimation problem. Identification is a challenging topic, one that is often overlooked. First, your graphical model is ...
Noah's user avatar
  • 33.4k
7 votes
Accepted

Comparing lavaan::sem to probit regression output

Oh, this is a fun topic! First, in case you aren't already familiar with the latent-response interpretation of a probit model, you can read a bit about it on Wikipedia: https://en.wikipedia.org/wiki/...
Terrence's user avatar
  • 2,128
7 votes

Goodness of fit of structural equation modelling

Take this answer with a grain of salt...as I suggested in the comments, I'm no Yves Rosseel at structural equation modeling. However, I am familiar with the normal fit indices of SEM and can at least ...
Shawn Hemelstrand's user avatar
6 votes
Accepted

SEM Goodness of Fit and model refinement

A few suggestions/clarifications before directly addressing your questions. First, a significant $\chi^2$ doesn't indicate poor fit; it indicates that you have rejected the null of perfect fit (i.e.,...
jsakaluk's user avatar
  • 5,514
6 votes
Accepted

Non-significant p-values but CI does not include 0

You should only expect confidence intervals and p-values to align in tests of significance when the same method is used to compute both. In this case, the p-value is computed using a Z-statistic which ...
Noah's user avatar
  • 33.4k
6 votes

Constructing latent variables in SEM

The short answer is lavPredict(). The longer answer is that latent variables are not uniquely identified. We know about the relationship of latent variables with other variables. We don't know the ...
Jeremy Miles's user avatar
  • 17.9k
6 votes

Structural equation modelling in lavaan

You are getting a negative residual variance (improper solution, "Heywood case") for your observed variable Q17.4 (-0.007). A negative residual variance is not interpretable/plausible and ...
Christian Geiser's user avatar
5 votes

How do I specify a lavaan sem model with a single-indicator factor?

I hope that you have found an answer at this point, but for the viewers who still want to know how to do this in the lavaan package, here's how. To start I ...
Matt Barstead's user avatar
5 votes
Accepted

How does oblimin rotation method affect confirmatory factor analysis in lavaan?

It doesn't make any difference where your model comes from. Lavaan doesn't know that the model comes form an EFA, or that you used oblimin (or any other) rotation. You should always include ...
Jeremy Miles's user avatar
  • 17.9k
5 votes

Determine the degrees of freedom as well as the free parameters in an SEM using software

I don't think it's hard to count the df for that model. You have 125 variables. (!!!) So you have $k(k+1)/2 = 7875$ moments in the distribution. You're estimating: 125 error variances, 125 loadings,...
Jeremy Miles's user avatar
  • 17.9k
5 votes
Accepted

Fitting issues when including certain combination of variables with lavaan::cfa()

Structural equation modeling relies on means and the variance covariance matrix. For ordinal data, the software will calculate polychoric correlations to try to recover the relation between the ...
Heteroskedastic Jim's user avatar
5 votes

lavaan WLSMV estimator: are results reliable when number of observations is too small to compute Gamma?

You will want to ensure an adequate sample size when variability of a variable is unequal across the range of values of a second variable that predicts it. If a regression model is able to ...
Rob's user avatar
  • 2,100
5 votes
Accepted

Determining sample size for Structural Equation Model with R

I think the best walkthrough of how to sample size plan using lavaan and simsem I have ever read was in a very short and very ...
Matt Barstead's user avatar
5 votes
Accepted

Lavaan in R : some estimated lv variances are negative (higher order model)

(That's a BIG model - what is your sample size?) This means that your model is mis-specified. Your model is trying to get the factor loadings right, and the variances right, and the covariances ...
Jeremy Miles's user avatar
  • 17.9k
5 votes
Accepted

plotting congeneric lavaan model

The default in lavaan::cfa() is to set the latent scale by fixing the first loading to 1. To instead standardize the latent variable (and estimate the first and ...
Terrence's user avatar
  • 2,128
5 votes
Accepted

Covariates in mediation analysis

Yes, you can include whichever covariates make the most theoretical sense, and the covariates can differ for different outcome variables (M vs. Y). Notice that there are only 2 regression equations (...
Christian Geiser's user avatar
5 votes

Structural equation modeling (latent growth models): robust estimators to handle outliers?

I personally prefer not to remove outliers unless it is 100% clear that they represent invalid scores. Have you tried a "sensitivity analysis" with different regular and robust estimators ...
Christian Geiser's user avatar
5 votes
Accepted

Using FIML (Full Information Maximum Likelihood) for simple correlation test on data with missings?

For a bivariate (simple, 1-predictor-only) regression, the standardized regression coefficient is equal to the bivariate product-moment correlation, so you could easily get the correlation with FIML ...
Christian Geiser's user avatar
4 votes

Specify a nested model with and without correlated slope and intercept?

You specify in the comments that your actual interest is just in running models that do and don't include a correlation between the random intercept and slope, using ...
Rose Hartman's user avatar
  • 2,185
4 votes
Accepted

lavaan works with `cfa`, provides error with lavaan(method = 'cfa')

The cfa() function is a wrapper for lavaan, which (among other things) adds the arguments auto.fix.first = TRUE auto.var = TRUE Changing your model type to CFA ...
Jeremy Miles's user avatar
  • 17.9k
4 votes
Accepted

Estimation of direct and total effects with regressions and SEM (lavaan)

Drawing back to the world of mediation as defined by Baron & Kenny (1986), you would typically test a mediation model using separate regression equations. According to this approach the researcher ...
Matt Barstead's user avatar
4 votes
Accepted

CFA lavaan Interpreting NA standardized residuals

If you check the documentation for lavaan-class, you will see a reference to Standardized Residuals in Mplus. This document explains how the normalized and ...
T.E.G.'s user avatar
  • 2,332
4 votes
Accepted

Correlated residuals lead to low factor loadings

Adding a residual correlation is equivalent to adding an additional factor. If the loadings are reduce when you add this, it's because these items are in a separate factor. (Perhaps post your code ...
Jeremy Miles's user avatar
  • 17.9k
4 votes

Lavaan SEM Ordinal and Categorical variables

Yes, there are special ways to handle ordinal and binary variables in Lavaan, you can enter them as numeric variables then when you use the ...
Haututu's user avatar
  • 41
4 votes

Lavaan SEM Ordinal and Categorical variables

As both @Dimitris Rizopoulos and @Jeremy Miles say, it is possible to fit an SEM using categorical data (i.e., which includes your dichotomous and ordinal variables). There are generally two methods ...
Preston Botter's user avatar
4 votes
Accepted

SEM: Comparing models when removing paths

The model with the factor is presumably nested within the model without the factor, so you can just perform a simple likelihood ratio test. Fit the model with the factor and the model without the ...
Noah's user avatar
  • 33.4k
4 votes
Accepted

Are there any theory and tutorial on Diagonally weighted least squares?

The robust method doesn't show Satorra-Bentler because, by default, when you specify estimator = 'MLR', the Yuan-Bentler test ...
Gabriel Reis's user avatar
4 votes
Accepted

SEM : WLSMV or WLS?

Interesting question. In my opinion, you should use WLSMV in lavaan. It is a robust variant of DWLS that correctly handles non-normal and discrete variables like those in your model. Regardless of ...
Pavel Novoa's user avatar
4 votes

How I can compare three models (nested) using lavaan with R?

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)....
Terrence's user avatar
  • 2,128

Only top scored, non community-wiki answers of a minimum length are eligible