Skip to content
Prev 155889 / 398502 Next

making spearman correlation cor() call fail with log(0) as input

Just out of curiosity, why do you want the spearman rank correlation to error in this case?

One of the advantages of the spearman correlation is that it is invariant to monotone transformations, so most people that use it see the fact that corr(x,y, method='spearman') gives the same answer as cor(log(x), exp(y), method='spearman') to be the desired result.

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
(801) 408-8111