All Questions
6 questions
1
vote
2
answers
197
views
How to tryCatch in R cfa of lavaan library (and inspect errors, but get variable)?
I do simulation research and create different datasets for different CFA models. During a series of simulations, I would like to handle errors resulting from e.g. randomization. Specifically - I would ...
0
votes
1
answer
132
views
Loop with Lavaan in R couldn't find the variable
I was running the following code so that my Lavaan Model can test different predictors. However, the error says it couldn't find my "predictor". I need to keep that "paste" row so ...
0
votes
1
answer
649
views
How can I extract one specific coefficient from multiple lavaan models?
I wrote a function to run several lavaan models at once (from 5 different datasets). In the output I get the 5 different outputs. However, I would like to extract one specific estimate from each of ...
0
votes
1
answer
307
views
Loop or Function in R that for Multiple Analyses with Similar Variables
Relatively new to r, and I'm trying to figure out how to run an identical analysis for two different sets of variables. This isn't my data, but here's how my code looks right now:
library(lavaan)
...
2
votes
2
answers
335
views
R loop for several dataframes using Lavaan
I'm currently working on data with 8 waves, each wave is for now stored in it's own dataframe. I've done most of the data cleaning with a lot of repetition, since I couldn't figure out how to make R ...
2
votes
1
answer
532
views
Loop over combinations of column names with lavaan syntax
How can I loop over rows of a data frame containing variable names permutations when running a mediation analysis with lavaan?
Say I have 4 variables var1, var2, var3, var4:
df<- data.frame(var1 =...