Questions tagged [lavaan]
`lavaan` is the LAtent VAriable ANalysis package in R used for structural equation modeling
331
questions
0
votes
0
answers
14
views
semPower: Accounting for Clustered Standard Errors in SEM Power Analysis with Fixed Effects Model
I am planning to analyse clustered data with a structural equation model and as I am planning on submitting my project as a registered report, I am first trying to do an in-depth power analysis (it is ...
1
vote
1
answer
29
views
Latent growth curve model: The variance-covariance matrix of the estimated parameters (vcov) does not appear to be positive definite
I have run a latent growth curve model in R using lavaan and got the below warning. It would be good to hear suggestions on how to resolve this warning. The full output is below.
Note that I dummy-...
1
vote
0
answers
14
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 ...
2
votes
1
answer
41
views
R lavaan: quadratic regression of latent variables
Is there a way of specifying a quadratic regression between latent variables in lavaan? (Or in another R package for structural equation modeling?) That is, latent variable y, ...
1
vote
1
answer
27
views
Effect of robust maximum likelihood estimator in structural equation modelling when data is normal?
I understand that when data are nonnormal robust maximum likelihood estimator can be used.
I'm wondering are there any disadvantages of using a robust maximum likelihood estimator when the data are ...
0
votes
1
answer
29
views
Measurement invariance: Model fit increases with increasing constraints
I have run into the same problem repeatedly, namely that model fit increases with increasing model restraints.
I want to compare measurement invariance on a three-factor model (based on previous CFAs ...
3
votes
1
answer
32
views
Structural equation modeling (latent growth models): robust estimators to handle outliers?
Can I use robust estimators (e.g., "MLM" and "MLR"estimator lavaan options) to overcome outliers within my sample, or should I remove outliers?
For context, I am modelling the ...
0
votes
2
answers
53
views
Structural equation modelling in lavaan [closed]
I used factor analysis and structural equation modelling using lavaan in RStudio. Before adding the residual covariances and regression into the SEM model, the ...
2
votes
1
answer
186
views
Goodness of fit of structural equation modelling
I am currently working on a structural equation modeling project using the lavaan package in R. The model satisfied all the goodness of fit tests (GFI, AGFI, CFI, ...
1
vote
0
answers
17
views
Mediation analysis (lavaan in R vs. Hayes MACRO SPSS) [closed]
I have a really basic question when conducting mediation analysis.
When reading articles, some scholars use lavaan package in R and other use Hayes MACRO.
Are there any differences? For example, if I ...
4
votes
1
answer
33
views
Can you run a SEM on a correlation matrix only (without a covariance matrix)?
I have access to correlations between my variables of interest and the overall sample size. But I don't have standard deviations so I can't construct a covariance matrix. Can I still run a SEM on the ...
3
votes
1
answer
34
views
Lavaan growth model: to treat endogenous variable as ordinal or continuous
I am modelling the trajectories of scores on two cognitive tests (i.e., PAL and SOS) measured at four time points. To do this I am creating separate latent growth curve models for each cognitive test, ...
1
vote
0
answers
12
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 ...
1
vote
0
answers
45
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 ...
1
vote
0
answers
36
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 ...
0
votes
1
answer
31
views
Which effects to fix in SEM with two time points?
I am trying to fit a (to me relatively complex) SEM where I'm interested in two dependent variables measured at t2 and assume that this is explained through independent variables at t1. I have never ...
1
vote
0
answers
69
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 ...
0
votes
0
answers
23
views
Binary and count variables as endogenous variables
I set up an APIM (actor-partner interdependence model) in R (lavaan).
No I'm facing the following issues:
Model: My endogenous variable is a count variable that follows a poisson-distribution.
Model:...
0
votes
1
answer
31
views
Interpretation of lavaan growth covariate parameters (effects on intercept and slope)
I am trying to interpret the output of the growth command with regressors. Here's the command, and the covariates are dummy coded 0/1:
...
0
votes
1
answer
32
views
Error with mediation analysis in lavaan in R
I am beginner to run mediation analysis using lavaan package in r and have some issues to run the models and understand errors.
Here is my syntax.
...
2
votes
3
answers
89
views
Why do matrices of simulation data generated in R create strongly related latent variables?
When creating examples of matrices for CFA in R for students, I still have a problem with getting data that looks realistic - specifically, that between latent variables I often have covariance path ...
2
votes
0
answers
24
views
can someone explain the application of row.weights and sampling.weights in Lavaan?
I am trying to include the weight derived from Inverse Probability of Treatment Weighting into a structural equation model.However, it is unclear how it should be incorporated into the model and how ...
2
votes
1
answer
186
views
Covariates in mediation analysis
I have started working on mediation analysis, but I am still confusing how to deal with covariates. Here are my models (X, predictor; M, mediator; Y, outcome; all are linear regression models).
Path 1:...
1
vote
1
answer
21
views
Can I compare a parallel and congeneric model with lavaan::anova()?
I want to compare two 1-factor models: (a) a congeneric model where the loadings are optimally weighted; and (b) a parallel model where the loadings are fixed to 1 (equally weighted).
...
1
vote
1
answer
58
views
Is it necessary to report model fit indices for no latent variable model?
I built a moderated mediation model (Hayes Model 8 with no latent variables) for my research. Is it necessary to report model fit indices (e.g., CFI, Chi-squares) for this kind of research model?
If ...
0
votes
0
answers
42
views
lavaan - sem with second order factor problem
I have a model in which I set relationships among different variables. One of them is a second-order factor.
However, I get the following problem when I try to run the analysis:
Warning messages:
1: ...
0
votes
0
answers
40
views
What are considered "voodoo fit indices" and "true"/"fake" standard errors? SEM CFA
In a conversation about fitting CFA with clusters and sampling weights (inverse probability weights) for ordered/ordinal/categorical data in R Lavaan, fit indices (GoF) were referred to as "...
0
votes
1
answer
68
views
How to design a within subjects structural equation model
I'm very new to SEM/Path analysis. I'd like to know how to design/visualize a within-subjects SEM/Path analysis. For example, suppose I'm measuring a path from a cognitive measure X that should impact ...
0
votes
0
answers
98
views
Compare latent trajectories of two groups based on same model using SEM
I fit latent growth models using lavaan's growth() function in R. It looks like this:
...
2
votes
1
answer
129
views
Factors or components in Stata and R (psych, lavaan): Confusing method labels and diverging results
I have some trouble translating between Stata and R (psych, lavaan) about factors and components with an interest in the loadings/eigenvectors of the items. I seek to validate results (understand the ...
1
vote
1
answer
41
views
Lavaan modificiation indices are already in CFA model?
I am trying to improve the fit for my CFA model below.
...
0
votes
1
answer
40
views
Path analysis - model writing check (Rstudio- lavaan package)
Below you will find the Figure of the path model that I wrote in Rstudio.
model2 <- '
#direct effect
INT ~ e*PN
PN ~ d*AR
AR ~ c*AC
AC ~ b*PB
PB ~ a*BV
#indirect effect
ed := e * d
edc := e * d * ...
0
votes
1
answer
25
views
Interpretation on SEM - diagnosis (Chi-square not good fit)
I'm running SEM in lavaan, but my model seems not fitting correctly based on the chi-square value and it's p-val = 0.000.
When i look at other fit measurements, the model is close to fit well. Below ...
0
votes
1
answer
17
views
Difference between SEM AND ols+pca
Can someone explain me the difference between these approaches, if you want i can provide the results, but since they are quite extensive, i could attach on demand.
I'm working with the Theory of ...
2
votes
2
answers
122
views
Multi-group SEM - constraints and regression paths
This is a question seeking to follow up on this post.
I have a multigroup SEM with a mix of observed and latent variables.
In the measurement model to inspect latent variables, metric invariance holds ...
1
vote
1
answer
127
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 = ...
0
votes
0
answers
25
views
What does it mean if one factor describes four measures, another factor describes other four measures, but both don't describe the eight measures?
I have 8 measures: A_1, A_2, A_3, A_4, B_1, B_2, B_3, B_4. I know from the correlation matrix that they are all related. I would like to find the latent variable structure.
Using lavaan in R, I found ...
0
votes
0
answers
20
views
Good factor loadings in a one factor model, but poor loadings once model is added to full SEM (lavaan - RStudio)
So I have been trying to reproduce a logistic SEM with a binary outcome (not relevant to this question). The sample size after removing missing values is around 820. One of my predictor latent factors ...
0
votes
0
answers
19
views
a better name-representation for mediation SEM models
Each time that I wanted to build mediation models a-b-c symbols were very confusing, especially in more complex SEM relations. Therefore, I made some pre-built models (for lavaan in r) that I propose ...
1
vote
0
answers
19
views
CFA with lavaan: Standard errors not computable [duplicate]
I am not that much experiencend in R and I want to run a CFA. The code is as follows:
...
0
votes
0
answers
44
views
comparison of two different mediators for the models with the same DV and IVs
Based on my theoretical arguments, I have two competing mediators (M1 and M2), each of which possibly mediates the relationship between my independent (X) and dependent (Y) variable. I implemented two ...
2
votes
2
answers
141
views
Constructing latent variables in SEM
I need to extract results from a SEM, but I'm struggling to read the results using lavaan package in R. More specifically, I have 3 latent variables and would like to know how can i reconstruct them ...
1
vote
1
answer
52
views
Regressing slope on intercept in multivariate growth curve model
I'm running a multivariate growth model with two variables measured across 3 waves using lavaan/growth function.
Here's the model specification I'm using, with non-uniform time differences. Two ...
0
votes
1
answer
145
views
Comparing multigroup CFAs: Improved fit with more restrictions
I have conducted a CFA for a one-factor measurement model and then proceeded to do multigroup CFAs to test for measurement variance for gender and age (binary variable, median split). Testing for ...
1
vote
1
answer
26
views
Adding invariance restriction leads to eigenvalue close to zero - can invariance be stated, nevertheless?
I am testing invariance between two groups. Configural and metric invariance is given. When adding the restriction of equal intercepts, lavaan gives me the warning that the smallest eigenvalue is ...
2
votes
1
answer
121
views
How do you calculate degrees of freedom in a formative measurement model?
In a reflective measurement model, the number of degrees of freedom is calculated according to the number of information (covariances / variances) minus the number of parameters to be estimated (...
3
votes
0
answers
151
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 ...
0
votes
0
answers
17
views
How to specify this diagram type in lavaan
I have this type of diagram
Where my main focus is the latent variable A and I want to know which factors impact the most on it.
To make things more clear I will describe some made-up context that ...
1
vote
1
answer
108
views
Robustification in lavaan: Difference between M, MV and MVS?
In lavaan, I am running a two-factor CFA on a questionnaire with 28 items, all of which are scored on a 6-point Likert scale. In total I have ~350 participants who completed the questionnaire.
Because ...
2
votes
2
answers
94
views
How do I force lavaan to use positive factor loadings for a latent construct?
I am looking for a way to force lavaan to use positive factor loadings in a latent construct.
I am working on a sem defined as follows:
...