Order models by AIC

43 views
Skip to first unread message

MARIO GARRIDO ESCUDERO

unread,
May 23, 2019, 7:24:30 AM5/23/19
to lavaan
Morning,
can I get a table with a set of models ordered by AIC or any other parameter in lavaan? 
In addition, 
Where can I look for somethign at this respect.
Thanks!

car...@web.de

unread,
May 23, 2019, 7:42:35 AM5/23/19
to lav...@googlegroups.com
It is quite possible that something like this is built into semTools or lavaan itself. In principle this is not necessary, because you can solve it with plain R. Something like this:
sort(c(m1 = AIC(fit1), m2 = AIC(fit2), m3 = AIC(fit3)), decreasing = FALSE)

In this case you will get a sorted vector. This is also possible with other objects and several fit indices.
Am 23.05.19, 13:24, MARIO GARRIDO ESCUDERO <gaia...@usal.es> schrieb:
--
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 https://groups.google.com/group/lavaan.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/29a8eeaf-987c-4add-bba4-f2bea144efd3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

MARIO GARRIDO ESCUDERO

unread,
May 23, 2019, 9:11:55 AM5/23/19
to lavaan
Thanks so much,
in addition I have found this from Byrnett. 
I am exploring it and seems that implements cAIC for lavaan as well as the sorting. Can anybody more expert in code confirm that?
Thanks


El jueves, 23 de mayo de 2019, 13:42:35 (UTC+2), car...@web.de escribió:
It is quite possible that something like this is built into semTools or lavaan itself. In principle this is not necessary, because you can solve it with plain R. Something like this:
sort(c(m1 = AIC(fit1), m2 = AIC(fit2), m3 = AIC(fit3)), decreasing = FALSE)

In this case you will get a sorted vector. This is also possible with other objects and several fit indices.
Am 23.05.19, 13:24, MARIO GARRIDO ESCUDERO <gaia...@usal.es> schrieb:
Morning,
can I get a table with a set of models ordered by AIC or any other parameter in lavaan? 
In addition, 
Where can I look for somethign at this respect.
Thanks!

--
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 lav...@googlegroups.com.

Terrence Jorgensen

unread,
May 23, 2019, 1:06:40 PM5/23/19
to lavaan
can I get a table with a set of models ordered by AIC

See the compareFit() function in semTools.  The output won't be sorted by any particular fit measure, but it will flag the preferred model for each requested fit measure.
 
I am exploring it and seems that implements cAIC for lavaan as well as the sorting. Can anybody more expert in code confirm that?

By default (sort=TRUE) yes.  But be careful: AICc is an adjustment developed for univariate linear models, not multivariate SEMs.  It does not necessarily generalize (see the note in the ?semTools::moreFitIndices help page).

Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

MARIO GARRIDO ESCUDERO

unread,
May 24, 2019, 8:02:00 AM5/24/19
to lavaan
Thanks so much Terrence,
I see the note in the semTools files. Since Im not an expert on that, can you recommend me any place where can I read about this warning? To know what is the specfic problem

In addition, I was exploring compareFit() function in semTools. I have found it really helpful, thanks. I used it to compare three different models that are nested:
1. the models are defined for lavaan in advance, is ok to compare them like this? or since they are nested Im force to use the nested=TRUE? For whta I see, results are the same but nested=TRUE provides extra comparisons, right?
compareFit(fitTrueModelMod, fitAlternMod1, fitAlternMod2, nested = FALSE)
####################### Model Fit Indices ###########################
                  chisq df pvalue    cfi    tli       aic       bic rmsea  srmr
fitAlternMod2    3.970† 10   .949 1.000† 1.108  1695.831  1755.750  .000† .030†
fitTrueModelMod  4.025  12   .983 1.000† 1.119† 1691.885† 1746.594† .000† .030 
fitAlternMod1   14.671  14   .401  .994   .991  1698.531  1748.029  .022  .059

2. is developed any place not only the comparison and computation of different indexes but also the Akaike weight in the case of AIC?

3. I also used semTools for computing AICc with moreFitIndices() for one of my models AICc= 1703.7313699 and with Byrnes code is 1703.239, should I care about this slight difference?

4. Last, question, is there any command in semTools or lavaan for automatic backward deletion of less significant paths?

Thanks again 

Terrence Jorgensen

unread,
May 26, 2019, 3:39:06 PM5/26/19
to lavaan
can you recommend me any place where can I read about this warning?

The problem is lack of information.  I am not aware of a study showing that AICc doesn't generalize to multivariate models.  The original reference is listed in the help page.

For whta I see, results are the same but nested=TRUE provides extra comparisons, right?

Yes, read the help page for description.

2. is developed any place not only the comparison and computation of different indexes but also the Akaike weight in the case of AIC?

No, that is not a quantity available from fitMeasures().  Read the help page.

should I care about this slight difference?

I think you should not apply AICc beyond what it was designed for.

is there any command in semTools or lavaan for automatic backward deletion of less significant paths?

No.

MARIO GARRIDO ESCUDERO

unread,
May 27, 2019, 8:15:52 AM5/27/19
to lavaan
Thanks a lot Terrence. 
Reply all
Reply to author
Forward
0 new messages