Displaying 20 results from an estimated 2000 matches similar to: "progressive slowdown during script execution?"
2006 Jun 01
0
progressive slowdown during script execution? [Broadcast ]
You should try to figure out how large x and y need to be, and allocate them
before the computation. "Growing" objects like that in R is very, very,
very bad, as you've found out.
Andy
From: Tim Alcon
>
> I'm an R novice, so I hope my question is a valid one. I'm trying to
> run the following script in the current version of R.
>
> for (i in 1:1640){for
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 <- with(d, cor(x2, y2,
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 getting this error. (I am running version 2.4.0.)
I
2023 Nov 15
2
Cannot calculate confidence intervals NULL
R-Experts,
Here below my R code working without error message but I don't get the results 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
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 <- sapply(r1-r2,function(x) x^2)
1 - ((6 * sum(dsq))
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
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=TRUE,sep="\t")
>
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 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):
>
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
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 =
2016 Apr 29
2
lm() with spearman corr option ?
Hi,
A following function was kindly provided by GGally?s maintainer, Barret Schloerke.
function(data, mapping, ...) {
p <- ggplot(data = data, mapping = mapping) +
geom_point(color = I("blue")) +
geom_smooth(method = "lm", color = I("black"), ...) +
theme_blank() +
theme(panel.border=element_rect(fill=NA, linetype =
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]]
2007 Sep 19
2
By() with method = spearman
I have a data set where I want the correlations between 2 variables
conditional on a students grade level.
This 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',
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 Aug 16
2
bootstrapped correlation confint lower than -1 ?
Dear R users,
Does the results below make any sense? Can the the interval of the
correlation coefficient be between *-1.0185* and -0.8265 at 95%
confidence level?
Liviu
> library(boot)
> data(mtcars)
> with(mtcars, cor.test(mpg, wt, met="spearman"))
Spearman's rank correlation rho
data: mpg and wt
S = 10292, p-value = 1.488e-11
alternative hypothesis: true rho is not
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,
2007 Mar 15
1
Incorrect matrix of spearman correlations .... in 64-bit Linux ... (PR#9568)
Full_Name: Vladimir Obolonkin
Version: tested in 2.0 to 2.4.1
OS: linux, win, mac
Submission from: (NULL) (202.14.96.194)
{{ Subject shortened manually -- to pass anti-spam filters
Original-subject: Incorrect matrix of spearman correlations working \
large (24000 by 425 and 78 by 425 data frames) in 64-bit Linux machines;\
the same code gives correct results in 32-bits Win and
2006 Apr 10
1
[Help] a Correlation Problem
I encounter a statistic problem about correlation.
I use R to test wether two variables are correlated or not.
(pearson correlation)
cor.test(x,y) give a p=5.87....
Because the x, y is not normal distributed (qqplot indicate that) I
also perform
(spearman rank correlation)
cor.test(x,y,method="spearman") give a very significant result p<10e-4