Displaying 20 results from an estimated 1000 matches similar to: "cor.test(x,y)"
2008 Jan 02
2
strange behavior of cor() with pairwise.complete.obs
Hi all,
I'm not quite sure if this is a feature or a bug or if I just fail to understand
the documentation:
If I use cor() with pairwise.complete.obs and method=pearson, the result is a
scalar:
->cor(c(1,2,3),c(3,4,6),use="pairwise.complete.obs",method="pearson")
[1] 0.9819805
The documentation says that
" '"pairwise.complete.obs"' only
2010 Feb 08
2
Incorrect Kendall's tau for ordered variables (PR#14207)
Full_Name: Marek Ancukiewicz
Version: 2.10.1
OS: Linux
Submission from: (NULL) (74.0.49.2)
Both cor() and cor.test() incorrectly handle ordered variables with
method="kendall", cor() incorrectly handles ordered variables for
method="spearman" (method="person" always works correctly, while
method="spearman" works for cor.test, but not for cor()).
In
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
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 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
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
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
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:
2012 Mar 07
2
how to see inbuilt function(cor.test) & how to get p-value from t-value(test of significance) ?
i can see source code of function
> cor
function (x, y = NULL, use = "everything", method = c("pearson",
"kendall", "spearman"))
{
na.method <- pmatch(use, c("all.obs", "complete.obs",
"pairwise.complete.obs",
"everything", "na.or.complete"))
2008 Apr 01
1
SEM with a categorical predictor variable
Hi,
we are trying to do structural equation modelling on R. However, one of our
predictor variables is categorical (smoker/nonsmoker). Now, if we want to
run the sem() command (from the sem library), we need to specify a
covariance matrix (cov). However, Pearson's correlation does not work on the
dichotomous variable, so instead we produced a covariance matrix using the
Spearman's (or
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
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
2012 Jun 25
2
Fast Kendall's Tau
Hello.
Has any further action been taken regarding implementing David Simcha's fast Kendall tau code (now found in the package pcaPP as cor.fk) into R-base? It is literally hundreds of times faster, although I am uncertain as to whether he wrote code for testing the significance of the parameter. The last mention I have seen of this was in 2010
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",
2011 May 16
2
about spearman and kendal correlation coefficient calculation in "cor"
Hi,
I have the following two measurements stored in mat:
> print(mat)
[,1] [,2]
[1,] -14.80976 -265.786
[2,] -14.92417 -54.724
[3,] -13.92087 -58.912
[4,] -9.11503 -115.580
[5,] -17.05970 -278.749
[6,] -25.23313 -219.513
[7,] -19.62465 -497.873
[8,] -13.92087 -659.486
[9,] -14.24629 -131.680
[10,] -20.81758 -604.961
[11,] -15.32194 -18.735
To calculate the ranking
2005 Aug 13
1
R/S-Plus/SAS yield different results for Kendall-tau and Spearman nonparametric regression
Colleagues,
I ran some nonparametric regressions in R (run in RedHat Linux), then
a colleague repeated the analyses in SAS. When we obtained different
results, I tested S-Plus (same Linux box). And, got yet different
results. I replicated the results with a small dataset:
DATA:
37.5
23
37.5
13
25
16
25
12
100
15
12.5
19
50
20
100
13
100
10
100
10
100
16
50
10
87.5
2010 Jun 18
4
Root mean square on binned GAM results
Hi,
Standard correlations (Pearson's, Spearman's, Kendall's Tau) do not
accurately reflect how closely the model (GAM) fits the data. I was told
that the accuracy of the correlation can be improved using a root mean
square deviation (RMSD) calculation on binned data.
For example, let 'o' be the real, observed data and 'm' be the model data. I
believe I can calculate
2006 Sep 13
1
S in cor.test(..., method="spearman")
Dear HelpeRs,
I have some data:
"ice" <- structure(c(0.386, 0.374, 0.393, 0.425, 0.406, 0.344,
0.327, 0.288, 0.269, 0.256, 0.286, 0.298, 0.329, 0.318, 0.381,
0.381, 0.47, 0.443, 0.386, 0.342, 0.319, 0.307, 0.284, 0.326,
0.309, 0.359, 0.376, 0.416, 0.437, 0.548, 41, 56, 63, 68,
69, 65, 61, 47, 32, 24, 28, 26, 32, 40, 55, 63, 72, 72, 67,
60, 44, 40, 32, 27, 28, 33,
2004 Jul 09
1
cor.test p-value ties
R:
I got a warning message when running the cor.test function using both
Spearman and Kendall rank correlations saying that the p-value may be
incorrect due to ties in the data. My data has 35 obs and one series has
6 pairs of ties. Does anyone know if this would likely have a great
effect on the p-values calculated.. The values look good; tau = -0.68
with p-value = 8e-9 and rho = =0.84
2002 Apr 25
3
Kendall's tau
A search of the archives did not reveal an answer:
For basic tests of association, where one has no a priori knowledge of the
form of the relation or of the distributions of the variables, rank
correlation seems like a good start. Why is cor.test() with Kendall and
Spearman options relegated to the ctest package, rather than in the base
package? Does this suggest that the developers consider