Displaying 20 results from an estimated 8000 matches similar to: "a question"
2011 Aug 04
2
survival probability estimate method
Hi, I was reading a paper published in JCO "Prediction of risk of distant recurrence using 21-gene recurrence score in node-negative and node-positive postmenopausal patients with breast cancer treated with anastrozole or tamoxifen: a TransATAC study" (ICO 2010 28: 1829). The author uses a method to estimate the 9-year risk of distant recurrence as a function of continuous recurrence
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))
2006 Oct 23
2
Recurrence plot in package "tseriesChaos"
Hi,
I'm a new user of the R package, and I need to generate recurrence plots for a set of 56 time series data. The package tseriesChaos has the function "recurr" that gives a plot. But what I really need are the recurrence plot parameters that are calculated from each plot (like %recur, %det, trend, etc...) and that can be stored dynamically in a output file for all the 56 datasets.
2011 Sep 16
3
Problematic If-Else statement
Hi guys,
My code (next 2 lines below) isn't doing what I'm expecting it to:
tmp <-
ifelse(uncurated$days_to_tumor_recurrence=="null","norecurrence","recurrence")
curated$recurrence_status <- tmp
I want the column "recurrence_status" in my output file to have values
"recurrence" (if the input value had a number in the
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]]
2017 Oct 12
1
Recurrence plots in R using different colours
Hello,
I am an absolutely beginner with regards to R, so forgive me for my
potentially very stupid questions.
I have been attempting to create recurrence plots using R. The data I am
using is based on a mutually exclusive and exhaustive coding scheme with
over 40 individual codes which can be assigned to 6 higher order categories.
When I carry out the usual rqa command, my plot is pretty much
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