R - Multigroup CFA Example
Вставка
- Опубліковано 23 лип 2024
- Lecturer: Dr. Erin M. Buchanan
Missouri State University
Summer 2016
This example covers how to perform a multigroup confirmatory factor analysis with two groups walking through the invariance steps suggested by Brown in his Applied CFA book. The lavaan and semTools packages are used to demonstrate measurement invariance and partial invariance.
Lecture materials and assignments available at statisticsofdoom.com.
statisticsofdoom.com/page/str...
Used in the following courses: Structural Equation Modeling
Many thanks for the comprehensive explanations! I found this extremely useful for my current project!
Glad to be of help!
Thank you so much for this video, incredibly helpful!
Thank you,very helpful
Thanks so much, that was helpful!
Thank you very much for this, it was so helpful! All the step that you described worked just perfectly. My only question would be, could you recommend any ways in which i could speed up R? it takes reaaaally much to run the partial invariance command. Thank you!
Wait! I just updated this video because the partial invariance function is gone from semTools! (it is quite slow, but unsurprising given what it's doing, so I got nothing there). If you want to check out the new one, I found using a loop a *bit* faster ua-cam.com/video/t6uHROGalBo/v-deo.html
First of all, thank you so much for your explanation, so helpful for my thesis!
I do have a question that you are maybe able to answer: As soon as I run measurementInvariance() I get a "subscript out of bounds" error while computing the steps manually is not a problem at all using the same fit. Any suggestions how I can fix that? Thank you so much in advance!
Hmm, not sure ... might depend on what you are running as the arguments in that function? Not sure without seeing the code you are using.
Hey, Erin thank you so much for this, it's been incredibly helpful.
I did run into a problem while running
> partial Standardized Loadings of perdi.1 in some groups are less than -1 or over 1. The standardized loadings used in Fisher z transformation are changed to -0.9999 or 0.9999.
Then when that doesn't turn up in other variables I get:
In lav_partable_check(lavpartable, categorical = lavoptions$categorical, :
lavaan WARNING: parameter table does not contain thresholds
when I do the measurementInvariance() with the group.partial
My best guess is that it is a categorical issue - maybe not enough people or something is making it upset. This link might help:
groups.google.com/forum/#!topic/lavaan/QxnaM5eyNv8
Haha, I've read that thread a few times, I've no idea what they're talking about. I'll try and figure it out. I don't think it's a problem with sample size since each group is around 300 people
Hi Erin :) I love your videos! Thank you so much for your valuable contribution.
I have one question about Free CFI. What if I have a model with excellent fit indices in metric yet CFI dropped significantly from config to metric... Do I still need to let an item free?
Yes, it is more about the comparison between models than the overall fit of the models. If there's a big drop in fit, you should figure out way.
@@StatisticsofDOOM Thank you so much for your reply. If I may ask you another thing: Does that mean if the overall CFA (before MI) shows a lack of fit (CFI 0.741, RMSEA 0.125) we could still keep restricting to see what item would make the model fit drop even more?
@@gretaku1306 Generally, you want the model to be good before testing measurement invariance - the idea being that you wouldn't care about invariance because the overall model is bad if the fit statistics were bad. Invariant + bad is still bad.
@@StatisticsofDOOM That makes sense. Thanks for your expertise!
To calculate the latent means why don´t you use:
LV_scores
Depends on your goal for the numbers after the analysis, but yes that would also work.
where I can find what acceptable ranges for fit measures you use? I only found references that CFI>=.9 is considered good fit, while you call models with CFI .8 is acceptable? thank you in advance
That citation is Hu and Bentler 1999 I think. Most people do not consider models in the .8 range as acceptable.
Fantastic! Would you have any suggestion or link for paired data? I'm doing research on Health Related Quality of Life for chronically ill children. Both Parents and Kids filled in the same questionair. Let both items from parents and children load on the same Latent, or let children's items predict parent's items? Or let children's latents predict parent's latents or just try it all?
Tough question - I am unsure - if there was a good reason to do one over the other, that's what I would do. I could see loading onto the same latent or predictiveness (you'd want to specify a direction, but I think the numbers would be the same either way since it's all correlational matrices for SEM). Or maybe you could stack child and parent and use the MG model to determine if there are differences in models for each group.
Thanks for thinking a bit here. It must be wonderful having you as a teacher. I am a teacher my self but only the basics up til MANOVA Discriminant Analyses and Regular CFA, I started my own company, since Leiden University is not giving the care bachelor students deserve (in psychology), and when i see your videos i know there's hope! Well done! If you ever find some article on the question i mentioned, please let me know. If you ever come to Holland, i'd love to show you around!
Appreciate the kind comments! I'll keep my eye out for ideas.
Is Partial invariance and measurement invariance only applicable to CFA or is this applicable to SEM too? Please reply. Thank you.
You could do measurement invariance for any set of structural models, you would just want to change the parts you are looking at based on the type of model (i.e., change to latent means if you are mostly interested in a structural versus measurement model).
Hello Erin,
Thank you for this tutorial!
I have a few questions:
1) Is there any way to see what parameters you can free in order to improve the delta RMSEA?
2) If a scale has a delta RSMEA inferior to 0.001 but the delta CFI superior to 0.01, do we still have to do partial invaraince or can we consider it as invariant?
I mean, is the delta CFI more important than the delta RMSEA?
Thank you!
I would suggest you check out the new video on this topic: ua-cam.com/video/t6uHROGalBo/v-deo.html - it's updated code, as semTools no longer has this function. At the end of that video I cover how to look at the partial invariance, and you could change CFI to RMSEA with a simple edit in the code. I feel like I mostly see change in CFI, but change in RMSEA is ok too, just set your rule at the beginning before you look at the results.
@@StatisticsofDOOM Thank you very much!
@@StatisticsofDOOM So, if I understood it correctly, if I look the change in CFI, a model that has delta CFI 0.01 is considered as invariant? We don't need to have both delta CFI and delta RMSEA below 0.01 to consider one model as invariant?
@@bakaharipotera I almost never look at RMSEA - you could do just CFI, just RMSEA or both if you wanted. I would go with whatever appears to be normal in your research field, and just define what your rule is before you get started (so you aren't tempted to change it if something is "close").
@@StatisticsofDOOM Oh ok, I see. Thank you :)
Thanks for the demo, I try to follow your video's instructions but I got a warning message: In addition: Warning message:
The measurementInvariance function is deprecated, and it will cease to be included in future versions of semTools. See help('semTools-deprecated) for details. So I am unsure how I can get the output for a change in CFI. Thanks a lot!
This is news to me ... looks like you should use the measEq.syntax() function now instead. Use ?measEq.syntax in R to see the help page - I'll have to investigate it myself and update with a new video (does not appear too different but lavaan has done a couple of updates as well).
@@StatisticsofDOOM thanks I have encountered the same problem too. Hope you will update an update soon!
@@chiuk1221 Check out the newest videos - especially this one: ua-cam.com/video/t6uHROGalBo/v-deo.html
How can I run this on R?
How will be my model?
ssc install confa
confa (GROUP1: variable1 variable2) (GROUP2: variable3 variable4 variable5 ) (GROUP3: variable6 variable7 variable8 variable9) (GROUP4: variable10 variable11 variable12 variable13) (GROUP5: variable14 variable15 variable16), from(smart)
estat fitindices
estat correlate
predict
I'm sorry, I don't know this coding language to translate.
There we go again :( Whoops, this page doesn't exist. Move along. (404 error)
We are working on updating the links right now, SEM can be found at: statisticsofdoom.com/page/structural-equation-modeling/