[R] Is there a package for EFA with multiple groups?

William Revelle lists at revelle.net
Mon Aug 11 00:20:22 CEST 2014


Dear Josh and Elizabeth,

Josh suggested one way of doing it with the psych package.  As of today, the psych package (version psych_1.4.8) , I have included a new function (faBy) that will work with the statsBy function to do EFA for each of multiple groups.

Basically, it just calls the statsBy function to get correlations for each subgroup, and then applies fa to that output.

Thus,

sb <- statsBy(data, group=“grouping variable”,cors=TRUE)
fb <- faBy(sb,nfactors= how ever many you want)

This version is working its way through the CRAN distribution channels, but can be obtained from the personality-project repository at 
http://personality-project.org/r/   (if using a Mac) or http://personality-project.org/r/src/contrib/   if using a PC.
Look for version 1.4.8

Bill



On Jul 28, 2014, at 5:22 AM, Joshua Wiley <jwiley.psych at gmail.com> wrote:

> Hi Elizabeth,
> 
> In confirmatory factor analysis with multiple groups, the reason one needs
> to estimate the models simultaneously is that, typically, one is interested
> in applying constraints (e.g., forcing all or some of the factor loadings
> to be equal across groups).  In exploratory factor analysis, constraints
> are uncommon (they are somewhat un-exploratory).
> 
> I would suggest simply using the psych package and subsetting your data to
> the particular group, as in:
> 
> efa( data = subset(data, Group == "Group1") )
> 
> efa( data = subset(data, Group == "Group2") )
> 
> etc.
> 
> As you noted, lavaan will allow you to test multiple group CFAs, so if/when
> you are ready to see whether the same configural factor structure or any
> other level of invariance holds across your groups, you can use it.
> 
> Sincerely,
> 
> Josh
> 
> 
> 
> 
> On Mon, Jul 28, 2014 at 2:46 PM, Elizabeth Barrett-Cheetham <
> ebarrettcheetham at gmail.com> wrote:
> 
>> Hello R users,
>> 
>> I’m hoping to run an exploratory and confirmatory factor analysis on a
>> psychology survey instrument. The data has been collected from
>> multiple groups, and it’s likely that the data is hierarchical/has 2nd
>> order factors.
>> 
>> It appears that the lavaan package allows me to run a multiple group
>> hierarchical confirmatory factor analysis. Yet, I can’t locate a
>> package that can run the equivalent exploratory analysis.
>> 
>> Could anyone please direct me to an appropriate package?
>> 
>> Many thanks,
>> 
>> Elizabeth
>> 
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>> 
> 
> 
> 
> -- 
> Joshua F. Wiley
> Ph.D. Student, UCLA Department of Psychology
> http://joshuawiley.com/
> Senior Analyst, Elkhart Group Ltd.
> http://elkhartgroup.com
> Office: 260.673.5518
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

William Revelle		           http://personality-project.org/revelle.html
Professor			           http://personality-project.org
Department of Psychology   http://www.wcas.northwestern.edu/psych/
Northwestern University	   http://www.northwestern.edu/
Use R for psychology             http://personality-project.org/r
It is 5 minutes to midnight	   http://www.thebulletin.org



More information about the R-help mailing list