Displaying 20 results from an estimated 211 matches for "spearman".
2006 Dec 05
1
Spearman correlation ties and discrepancies
Hi. I am currently trying to run some Spearman correlations, and have
encountered two issues.
1) When using cor.test() with a variable that includes ties, I get the
"Cannot compute exact p-values with ties" error. I have read that this
function now uses an asymptotic formula that allows for ties, so do not
understand why I am ge...
2004 Mar 15
1
spearman rank correlation problem
Hello R gurus,
I want to calculate the Spearman rho between two ranked lists. I am
getting results with cor.test that differ in comparison to my own
spearman function:
> my.spearman
function(l1, l2) {
if(length(l1) != length(l2)) stop("lists must have same length")
r1 <- rank(l1)
r2 <- rank(l2)
dsq <- s...
2023 Nov 15
1
Cannot calculate confidence intervals NULL
I believe the problem is here:
cor1 <- cor(x1, y1, method="spearman")
cor2 <- cor(x2, y2, method="spearman")
The x's and y's are not looked for in data (i.e. NSE) but in the
environment where the function was defined, which is standard evaluation.
Change the above to:
cor1 <- with(d, cor(x1, y1, method="spearman"))
cor2 &l...
2023 Nov 15
2
Cannot calculate confidence intervals NULL
...ts I am expecting.
Here is the result I get:
[1] "All values of t are equal to 0.28611928397257 \n Cannot calculate confidence intervals"
NULL
If someone knows how to solve my problem, really appreciate.
Best,
S
#########################################################
# Difference in Spearman rho?
library(boot)
?
x1=c(4,6,5,7,8,4,2,3,5.5,6.7,5.5,3.5,2,1,3,5,6,3.5,2.5,2,1,2,3,2,1,2,3,4,3,4)
?
y1=c(10,14,12.5,21,15,16,17.5,11,11.5,21,19,16,17.5,18,18.5,12,13,14,11,11,12,18,20,13,23,12,11,14,16,11)
?
x2=c(5,3,4,2,1,1,1,2,3,4,5,4,3,2,1,3,4.5,4.5,5.5,6,5,4,7,8,3,4,2,5,4,3)
?
y2=c(11,12,13,1...
2008 Feb 28
4
p-value in Spearman rank order
Dear R-helpers,
I would like to do a Spearman rank order test, and used the cor() function
with the method "spearman".
It gives me a number (correlation coefficient?) , but how can I get the
p-value?
Thank you for the help in advance!
Regards,
Anne-Katrin
--
[[alternative HTML version deleted]]
2005 Oct 24
2
Spearman's Rho Help!
...80091,68.37158664,156.3179887,134.8930305,80.25242044,100.5309559,266.4470408,65.4934171,22.86950128)
v=(150.2099947,73.52000706,83.18122348,150.3240468,352.9101222,195.8919089,263.9489287,114.2090369,153.5000165,18.62309563,117.2399949,441.8981252,285.3369951,161.3959985,NA,NA)
I want to find the spearman's rho for this data. To my knowledge spearman's
rho is for x vs. y or x vs. z or any combination. Is there a spearman's rho
for the data all together (x y z v)? Please help!
Thanks a bunch.
suresh
2012 Aug 29
3
Help on calculating spearman rank correlation for a data frame with conditions
Dear all,
Suppose my data frame is as follows:
id price distance
1 2 4
1 3 5
...
2 4 8
2 5 9
...
n 3 7
n 8 9
I would like to calculate the rank-order correlation between price and
distance for each id.
cor(price,distance,method = "spearman") calculate a correlation for all.
Then I tried to use
apply(data,list='id',cor(price , distance , method = "spearman"))
to
[[alternative HTML version deleted]]
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 = 20486, p-value = < 2.2e-16
alternative hypothesis: true rho is not equal to...
2007 May 29
2
R's Spearman
Hi all,
I am trying to figure out the formula used by R's Spearman rho (using
cor(method="spearman")) because I can't seem to get the same value as by
calculating "by hand". Perhaps I'm using "cor" wrong, but I don't know
where. Basically, I am running these commands:
> y=read.table(file="tmp",header=TR...
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...
2007 Sep 19
2
By() with method = spearman
...code works just fine.
by(tmp[,c('mtsc07', 'DCBASmathscoreSPRING')], tmp$Grade, cor,
use='complete', method='pearson')
However, this generates an error
by(tmp[,c('mtsc07', 'DCBASmathscoreSPRING')], tmp$Grade, cor,
use='complete', method='spearman')
Error in FUN(data[x, ], ...) : 'x' is empty
I can subset the data by grade and compute spearman rho as
tmp5 <- subset(tmp, Grade == 5)
cor(tmp5[,c('mtsc07', 'DCBASmathcountSPRING')], use='complete',
method='spearman')
But doing this iteratively is...
2016 Apr 29
2
lm() with spearman corr option ?
...color = "red",
size = 3,
linetype = "solid",
fill = "transparent"
)
)
}
p
}
Basically, this function draws red squares over pairwise corr plots with p<0.05. Now, since I need to use the spearman rank corr, I tried to modify the lm function by adding ?method=spearman? but this did not work at al. Could anybody suggest the way to add the spearman rank corr function in this particular function ?
Thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name:...
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:
rho
1
> 1 / factorial(10)
[1] 2.755732e-07
Since we have perfect rank corr...
2002 Apr 26
2
Spearman Correlation
Hi all,
Is there a convenient way to calculate Spearman correlation coefficients in
R?
Nick
Nianqing Xiao, Ph.D
NCI Center for Bioinformatics, NIH
SAIC/Advanced Systems Group
> 6116 EXECUTIVE BLVD 4026J
> MSC 8335
> BETHESDA MD 20852
Phone: 301-451-6357
Fax: 301-480-4222
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-...
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 a...
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.981...
2010 Apr 24
1
Multiple Correlation coefficient (spearman, Kenall)
Hi,
I'm currently trying to find/define a relationship between one dependent and
several independant variables.
The problem is that i cannot use the normal multiple regression/correlation
in Spss because the data is not normal distributed.
i calculated the spearman roh and Kendalls tau Correlation and also some
partial correlations in R.
Now i wanna find out the the multiple correlation coeffcient for Kendalls
Tau and spearmans roh and check if it is signifikant.
unfortunately i cannot find a way to do that in R.
any sugestions?
thank you in advance
--...
2011 Jan 21
0
Possible bug in Spearman correlation with use="pairwise.complete.obs"
Hi,
I have just encountered a strange behaviour from 'cor' with regards to
the treatment of NAs when calculating Spearman correlations. I guess it
is a subtle bug.
If I understand the help page correctly, the two modes 'complete.obs'
and 'pairwise.complete.obs' specify how to deal with correlation
coefficients when calculating a correlation _matrix_. When calculating a
single (scalar) correlation...
2003 Sep 13
2
what does this error mean?
Dear R-users:
I am runing R 1.6.2 with Windows XP. I try to calculate Pearson correlation
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
worki...
2005 Aug 13
1
R/S-Plus/SAS yield different results for Kendall-tau and Spearman nonparametric regression
...20
100
13
100
10
100
10
100
16
50
10
87.5
13
100
15
50
11
100
14
50
19
87.5
20
100
20
37.5
20
100
13
100
14
50
15
100
17
100
14
Code for S-Plus and R:
DATA <- read.table("NonparametricRegressionData")
cor.test(DATA[,1], DATA[,2], method = "spearman")
cor.test(DATA[,1], DATA[,2], method = "kendall")
-------------------------------------------------------------
S-Plus (version 6)
> cor.test(DATA[,1], DATA[,2], method = "spearman")
Spearman's rank correlation
data: DATA[, 1] and DATA[, 2]
normal-z =...