model fit indices using Lavaan Vs Mplus

89 views
Skip to first unread message

Win Phyu Thwe

unread,
Sep 1, 2022, 6:57:57 PM9/1/22
to lavaan
Hello,
I'm the new user of R, trying to run the confirmatory factor analysis with Lavaan package.
Before that, in Mplus , my model is fitted with excellent values of CFI, GFI and TLI..
But in R, these indices are below 0.85.
Any suggestions would be appreciated.

Chesnut, Ryan

unread,
Sep 1, 2022, 7:45:20 PM9/1/22
to lav...@googlegroups.com
Hi Win,

Can you post your syntax? That will help narrow down the problem.

Best,

Ryan

---
Ryan P. Chesnut, PhD
Assistant Research Professor
Clearinghouse for Military Family Readiness
The Pennsylvania State University
402 Marion Place
University Park, PA 16802


From: lav...@googlegroups.com <lav...@googlegroups.com> on behalf of Win Phyu Thwe <winnph...@gmail.com>
Sent: Thursday, September 1, 2022 6:57 PM
To: lavaan <lav...@googlegroups.com>
Subject: model fit indices using Lavaan Vs Mplus
 
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/ef01ba37-33f1-460e-b70b-9be66249dff9n%40googlegroups.com.

Jeremy Miles

unread,
Sep 1, 2022, 9:43:07 PM9/1/22
to lav...@googlegroups.com
Is everything else the same? Sample covariance matrix and means, parameters, standard errors, df, null model, etc.

J

Win Phyu Thwe

unread,
Sep 2, 2022, 5:51:54 AM9/2/22
to lav...@googlegroups.com
Thank you Ryan and J.
all are different in R studio.
Here is my syntax.
Hope you can give me some advice on how to improve my codes.
Thank you so so much.

Yours sincerely,
Win

syntax.R

Chesnut, Ryan

unread,
Sep 2, 2022, 8:42:45 AM9/2/22
to lav...@googlegroups.com
Hi Win,

Do any of the indicators need to be treated as ordinal? Do you have any missing data you need to account for?

One thing you could check is the number of model parameters estimated in the summary output (it's toward the very top) and the degrees of freedom to see if those match Mplus.

Best,

Ryan

---
Ryan P. Chesnut, PhD
Assistant Research Professor
Clearinghouse for Military Family Readiness
The Pennsylvania State University
402 Marion Place
University Park, PA 16802


Sent: Friday, September 2, 2022 5:51 AM
To: lav...@googlegroups.com <lav...@googlegroups.com>
Subject: Re: model fit indices using Lavaan Vs Mplus
 

Win Phyu Thwe

unread,
Sep 2, 2022, 1:16:16 PM9/2/22
to lav...@googlegroups.com
Dear Ryan,
Thank you so much for your advice.
All of my indicators should be scale.
As I found one missing data, I fixed it. Though the CFI and TLI values remains the same and are not acceptable. In Mplus, these values are really high ( I attached Mplus fit here ).
Number of parameters and df values in R are same with the ones in Mplus.
How can I improve my CFI and TLI values in R?

Yours sincerely,
Win

You received this message because you are subscribed to a topic in the Google Groups "lavaan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lavaan/Slwe0E0G4-Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lavaan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/BL0PR02MB44979B650A9138179B51A656BB7A9%40BL0PR02MB4497.namprd02.prod.outlook.com.
ModelFit(Win).png

Chesnut, Ryan

unread,
Sep 2, 2022, 1:54:52 PM9/2/22
to lav...@googlegroups.com
Are you using a robust ML estimator such as MLM, MLR, MLMV in Mplus? If so, to do that in lavaan, you need to add the estimator argument to your fitting function. Here is an example for MLM:

cfa(LLLCS, data=pilot, estimator="MLM")

When you do that, you will be presented with a second column that will include scaled fit indices along with a couple of additional rows that will provide robust fit indices. If robust indices are provided, it is my understanding that you should rely on those over the scaled indices.

---
Ryan P. Chesnut, PhD
Assistant Research Professor
Clearinghouse for Military Family Readiness
The Pennsylvania State University
402 Marion Place
University Park, PA 16802


Sent: Friday, September 2, 2022 1:15 PM

Win Phyu Thwe

unread,
Sep 5, 2022, 10:41:58 AM9/5/22
to lav...@googlegroups.com
Thank you for your valuable suggestion.
Your help works perfectly.
I used the estimator as MLM and then it shows robust CFI and TLI which are above 0.92. 
Can I use these robust values for interpretation of my model as the acceptable one?
And I attach my plot here as I want to get some advice to improve these plots for the purpose of good publication.
Thank you so so much, Ryan.

Rplot.pdf

Shu Fai Cheung

unread,
Sep 5, 2022, 11:07:10 AM9/5/22
to lavaan
Did you use semPaths in semPlot? If yes, you can try using set_cfa_layout in the semptools package to modify the output:


However, I have never generated a 8-factor model. Making the diagram readable may not be easy.

(Declaring a conflict of interest: I am the maintainer and one of the authors of semptools.)

Some of my friends like using tidySEM. I haven't tried it but you can also take a look and see whether it suits your needs:


Hope this helps.

-- Shu Fai

Win Phyu Thwe

unread,
Sep 5, 2022, 11:15:03 AM9/5/22
to lav...@googlegroups.com
Thank you, Chu Fai.
Yes, I used the semplot package.
I will try it in the semtools and tidySEM.
I feel great to meet the author of semtools.

Yours sincerely,
Win


Shu Fai Cheung

unread,
Sep 5, 2022, 11:27:54 AM9/5/22
to lavaan
semTools is another package, which I also use myself. A great one (mine is not).

The one I mentioned is semptools, "p" for plots. (I should have thought of a different name ... but it's a long time ago and the occasional confusion is totally unintentional.), which is much more focused (just for editing plots and nothing more).

If you are new to lavaan, then you definitely should take a look at the list of functions available in semTools:


Sorry for the confusion caused, to you and to others.

-- Shu Fai
Reply all
Reply to author
Forward
0 new messages