A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Hot answers tagged

13

1) The baseline is a null model, typically in which all of your observed variables are constrained to covary with no other variables (put another way, the covariances are fixed to 0)--just individual variances are estimated. This is what is often taken as a 'reasonable' worst-possible fitting model, against which your fitted model is compared in order to ...


9

There isn't currently a method implemented at the model level, but you can create a new variable that is just attitude1*group, or you can just use multigroup analysis, which may be more appropriate in this case.


9

It is possible to do EFA in a CFA framework. This is sometimes called "E/CFA". A nice discussion of this can be found in: Brown, T. A. (2006). Confirmatory factor analysis for applied research. New York: Guilford Press. For this to work, you need to have an "anchor item" for each factor, for which there are no cross-loadings. Looking at the results from ...


9

They're the same model. It's useful to be able to define a latent variable as a composite outcome where that variable only has composite indicators. If you don't have: f1 =~ y1 + y2 + y3 You can't put: f1 ~ x1 + x2 + x3 But you can have: f1 <~ x1 + x2 + x3


6

Your model is not identified. That means that Lavaan cannot find a unique solution, and cannot compute standard errors. Because it can't find a unique solution, it's finishing in different places. [Very simple example of identification: $x + y = 5$ There are many (an infinite number) of solutions to this equation for x and y, and they're all equally good, ...


6

A CFI of 0.9 is generally considered to not be very good (nowadays?). So saying that a CFI that is below 0.9 is "almost a good fit" is (IMHO) stretching the truth somewhat. So why do you have good RMSEA and poor CFI? It's because the two indices test fit in different ways. RMSEA is based on chi-square - lower chi-square means lower RMSEA. The CFI tests fit ...


6

I posted this question in another location and was provided the answer by Terry Jorgenson. Question and answer: I would like to calculate the conditional indirect effects of X on Y given a set of values for the moderator W. Both X and the moderator are continuous. Could you provide some direction for structuring the model syntax? Assuming X and W are ...


5

Moving comments above to an answer: You really can't say anything at all about this model. On top of being completely unidentified it is badly broken (negative variance terms abound). So I would throw this model out and try something completely different. Edit: This model is vastly over-identified and hence it is not unique (therefore, it's likelihood ...


5

The variance is a statistic indeed, but why rely on a package to answer that for you rather than your knowledge of statistics? For instance, you might be interested in parametric variance estimation in which you might assume (or test assumptions) of certain distributions in the data you estimate (parametric approach). You can also go for non-parametric ...


5

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, and the covariances of the latent variables. You have 20 latent variables, so you have 190 covariances. That makes $125 + 125 + 190 = 440$ parameters to ...


4

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 first run a cfa() model in using the HolzingerSwineford1939. The model is taken from the lavaan tutorial page. library(lavaan) dat<-data.frame(...


4

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 changes a few cosmetic things, but not the basic model. Because the lavaan() command has not put these in, you need to add the arguments, or add the appropriate parameters to the model. lavaan(...


4

Ideally, invariance tests would culminate in a model that constrained the path between the "mediating" factor and the outcome factor to equality across groups. Global $\chi^2$ values are used to evaluate relative fit between models representing different levels of invariance.$^1$ Assuming measurement invariance has been established,$^2$ testing for mediation ...


4

The thresholds are on a logit scale, so it's the log-odds (just like in logistic regression, or ordinal logistic regression). The thresholds are just like the intercept in a regular regression model. They give the expected log odds of a value, given that the predictors (including latents) are equal to zero. If in a model with continuous variables, you ...


4

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 correlations between your factors, unless you have a very good reason to believe that they are correlated zero. Lavaan includes factor covariances (and factor ...


4

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., $\sum$ = $S$). Kline (2015) aside, most SEM specialists (e.g., Brown, 2006; Finch & French, 2015; Hu & Bentler, 1995; Little, 2013; MacCallum & ...


4

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 and results? You say "I decided to allow residuals of these items to correlate with each other. " but I don't see how you can do that and keep the model ...


3

You can, but first you need to constrain the parameters to be equal across groups. Change your model to: HS.model <- ' visual =~ x1 + c(a, a) * x2 + x3 textual =~ x4 + x5 + x6 speed =~ x7 + x8 + x9 ' fit <- cfa(HS.model, data = HolzingerSwineford1939, group = "school") summary(fit) And I have constrained the loading for x2 to be equal across ...


3

Your estimated model looks like: \begin{align} \sqrt{V_2} &= a_2 \left( 1+V_1 \right)^{b_2} + \epsilon_2 \\ \sqrt{V_3} &= a_3 \left( 1+V_2 \right)^{b_3} + \epsilon_3 \\ \ln{\left(1+V_4\right)} &= a_4 + b_4 V_2 + c_4 V_3 + \epsilon_4 \\ \end{align} What you are interested in calculating is $\frac{d V_4}{d V_1}$. To do this, we are just going to ...


3

Means and intercepts of latent variables are kind of weird. It looks to me like you've constrained the means of the intercepts to zero. If you haven't, then model is not identified. You estimate the intercepts freely with: A1 ~ 1 I don't think you did that. (But post your output if you want me to be sure.) Means (and intercepts) of latent variables are ...


3

The mean of the free latent is the difference between the male and female mean. So the female mean is 0.15 points lower than the male for F1, and 0.2 points lower for F2. These are on the scale of the units that were used to identify the variances - so they are in units of a 5 point scale and a 2 point scale. Standardization can be weird. I don't know what ...


3

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 standardized residuals computed in Mplus and I think lavaan follows Mplus in this computation (see documentation of lavaan-class: "For more information about the normalized and standardized residuals, ...


3

I'll preface my answer by saying that I suspect you may find it unsatisfactory. So you want to test moderation of the $x_1$ and $x_2$ association by $z_1$. You are uncomfortable assigning either the role of cause or effect, so you're looking for a way to "hack" your way around such a decision with SEM, but you get this annoying Haywood case. There's a ...


3

TL;DR -- your intuition is wrong, and the model is identified. THE GORY DETAILS This is a simultaneous equations econometrics model. Any and every SEM modeler needs to understand them before moving to enter any MPlus or lavaan or Stata syntax. (Well, any and every SEM modeler needs to know regression at the level of LSI, and multivariate at the level of ...


3

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 factor, then use lavTestLRT to compare them. If the test is significant, there is evidence that the model with the factor fits better than the model without it.


3

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 accessible text called Latent Variable Modeling Using R: A Step-by-Step Guide by A. Alexander Beaujean. His examples are admittedly relatively simple, but they should provide an excellent basis to start from when thinking about a ...


2

I suspected the same thing as Stat when I wrote my comment but I wanted to cross-check it before saying it and be sure which package does what. This is what takes place: On the one hand lavaan uses the classical definition of $AIC$ as $AIC = -2L(\theta) +2k$ where $k$ is your number of free parameters and $L(\theta)$ the value of the log-likelihood ...


2

In Lavaan, $R^2$ is a byproduct of the other parameters, it's not a parameter that is directly calculated. So $R^2$ for Var3 depends on the variance of var3, and the size of the path from var2 to var3. And these all depend on the loading. When you add something to a model (var4) this can have effects all over the model - people sometimes talk about mis-...


2

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 lmer() if possible and lavaan if needed. You can make random effects independent (not correlated) with lme4::lmer(): library(lme4) fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy) ...


2

I was curious about this as well and came across the following message from Yves Rosseel (the developer of lavaan): Dear lavaan users, lavaan 0.5-21 has been released on CRAN today (7 Sept 2016). New features and user-visible changes: robust RMSEA and CFI values are now computed correctly, following Brosseau-Liard, P. E., Savalei, V.,...


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