[R] what does this error mean?
Prof Brian Ripley
ripley at stats.ox.ac.uk
Sat Sep 13 21:42:01 CEST 2003
cor.test does not have an na.action argument unless used with the formula
interface, when it is better to use na.action=na.omit, not "na.omit".
The error message occurs if less than 2 rows are completely non-missing.
So take a closer look at your data.
BTW, I would compare the different methods of cor.test, not cor.test with
cor, to check I really had this right.
On Sat, 13 Sep 2003 szhan at uoguelph.ca wrote:
> Dear R-users:
> I am runing R 1.6.2 with Windows XP. I try to calculate Pearson correlation
That's long obselete, as you know.
> and Spearman correlation of any pairwise columns of 8000 x 80 data
> matrix with missing values and randomize the matix 1000 times and
> calculate this two correlations again. The code bellow for Pearson is
> working fine but for Spearman got the error bellow for randomized data
> matrix and R console is stop working:
And what does that last phrase mean? (And `bellow' is not something you
should do on a public list.)
> cor (raw2[,i], raw2[,j], use="complete.obs")
> cor.test (raw2[,i], raw2[,j], method="spearman", na.action = "na.omit")
> Error in cor.test.default(raw2[, i], raw2[, j], method = "spearman", na.action
> = "na.omit") :
> not enough finite observations
> In addition: There were 50 or more warnings (use warnings() to see the first
> What does the Error mean? How to fix it?
> Any suggestion are highly appreciated?
Brian D. Ripley, ripley at stats.ox.ac.uk
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, UK Fax: +44 1865 272595
More information about the R-help