Questions tagged [r-lavaan]

A free, open-source `R` package for latent variable analysis. `lavaan` includes support for a large variety of multivariate statistical models which contain (or not) latent variables. It allows multilevel analysis, and as estimators that deal with missing values and categorical data. Some of the applications available are confirmatory factor analysis, full structural equation models, latent growth curve models, and path analysis.

A free, open-source R package for latent variable analysis. lavaan includes support for a large variety of multivariate statistical models which contain (or not) latent variables. It allows multilevel analysis, and as estimators that deal with missing values and categorical data. Some of the applications available are confirmatory factor analysis, full structural equation models, latent growth curve models, and path analysis.

Resources

Repositories

Related plotting packages

  • lavaanPlot - Visual analusis of lavaan models.
  • semPlot - visual analysis of various SEM packages' output, including lavaan.
308 questions
0
votes
0 answers

Robust T value in Lavaan R

Is there any way to get robust t-value for the factors in lavaan when using confirmatory factor analysis with the function cfa() and structural equation modeling with function sem()? Is it the same as the z-score when using summary(fit,…
Rodrigo A
  • 657
  • 7
  • 23
0
votes
0 answers

FMI function for MI datasets is acting up?

I used the fmi function from SemTools package just a few weeks ago, and it worked great! Here is the code that I saved and that worked fine: dat.imp2 <- mice(data = dat1, m = 37, method = "pmm", seed = 444) out <- fmi(dat.imp2$imputations) out I…
Marishka Usacheva
  • 347
  • 1
  • 3
  • 13
0
votes
1 answer

Pulling out modification indices for variances of items with lavaan in R

I've run a Multigroup CFA model with the package 'lavaan' in R and found that when running the strict invariance model the two groups were not invariant (not equal). This suggest that at least on one item the range is not the same for the two groups…
Benjamin Telkamp
  • 1,451
  • 2
  • 17
  • 31
0
votes
1 answer

Sampling weights for subpopulations in R

I'm working with a large, national survey that was collected using complex survey methods. As such, I'm needing to account for sample weights and other survey design features (e.g., sampling strata). I'm new to this methodology, so apologies if…
arrrrRgh
  • 197
  • 3
  • 15
0
votes
1 answer

How to specify different model for certain groups in multigroup measurement invariance in lavaan?

I have a dataset in which some, but not all, subjects participated at Time 2. I want to run a measurement invariance analysis across time and across groups. Of course, for those who participated at Time 1 only, Time 2 latent variables would not be…
Brigadeiro
  • 2,649
  • 13
  • 30
0
votes
1 answer

Empty cells warning and missing robust fit measures with WLSMV

I'm trying to fit a model with ordinal variables and it seems like, due to a sample size of just N=111, there are quite a lot of empty cells in the correlation tables: fit <- cfa( model = my.model, data = items, ordered =…
Tim Ka
  • 142
  • 2
  • 8
0
votes
2 answers

Extracting path coefficients of piecewise SEM (structural equation model)

I'm constructing a piecewise structural equation model using the piecewiseSEM package in R (Lefcheck - https://cran.r-project.org/web/packages/piecewiseSEM/vignettes/piecewiseSEM.html) I already created the model set and I could evaluate the model…
geum
  • 1
  • 1
0
votes
2 answers

Create a path diagram of a SEM model with a categorical response variable using semPaths()

I would like to create a path diagram of a SEM model with a categorical response variable using semPaths(). However I am running into an error: library(lavaan) library(semPlot) table.7.5…
Filipe Dias
  • 284
  • 1
  • 10
0
votes
1 answer

Interpreting lavaan SEM coefficients

First time using lavaan package in R to run Structural Equation Model (SEM) analysis. Code: fac1 =~ a1+a3+a4+a5 fac2 =~ a2+a7+a8+a12 fac3 =~ a9+a10+a11+a14 fac4 =~ a12+a13+a15+a16 fac4 ~ fac1+fac2+fac3 fac3 ~ fac1+fac2 ..... some more…
krishna
  • 1
  • 2
0
votes
0 answers

moderated mediation with lavaan

I was looking at this example: https://stats.stackexchange.com/questions/163436/r-moderated-mediation-using-the-lavaan-package to make my own moderated mediation, but I get errors and I am not finding the solution. my model is: model <- ' #direct…
user6121484
  • 143
  • 2
  • 15
0
votes
1 answer

Pipe a report from modind() / lavaan() into a vector

Background While analysing some data in a SEM model one can list the indicators that are the most influent to the model fit. This is done with the command modind from the lavaan project. I can filter it to show only the first few. The command looks…
lf_araujo
  • 1,991
  • 2
  • 16
  • 39
0
votes
0 answers

Why can't I assign and save this model summary? (in Lavaan, an R package)

I estimate a latent variable model in lavaan in R, such as library(lavaan) HS.model <- ' visual =~ x1 + x2 + x3 textual =~ x4 + x5 + x6 speed =~ x7 + x8 + x9 ' fit <- lavaan(HS.model, data=HolzingerSwineford1939, …
tomka
  • 2,516
  • 7
  • 31
  • 45
0
votes
0 answers

SEM single indicator model in lavaan: regressions without intercepts?

I am estimating a path model using R package lavaan. I only have 1 indicator per construct so that I am not using latent constructs nor measurement models. I just have "observed" variables and model relationships among them. I got a model with…
user2323534
  • 585
  • 1
  • 6
  • 18
0
votes
1 answer

Error while installing RTextTools 1.4.2 (Windows)

I am trying to install RTextTools 1.4.2 in Windows, and I get the following error : trying URL 'http://ftp.iitm.ac.in/cran/bin/windows/contrib/3.2/lava_1.4.0.zip' Error in download.file(url, destfile, method, mode = "wb", ...) : cannot open URL…
0
votes
0 answers

Longitudinal Multi-group latent growth curve model with time-variant and time-invariant predictors (lavaan)

First of all, I am relatively new in using R and haven't used lavaan (or growth models) before so please excuse my ignorance. I am doing my thesis and analyzing the U.S. financial industry during the financial crisis of 2007. I therefore have…
Harry
  • 1
  • 3
1 2 3
20
21