Re: [R] get rid of error in Factor Analysis

2006-07-19 Thread Andrew Robinson
Robert,

try try().

Andrew.

On Wed, Jul 19, 2006 at 10:27:07AM +0200, Robert Mcfadden wrote:
 Dear All,
 
 I wrote a program and there is a loop. At each iteration I use maximum
 likelihood factor analysis (?factanal). Output of factor analysis I use
 later (in this loop). Unfortunately from time to time I get an error message
 (I paste it below) and everything is stopped. Is it possible to write a
 condition that if error appears in factor analysis (FA), change input data
 for FA and do it again? Example
 
  
 
 for (i in 1:1000){
 
 FA-factanal(data,factor=3)
 
 If error appears change data to data2 and do factor analysis again
 
 #rest of the program  
 
 
 
 
 
 }
 
  
 
 Best,
 
 Robert 
 
 
 
 Error in optim(start, FAfn, FAgr, method = L-BFGS-B, lower = lower,  : 
 
 L-BFGS-B needs finite values of 'fn'
 
 In addition: Warning message:
 
 NaNs produced in: log(x)
 
  
 
  
 
  
 
  
 
 
   [[alternative HTML version deleted]]
 
 __
 R-help@stat.math.ethz.ch 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.

-- 
Andrew Robinson  
Department of Mathematics and StatisticsTel: +61-3-8344-9763
University of Melbourne, VIC 3010 Australia Fax: +61-3-8344-4599
Email: [EMAIL PROTECTED] http://www.ms.unimelb.edu.au

__
R-help@stat.math.ethz.ch 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.


[R] get rid of error in Factor Analysis

2006-07-19 Thread Robert Mcfadden
Dear All,

I wrote a program and there is a loop. At each iteration I use maximum
likelihood factor analysis (?factanal). Output of factor analysis I use
later (in this loop). Unfortunately from time to time I get an error message
(I paste it below) and everything is stopped. Is it possible to write a
condition that if error appears in factor analysis (FA), change input data
for FA and do it again? Example

 

for (i in 1:1000){

FA-factanal(data,factor=3)

If error appears change data to data2 and do factor analysis again

#rest of the program  





}

 

Best,

Robert 



Error in optim(start, FAfn, FAgr, method = L-BFGS-B, lower = lower,  : 

L-BFGS-B needs finite values of 'fn'

In addition: Warning message:

NaNs produced in: log(x)

 

 

 

 


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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.


Re: [R] get rid of error in Factor Analysis

2006-07-19 Thread Prof Brian Ripley
?try

On Wed, 19 Jul 2006, Robert Mcfadden wrote:

 Dear All,
 
 I wrote a program and there is a loop. At each iteration I use maximum
 likelihood factor analysis (?factanal). Output of factor analysis I use
 later (in this loop). Unfortunately from time to time I get an error message
 (I paste it below) and everything is stopped. Is it possible to write a
 condition that if error appears in factor analysis (FA), change input data
 for FA and do it again? Example
 
  
 
 for (i in 1:1000){
 
 FA-factanal(data,factor=3)
 
 If error appears change data to data2 and do factor analysis again
 
 #rest of the program  
 
 
 
 
 
 }
 
  
 
 Best,
 
 Robert 
 
 
 
 Error in optim(start, FAfn, FAgr, method = L-BFGS-B, lower = lower,  : 
 
 L-BFGS-B needs finite values of 'fn'
 
 In addition: Warning message:
 
 NaNs produced in: log(x)
 
  
 
  
 
  
 
  
 
 
   [[alternative HTML version deleted]]
 
 __
 R-help@stat.math.ethz.ch 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.
 

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@stat.math.ethz.ch 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.