running CFA in lavaan - displaying correlation between latent variables

3,256 views
Skip to first unread message

isomitzi

unread,
Oct 4, 2015, 7:49:18 AM10/4/15
to lavaan
hello all.

trying to run CFA in lavaan and although i know how to run it in R, still not sure what "modifications" should be made to my model.

i have 20 items on a likert scale (1-5) that should map onto 5 constructs (according to the theory). the basic model syntax should be:

F1 =~ I1+I2+I3+I4
F2 =~ I5 + I6 + I7

etc' etc' .....

this basically the same idea as the example in the lavaan webpage : http://lavaan.ugent.be/tutorial/cfa.html

my questions are:

1. in this default setting, the correlation between the latent factors is calculated. is that true ? F1 ~ F2 adds the regression but i'm not sure i understand the difference and when should i add this
 
 
2. is there a way to plot the CFA to show the results but also include the correlation between the factors? i've looked into semPaths in the semPlot package but i don't understand what is displayed on the arrow connecting the latent factors. i think that it might be the covariance  but i'm not sure.


3. lastly, how do i know to modify my model ( adding F1~~F2, fixing parameters, etc')? looking at the website and what people write here shows that you can go a lot deeper into the model then the basic syntax. 

if it helps the questions, i can add the CFA results. 

thank you all for helping 

Terrence Jorgensen

unread,
Oct 4, 2015, 3:19:56 PM10/4/15
to lavaan
1. in this default setting, the correlation between the latent factors is calculated. is that true ?

The covariance is estimated by default.  To see the correlation, you can print the standardized solution, or you can choose to fix the latent variances to 1 using the argument "std.lv = TRUE"

F1 ~ F2 adds the regression but i'm not sure i understand the difference and when should i add this 

A (simple) regression slope is the covariance divided by the variance of the predictor.  They are therefore equivalent information and yield the same model fit, but they represent different theories.  Use a regression to represent the hypothesis that F2 directly affects F1 (and use the sem() function instead of the cfa() function). Use a covariance when you are agnostic about why F1 and F2 are related.

 2. is there a way to plot the CFA to show the results but also include the correlation between the factors? i've looked into semPaths in the semPlot package but i don't understand what is displayed on the arrow connecting the latent factors. i think that it might be the covariance  but i'm not sure.

Go to the help page and look at the "what" argument.  what = "std" provides the correlation

3. lastly, how do i know to modify my model ( adding F1~~F2, fixing parameters, etc')?

If you are asking how to specify parameters in lavaan syntax, it sounds like you already know.  If you are asking why you would free parameters, that would be up to you.  

SEMNET is a good resource for more general questions about SEM: http://www2.gsu.edu/~mkteer/semnet.html 

Terry

isomitzi

unread,
Oct 5, 2015, 3:06:54 PM10/5/15
to lavaan
Hi Terry and thank you for answering!

1. what is the difference between printing the standardize solution (how to i do that , BTW) and using std.lv? isn't the first option better since it doe's not add more constraints?

2. let's assume that i think F1 and F2 are not two different latent factor but in fact just one factor. i have data from EFA that support that claim, but i wanted to run CFA and show that these two factors have high correlation values and therefore i am just in grouping them togather (even though the classic theory treats them as two facotrs). is my like of thinking valid? 

3. thanks for the link - i'll have a look at it. what bugs me the most is there isn't a well defined "way" to run CFA in lavaan. i have looked at dozens of examples on line and they all differ from one another (fixing values, freeing parameters, fixing variance, ect'). i get the feeling that no matter how i write the model, i am wrong.... :(

again, thanks for helping!!       

Edward Rigdon

unread,
Oct 5, 2015, 10:17:32 PM10/5/15
to lav...@googlegroups.com
1. "std.lv" changes the way the common factors are scaled in the solution.  It does not change the scaling of the observed variables.  The standardized solution (obtained by, for example, the function standardizedSolution(object), where object is your output object from running the cfa, sem or lavaan functions) only rescales parameter estimates and standard errors after the fact--it does not alter the parameter estimation process in any way.  It is purely cosmetic.

2.  EFA and CFA models tend to have many kinds of differences.  EFA models often have a variety of parameteres with nonzero values which are constrained to exactly 0 in a CFA, so results differ.  But all you can do is try it.  My guess if that the CFA will indicate that the soluti0on will be better if the two groups of items are allowed to load on separate factors, unless sample size is low or the correlation between factors is very close to 1.

3.  My impression has always been that lavaan syntax is remarkably straightforward and concise, and the variety of functions provided, including cfa() and sem() offer sensible defaults that make the job even easier.  Start with cfa(), enjoy the defaults, and go from there.
--Ed Rigdon

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at http://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.

isomitzi

unread,
Oct 6, 2015, 9:01:50 AM10/6/15
to lavaan
thank you for answering!

1. so what is the best way to see the correlation between the factors? 

2 & 3  - thanks for the tips, i'll keep it in mind.

thanks!

Terrence Jorgensen

unread,
Oct 7, 2015, 2:28:39 PM10/7/15
to lavaan
1. so what is the best way to see the correlation between the factors? 

Ed already suggested using standardizedSolution(object).  You can also request it with summary(object, standardized = TRUE), and the standardized coefficients it will be in the far right column.

Terry

Reply all
Reply to author
Forward
0 new messages