Hi list, I'm performing a series of confirmatory factor analysis on different groupings of items from data collected with questionnaires. There are some missing values. For those sets with no missing values I call factanal(datamatrix,factors=n) where datamatrix is a table of all observations for the items under investigation. This call fails when there are missing values. help(factanal) does not give an example on calls with na.action and and mentiones a formula. (Venables and Ripley, 2002 give only one example on p. 323 for a case where the covariance has already been calculated) Could someone give me an example on such a call for a simple CFA? Thanks for the help. Saluti, Antonio Prioglio -- We are what we repeatedly do. Excellence, then, is not an act, but a habit. Aristoteles /"\ \ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL X - AGAINST MS ATTACHMENTS / \ http://www.gnu.org/philosophy/no-word-attachments.html
Dear Antonio,> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of > Antonio Prioglio > Sent: Tuesday, July 13, 2004 9:32 AM > To: r-help at stat.math.ethz.ch > Subject: [R] Help with factanal and missing values > > Hi list, > > I'm performing a series of confirmatory factor analysis on > different groupings of items from data collected with > questionnaires. There are some missing values. > > For those sets with no missing values I call > factanal(datamatrix,factors=n) > > where datamatrix is a table of all observations for the items > under investigation. > > This call fails when there are missing values. > help(factanal) does not give an example on calls with > na.action and and mentiones a formula. > > (Venables and Ripley, 2002 give only one example on p. 323 > for a case where the covariance has already been calculated) > > Could someone give me an example on such a call for a simple CFA?Two solutions are to use na.omit() to eliminate observations with missing data -- factanal(na.omit(datamatrix), factors=n) -- or to use a formula argument to factanal and pass the data as a data frame via the data argument -- factanal(~ var1 + ... + vark, factors=n, data=as.data.frame(datamatrix)). By the way, what factanal() does would conventionally be described as exploratory, not confirmatory, factor analysis. For the latter, you might try the sem package. I hope that this helps, John
On Tue, 13 Jul 2004, John Fox wrote:> > Two solutions are to use na.omit() to eliminate observations with missing > data -- factanal(na.omit(datamatrix), factors=n) -- or to use a formula > argument to factanal and pass the data as a data frame via the data argument > -- factanal(~ var1 + ... + vark, factors=n, data=as.data.frame(datamatrix)).Thanks this was helpful and more elegant than my solution to select the data with a call to complete.cases().> > By the way, what factanal() does would conventionally be described as > exploratory, not confirmatory, factor analysis. For the latter, you might > try the sem package. >Actually these CFAs are preliminary to a Path Analysis I had ambitions to do with the sem package rather than LISREL. Could you give an example on how to do CFA with sem? Saluti, Antonio Prioglio -- We are what we repeatedly do. Excellence, then, is not an act, but a habit. Aristoteles /"\ \ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL X - AGAINST MS ATTACHMENTS / \ http://www.gnu.org/philosophy/no-word-attachments.html
Dear Antonio,> -----Original Message----- > From: Antonio Prioglio [mailto:a.prioglio at city.ac.uk] > Sent: Tuesday, July 13, 2004 12:50 PM > To: John Fox > Cc: r-help at stat.math.ethz.ch > Subject: RE: [R] Help with factanal and missing values > > On Tue, 13 Jul 2004, John Fox wrote: > > > > Two solutions are to use na.omit() to eliminate observations with > > missing data -- factanal(na.omit(datamatrix), factors=n) -- > or to use > > a formula argument to factanal and pass the data as a data > frame via > > the data argument > > -- factanal(~ var1 + ... + vark, factors=n, > data=as.data.frame(datamatrix)). > > Thanks this was helpful and more elegant than my solution to > select the data with a call to complete.cases(). > > > > > By the way, what factanal() does would conventionally be > described as > > exploratory, not confirmatory, factor analysis. For the latter, you > > might try the sem package. > > > > Actually these CFAs are preliminary to a Path Analysis I had > ambitions to do with the sem package rather than LISREL. > > Could you give an example on how to do CFA with sem?Among the examples in ?sem is a second-order CFA. Regards, John
On Tue, 13 Jul 2004, John Fox wrote:> > Could you give an example on how to do CFA with sem? > > Among the examples in ?sem is a second-order CFA.Ok, sorry I forgot about the Thurstone example as I was focusing on Path Analysis example when reading the sem doc. I understand this is a model taken from another source. In the model specification I notice a F4->F1, F4->F2, F4->F3. This is something I do not understand. In a "normal" case where one is iterested in the factorial validity of the indicator variables, would it be appropiate to use the same specification just omitting the above links? Saluti, Antonio Prioglio -- We are what we repeatedly do. Excellence, then, is not an act, but a habit. Aristoteles /"\ \ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL X - AGAINST MS ATTACHMENTS / \ http://www.gnu.org/philosophy/no-word-attachments.html
On Tue, 13 Jul 2004, John Fox wrote:> > Among the examples in ?sem is a second-order CFA. >Thanks now I have it running, hopefully in a correct way. By the way I notice in the output a GFI index that in your online appendix to your 2002 book describe as an ad hoc measure. Could you comment on how it compares with the Comparative Fit Index (CFI; Bentler, 1990) which according to Byrne 1994 is a revised version of the Bentler-Bonnet (1980) Normed Fit Index? Thanks again for your valuable help. Saluti, Antonio Prioglio -- We are what we repeatedly do. Excellence, then, is not an act, but a habit. Aristoteles /"\ \ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL X - AGAINST MS ATTACHMENTS / \ http://www.gnu.org/philosophy/no-word-attachments.html