Questions tagged [lavaan]

`lavaan` is the LAtent VAriable ANalysis package in R used for structural equation modeling

122 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
12 votes
0 answers
5k views

How to use formative indicators in covariance-based SEM with lavaan?

I'm trying to build a covariance-based structural equation model (SEM) using both reflective and formative specifications of latent variables. I use the sem ...
jhg's user avatar
  • 325
5 votes
0 answers
367 views

Dependent variable with Poisson distribution in lavaan in R: how to deal with it?

I am planning to create a SEM model with lavaan. Most variables are normal, however, my dependent variable consists in a count of times and it has a Poisson distribution. Is there any Poisson ...
Silvia's user avatar
  • 133
5 votes
0 answers
1k views

Obtain standardized factor scores for latent variables after CFA - Lavaan package in R

I want to predict the factor scores of latent variables from CFA, and use them as independent variables in another model (not SEM). Because the latent variables don't have a measurement unit, I want ...
Lena's user avatar
  • 111
5 votes
0 answers
1k views

How to identify a SEM with formative dependent variable (with R's lavaan package)?

I have a formative construct in a structural equation model (SEM) which I would like to estimate with the function sem in the ...
jhg's user avatar
  • 325
4 votes
0 answers
1k views

Mediation Model with two mediating variables using Lavaan

I'm trying to set up a mediation model using Lavaan with two mediating variables (as shown in the picture below) I'm pretty new to lavaan. Is the following approach to specify and test the model ...
mathi164's user avatar
4 votes
0 answers
3k views

Count data in a Structural Equation Model

I want to fit a structural equation model (SEM) on using the lavaan package in R. Some of the most important variables in my ...
Robbie's user avatar
  • 417
3 votes
0 answers
52 views

I get very different and inconsistent model fit indices and test statistics every time I run the cfa.mi models with the same imputed categorical data

I am trying to test the measurement invariance in my one-latent-factor model. I have 24 questions coded "correct" and "incorrect" and 3 different groups in my data. The sample ...
Enes Bayrakoglu's user avatar
3 votes
0 answers
269 views

How should I specify a multi-level moderated mediation in lavaan?

I have a repeated measures crossover design where two treatments were delivered to all participants, and measurements of the mediator M and outcome Y were taken following each treatment. I also have a ...
Ben Smith's user avatar
3 votes
0 answers
292 views

How to generate a propensity score for a continuous treatment in R?

I would like to generate a propensity score for a continuous treatment in R, and then control for the propensity score in a structural equation model (using the lavaan package). I'm aware that the ...
JRB's user avatar
  • 431
3 votes
0 answers
473 views

how to interpret no change in chi square value in measurement invariance analysis, using lavaan

Currently I am using lavaan R package to do some measurement invariance analyses. One warning that I get confuses me a little bit: ...
rdatasculptor's user avatar
3 votes
0 answers
1k views

Multigroup comparison in R - comparing model fit?

Background: I am running a structural equation model with a latent factor (using lavaan), to predict memory function by gender. I have ascertained that I have measurement invariance using the semTools ...
S Atkins's user avatar
2 votes
1 answer
78 views

Getting an equivalent of R-squared for simple univariate regression done with structural equation modeling

I need to calculate a very simple regression model outcome ~ predictor. To treat missings, I have to use FIML and also I need bootstrapping. Since the ...
Madamadam's user avatar
  • 197
2 votes
2 answers
430 views

Direct and indirect effect of a categorical variable with more than 2 levels in a structural equation model

I am new in SEM, and trying to figure out how to possibly get proportion of direct/indirect effect of a categorical variable with more than 2 levels over its total effect. We have a categorical ...
dim-ask's user avatar
  • 21
2 votes
0 answers
127 views

Moderation with higher-order factor - SEM

My colleague and I are wondering if we could use a product-indicators approach to compute moderations if the moderator is an higher-order factor. So my question is, how can I run a moderation with an ...
Santiago's user avatar
2 votes
1 answer
190 views

Should dummy variables be allowed to correlate (R code & data provided)

tl;dr: What is the difference between a regression model that allows its dummy variables to be correlated and one that doesn't do so? For example, how does that affect Standard Error of the regression ...
rnorouzian's user avatar
  • 3,986
2 votes
0 answers
2k views

Interpreting Omega coefficients (reliability) from EFA and CFA

I have a dataset with 5 variables and I would like to estimate the reliability of the scale score computed as the linear combination of all items (n = number of items), that is $O = \sum_{i=1}^{n}(X_i)...
User33268's user avatar
  • 1,722
2 votes
0 answers
3k views

Interpreting total, direct and indirect effects in SEM

I'm running a SEM model with one mediator variable (cognitive ability). Using lavaan I report within the code the indirect and total effects to test them. However, I have some doubts on how to ...
Luca Giangregorio's user avatar
2 votes
0 answers
479 views

Do I report the pvalue of the standardized or unstandardized factor loading in CFA/SEM?

Using lavaan, for a simple CFA or SEM with measurement tools, you can use parameterEstimates(fit, standardized=TRUE) to get the standardized factor loadings for the ...
debbybeginner's user avatar
2 votes
0 answers
449 views

Longitudinal CFA/SEM with autocorrelated/autoregressed indicators (in R, better with lavaan)

The problem is, I am trying to fit a multilevel factor model to highly autocorrelated (in fact, autoregressive) indicators. More specifically, I have multiple measurements (60-70) per person (5-10 ...
psyguy's user avatar
  • 311
2 votes
0 answers
2k views

How to check SEM assumptions?

This question is related to SEMs that include latent variables e those that not include in lavaan package. SEM assumes normality/multivariate normality, but it is being very difficult to found a way ...
maiava's user avatar
  • 129
2 votes
0 answers
869 views

How to compare non-nested models (with different number of items) in CFA?

I investigate the factor structur of an existing scale in a data set with N = 714 (using lavaan, R). In this context I would like to compare to alternative models: Model 1: Two factors with 5 items ...
Tina Kanina 's user avatar
2 votes
0 answers
1k views

Mediation: Significant indirect effect, but total effect nonsignificant, no inconsistent mediation

I conducted a mediation analysis via lavaan. For estimating all effects, I used 10,000 bootstraps. I have problems interpeting my results. Path a is negative and significant. Path b is positive ...
Marcel Schmitt's user avatar
2 votes
0 answers
92 views

Double Mediation?

Can anyone help me with what this lavaan (R package) syntax is doing? I got a question: Is it correct that a kind of nested multiple mediation is tested with this ...
Till's user avatar
  • 21
2 votes
0 answers
1k views

R^2 for endogenous variable in path analysis unreasonably high compared to simple regression

EDIT: I have modified my data set so as to make it effectively decontextualized, and so now have data and example code if anyone wishes to reproduce this effect. You can find it at the bottom of the ...
user3716267's user avatar
2 votes
0 answers
82 views

Is it correct to claim the existence of an 'indirect effect' in A>B>C chain when no significant A>C path is found? Or what else should I call it?

I am working on a SEM where I hypothesize a causal chain where A influences B, which in turn influences C. The data are from a 2x2 between-subjects experiment, N = 297. All the goodness of fit ...
user2935757's user avatar
2 votes
0 answers
462 views

SEM - how to obtain better fit indicators for a sem analysis using lavaan in R or Stata

I am quite new to SEM analysis so I'm trying to figure out how to make my model a good one (whether drop a variable or something else?) I have tried all sorts of things in order to make my chisquared/...
Irina's user avatar
  • 21
2 votes
0 answers
358 views

Comparing SEM with categorical response variables

I am working with a dataset with an endogenous categorical variable. I wish to determine whether removing a path from the model has a significant effect in the model. I read that the appropriate way ...
Filipe Dias's user avatar
2 votes
0 answers
483 views

Interpreting indirect effect in moderated mediation

I ran mediation analyses with Lavaan (using 5000 iterations bootstrapping). My model is a simple mediation model where M mediates the relationship between X and Y. But there is also a moderator (Mod) ...
HIL's user avatar
  • 111
2 votes
0 answers
122 views

Adding mediation degrades whole model

Updated to a more straightforward question Upfront: Every time one adds a mediation term, should the model fit be expected to degrade? In more practical terms, using lavaan: ...
lf_araujo's user avatar
  • 611
2 votes
0 answers
203 views

Non-time-varying covariates in latent growth curve modeling?

I know that if I'm doing a latent growth curve model I can use time-varying covariates, i.e. a covariate that has one value for each time point. What if I have a variable that has one value for each ...
histelheim's user avatar
  • 3,003
2 votes
0 answers
443 views

Why do I have modification indices for free parameters?

Here is my SEM model; ...
Placidia's user avatar
  • 14.4k
2 votes
1 answer
326 views

Constraining latent variance of the slope across groups in lavaan

lavaan provides a function for measuring measurement invariance (measurementInvariance()). However, let's say that I want to ...
histelheim's user avatar
  • 3,003
1 vote
0 answers
17 views

Assumptions to be met for a contrast test of mean against zero

When doing a contrast test (see R code below) or it's rather unusual regression style equivalent, both of which are basically a t-test, what assumptions have to be ...
Madamadam's user avatar
  • 197
1 vote
0 answers
139 views

Can I covary exogenous and endogenous latent variables in SEM in lavaan

I am editing the question as it was too meandering. I am sorry about that. I am running an extended Theory of planned behavior (TPB) model of digital piracy and I have a question that boils down to - ...
Miljan's user avatar
  • 11
1 vote
0 answers
38 views

What does it mean when the total effect is non-significant in a mediation?

I ran a mediation analysis using lavaan, there was a significant indirect effect but no significant direct or total effect. What does the total effect mean and how do I go about interpreting this ...
stats student's user avatar
1 vote
0 answers
39 views

power analysis for cross-lagged panel model with random intercept using powRICLPM

I want to compute power analysis for cross-lagged panel model with random intercept using powRICLPM package (Related publication) Authors of the package did a great job and the power analysis seems to ...
David's user avatar
  • 11
1 vote
0 answers
224 views

lavaan: std.lv versus std.all interpretation for (essentially) tau-equivalent models

A (essentially) tau-equivalent model has the following specifications: the factor loadings are constrained to be equal the intercepts are constrained to be equal (tau-equivalent) or allowed to vary ...
hanna-without-h's user avatar
1 vote
1 answer
20 views

Lavaan: How to free a constraint in one group out of two, while at the same time using effects-coding scaling method?

I am examining differences in latent means between two groups using the following syntax: ...
Nikos Makrygiorgos's user avatar
1 vote
0 answers
66 views

Lavaan and semTools partial measurement invariance syntax

I am running measurement invariance in Lavaan using a 7 item ordinal scale. I have been using Lavaan and semTools, and specifically the measEq.syntax command, due to the fact it easily implements Wu ...
Josh Blake's user avatar
1 vote
0 answers
22 views

Serial multiple mediated model in lavaan not calculating standard errors, Z-values, and P values for defined parameters

I am trying to run the following model in Lavaan, in which AM, RM, and CU are latent variables. It also has three control variables (CV1, CV2, and CV3). I have written the code that is included at ...
Cecilia Sada's user avatar
1 vote
0 answers
163 views

Interaction between two binary variables in lavaan

I have two binary variables (X1 and X2, coded 0/1) as predictors in a growth model in lavaan. I want to understand their individual contributions and their ...
Jeanne Sinclair's user avatar
1 vote
0 answers
315 views

NA in lavaan output for Standard Errors (Std.Err), z-value, and p-value (P(>|z|))

unfortunately I have a problem with my lavaan output in R Studio (Version R-4.3.0). I would be very grateful to get help with my problem! I do not get standard errors, z and p values displayed. For ...
raintwo's user avatar
  • 11
1 vote
1 answer
307 views

Mediation model with covariates and between and within-person mediators

I am pretty new to mediation in multilevel models. I want to run a 2-1-1 (and maybe a 2-2-1) mediation model in R. The dataset consists of 110 participants with three assessments per day. covariates = ...
MAIMAU's user avatar
  • 11
1 vote
0 answers
284 views

Measurement invariance testing with ordinal data using lavaan: what is really happening under the hood?

I've been trying to wrap my head around measurement invariance testing with ordinal data in R version 4.2.2 using lavaan 0.6-13. It all seemed rather straight-forward in theory, but I believe I am ...
2gs's user avatar
  • 41
1 vote
0 answers
92 views

Interpretation of SEM - prediction

I am trying to model a behavior using the Theory of Planned Behavior (TPB) as my main framework. I have an active survey; currently with 110 answers. I'm using R with lavaan to run the following model....
Jota's user avatar
  • 41
1 vote
0 answers
52 views

Structure equation model how to compare observe variables contribution

I have a model with one latent variable (two observed variables A and B). I think variable A is contributing to the majority of the entire model's significance, and variable B might contribute less or ...
Betty's user avatar
  • 21
1 vote
0 answers
856 views

lavaan warning: The variance-covariance matrix of the estimated parameters (vcov) does not appear to be positive definite

I'm trying to estimate the following CFA model with the lavaan package and get the warning: The variance-covariance matrix of the estimated parameters (vcov) does not appear to be positive definite! ...
ElenaKJ's user avatar
  • 11
1 vote
0 answers
1k views

How to interpret SEM mediation analysis results (using Lavaan in R) with binary exposure and outcome variables

I have built SEM model in R using Lavaan. My aim is to report on the indirect effect. The data I am using is confidential, so I will not be able to share it or provide a reproducible example. Since I ...
capmo's user avatar
  • 11
1 vote
0 answers
249 views

In lavaan, how do you allow all manifest indicators to covary?

When building and developing a model with lavaan, e.g., ...
syntheso's user avatar
  • 111
1 vote
0 answers
48 views

Structural equation software can seemingly do factor analysis with more variables than observations

I have discovered that the function umxEFA in the R package umx can do a factor analysis with more variables than observations. A normal factor analysis cannot do this because the covariance matrix ...
A Fog's user avatar
  • 133