Skip to content

cor < -1

1 message · Oliver Soong

#
I'm having what looks like a quantization problem with cor on R 2.7.0.
 I get warnings from cor.test because r < -1.  R session output is at
the bottom.  A simple fix would be to add the appropriate checks to
the end of the internal cor code.

Oliver
Pearson's product-moment correlation

data:  x and y
t = NaN, df = 13, p-value = NA
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 NaN NaN
sample estimates:
cor
 -1

Warning messages:
1: In sqrt(1 - r^2) : NaNs produced
2: In atanh(r) : NaNs produced
[1] TRUE
[1] -2.220446e-16
[1] TRUE
[1] FALSE