Displaying 20 results from an estimated 2000 matches similar to: "cor.test observations limit"
2009 Nov 30
1
cor.test(method = spearman, exact = TRUE) not exact (PR#14095)
Full_Name: David Simcha
Version: 2.10
OS: Windows XP Home
Submission from: (NULL) (173.3.208.5)
> a <- c(1:10)
> b <- c(1:10)
> cor.test(a, b, method = "spearman", alternative = "greater", exact = TRUE)
Spearman's rank correlation rho
data: a and b
S = 0, p-value < 2.2e-16
alternative hypothesis: true rho is greater than 0
sample estimates:
2004 Oct 14
1
correlating between two vectors of numbers
Hi, R!
Question1:
I am trying to correlate two vectors of numbers (two columns of microarray
signal values) by using the non-parametric Spearman's rank correlation
coefficient rho:
> cor.test(V2.Signal,V3.Signal,method="spearman")
but I get the error message:
Error in if (q > (n^3 - n)/6) pspearman(q - 1, n, lower.tail = FALSE) else
pspearman(q, :
missing value
2004 May 20
1
Spearman probabilities and SuppDists
cor.test and SuppDists give me different P-values for the same
Spearman's rho. Which is correct, or am I doing something wrong?
> x <- c(44.4, 45.9, 41.9, 53.3, 44.7, 44.1, 50.7, 45.2, 60.1)
> y <- c( 2.6, 3.1, 2.5, 5.0, 3.6, 4.0, 5.2, 2.8, 3.8)
> cor.test(x,y,method="spearman")
Spearman's rank correlation rho
data: x and y
S = 48, p-value =
2006 May 24
0
the computation of exact p-value for the nonparametric cor-test with ties
Hello,
I wuold like to propose my modifications of the original cor.test to you : I
tried to calcolate the correct p-value for Spearman and Kendall's test with
ties.
Let me know what you think.
Thanks you for your time.
Antonietta di Salvatore
test <- function(x, ...) UseMethod("test")
test.default <-
function(x, y, alternative = c("two.sided",
2009 Jan 17
1
bug in cor.test(method = "spearman")
Dear R developers:
There is a possible bug in calculating the p-value
for Spearman's rank correlation.
Line 155 in file
R-patched/src/library/stats/R/cor.test.R
is
as.double(round(q) + lower.tail),
I think, it should be
as.double(round(q) + 2*lower.tail),
The reason is that round(q) is expected to be an even number
(the S statistic), so the next feasible value is round(q)+2.
2010 Jun 03
3
ordinal variables
Dear colleagues,
I teach statistics using SPSS. I want to use R instead. I hit on one problem and I need some quick advice. When I want to work with ordinal variables, in SPSS I can compute the median or create a barchart or compute a spearman correlation with no problems. In R, if I "read" the ordinal variable as numeric, then I cannot do a barplot because I miss the category names. If
2005 Aug 23
0
NAs by integer overflow in Spearman's test p-value (PR#8087)
Full_Name: Jan T. Kim
Version: 2.1.0 (and better)
OS: Linux
Submission from: (NULL) (139.222.3.229)
The p value in Spearman's test is NA if the length of x exceeds 46340, due to
an integer overflow, occurring if length(n) > sqrt(2^31):
> n <- 46341;
> set.seed(1);
> x <- runif(n);
> y <- runif(n);
> cor.test(x, y, method =
2005 Aug 23
0
(PR#8087) NAs by integer overflow in Spearman's test p-value
There is an even simpler way: someone wrote n*(n^2-1) as n*(n-1)*(n+1)
and caused the problem.
Your superfluous semicolons do definitely make your code harder to read.
On Tue, 23 Aug 2005 jtk at cmp.uea.ac.uk wrote:
> Full_Name: Jan T. Kim
> Version: 2.1.0 (and better)
> OS: Linux
> Submission from: (NULL) (139.222.3.229)
>
>
> The p value in Spearman's test is NA if
2003 Oct 17
1
correlation matrix in Hmisc
Dear all,
I am trying to compute a matrix of Pearson's `r' or Spearman's `rho'
rank correlation coefficients using rcorr (Hmisc) the following way:
> mx<-rcorr(x, type="spearman")[1]
but then ...
> is.matrix(mx)
[1] FALSE
Even if I use as.matrix the result is not better.
What can I do?
Thank you all
Luca
2002 Sep 05
1
rcorr in Hmisc
Dear list,
I get the following message when I use rcorr in library "Hmisc"
------------------------------------------------------
> rcorr(lskPox0t30, type=c("spearman"))
Error in "[<-.data.frame"(*tmp*, is.na(x), value = 1e+30) :
matrix subscripts not allowed in replacement
------------------------------------------------------
I do not understand
2003 Nov 07
2
Bug in cor.test - Spearman
Greetings.
There seems to be a problem with the P-value computation in the
cor.test with method="spearman". In R1.8.0 (MS Windows) I
seem to be getting intermittently nonsense P-values, but the rho's
are OK. I can get this reproducibly with the toy example attached
where the first use is OK and subsequent calls with the same data
give nonsense. (I have also seen the problem
2007 Aug 23
1
in cor.test, difference between exact=FALSE and exact=NULL
Pardon my ignorance, but is there a difference in cor.test between
exact=FALSE and exact=NULL when method=spearman?
Take for example:
x<-c(1,2,2,3,4,5)
y<-c(1,2,2,10,11,12)
cor.test(x,y, method="spearman", exact=NULL)
This gives an error message,
Warning message: Cannot compute exact p-values with ties in:
cor.test.default(x, y, method = "spearman", exact = NULL)
2010 Jun 08
2
cor.test() -- how to get the value of a coefficient
Hi, all.
Yet another beginner to R : )
I wonder, how it's possible to get the value of a coefficient from the
object produced by cor.test() ?
> cor.test(a, b, method="spearman")
Spearman's rank correlation rho
data: a and b
S = 21554.28, p-value = 2.496e-11
alternative hypothesis: true rho is not equal to 0
sample estimates:
rho
0.6807955
Warning message:
In
2010 Jun 09
1
bug? in stats::cor for use=complete.obs with NAs
Arrrrr,
I think I've found a bug in the behavior of the stats::cor function when
NAs are present, but in case I'm missing something, could you look over
this example and let me know what you think:
> a = c(1,3,NA,1,2)
> b = c(1,2,1,1,4)
> cor(a,b,method="spearman", use="complete.obs")
[1] 0.8164966
> cor(a,b,method="spearman",
2008 Sep 10
3
making spearman correlation cor() call fail with log(0) as input
Hi,
How can I make the cor(x, y, method="spearman") call to produce an
error when the input to it (x, y) produces an error? Here is a simple
example:
> a <- c(0, 1, 2)
> b <- c(100, 2, 4)
## error:
> log(a)
[1] -Inf 0.0000000 0.6931472
## error, as expected:
> cor(log(a), log(b), method="pearson")
[1] NaN
## not an error any more (not expected):
>
2004 Aug 30
1
Wrong result with cor(x, y, method="spearman", use="complete.obs") with NA's???
Hallo!
Is there an error in cor to calculate Spearman
correlation with cor if there are NA's? cor.test gives
the correct result. At least there is a difference.
Or am I doing something wrong???
Does anybody know something about this?
a<-c(2,4,3,NA)
b<-c(4,1,2,3)
cor(a, b, method="spearman", use="complete.obs")
# -0.9819805
cor.test(a, b,
2003 Oct 22
6
Something strange in cor.test in R-1.8.0 (PR#4718)
Full_Name: Ian Wilson
Version: R-1.8.0
OS: Windows (but own compilation)
Submission from: (NULL) (139.133.7.38)
the p-value is incorrect for cor.test using method "spearman" in R-1.8.0. This
was not the case in R-1.7.1.
Version R-1.8.0 on Windows
> cor.test(rnorm(50),rnorm(50),method="spearman")
Spearman's rank correlation rho
data: rnorm(50) and rnorm(50)
S
2009 Apr 17
1
Turning off warnings from cor.test
I would like to turn off the warnings from cor.test while retaining
exact=NULL. Is that possible ?
> cor.test(c(1,2,3,3,4,5), c(1,2,3,3,4,5), method = "spearman")
Spearman's rank correlation rho
data: c(1, 2, 3, 3, 4, 5) and c(1, 2, 3, 3, 4, 5)
S = 0, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
rho
1
Warning message:
In
2004 Mar 03
1
cor(..., method="spearman") or cor(..., method="kendall") (PR#6641)
Dear R maintainers,
R is great. Now that I have that out of the way, I believe I have
encountered a bug, or at least an inconsistency, in how Spearman and
Kendall rank correlations are handled. Specifically, cor() and
cor.test() do not produce the same answer when the data contain NAs.
cor() treats the NAs as data, while cor.test() eliminates them. The
option
use="complete.obs" has
2008 Jun 19
3
how to extract object from stats test output (cor.test)?
Hello,
Is there a way to extract output objects from a stats test without viewing
the entire output? I am trying to do so in the following:
define a vector of length j
for( i in 1: length (vector)) {
vector[i] = cor.test (datavector1, datavector2[i], method=("spearman"))
}
I would like the reported Spearman's rho to be saved in a vector. I have
tried a few different ways of