[R] Factor Analysis in R
Gavin Simpson
gavin.simpson at ucl.ac.uk
Sat Aug 8 13:48:03 CEST 2009
On Fri, 2009-08-07 at 19:07 -0700, Arup wrote:
> Hi I am trying to run Factor Analysis using R...I am using the syntax
> factanal(m1, factors=3) but it's giving me an message Error in cov.wt(z) :
> 'x' must contain finite values only
> ...I am using a data set which is having only numeric variables and have
> some NA's also in it..What should I do next..Someone please help me out with
> the syntax..Thanks in advance
NA's are *not* finite, we don't know what value they are.
Read ?factanal
If you specify the model with a formula, you can use the 'na.action'
argument to tell it what to do with missing values. Something like,
factanal(~ ., data = m1, factors = 3, na.action = na.omit)
or do this yourself with
factanal(na.omit(m1), factors = 3)
HTH
G
--
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Dr. Gavin Simpson [t] +44 (0)20 7679 0522
ECRC, UCL Geography, [f] +44 (0)20 7679 0565
Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk
Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/
UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
More information about the R-help
mailing list