similar to: rank with ties

Displaying 20 results from an estimated 10000 matches similar to: "rank with ties"

2010 Jan 08
2
A better way to Rank Data that considers "ties"
This will start off sounding very easy, but I think it will be very complicated. Let's say that I have a matrix, which shows the number of apples that each person in a group has. OriginalMatrix<-matrix(c(2,3,5,4,6),nrow=5,ncol=1,byrow=T,dimnames=list(c("Bob","Frank","Joe","Jim","David"),c("Apples"))) Apples Bob 2
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))
2004 Dec 01
2
rank in descending order?
Hi, Is there any simple solution to get ranks in descending order? Example, a <- c(10, 98, 98, 98, 99, 100) r <- rank(a, ties.method="average") produces 1 3 3 3 5 6 I would want this instead: 6 5 3 3 3 1 Note that reversing r doesn't work but in small examples. Thanks, -Jose -- jquesada at andrew.cmu.edu Research associate http://lsa.colorado.edu/~quesadaj Dept. of
2006 Oct 10
3
Rank Function
Does anyone know why the two rank functions gives different results? I need to use the rank function in a "for" loop, so the sequence to be ranked is given values in the form of part (1). How can I use assignment like in part (1) to get correct ranks as in part (2)? Thank You Part (1) i<-1.94 b<-0.95-i c<-1.73-i d<-2.62-i y<-c(0.68,0.95,b,c,d) y 0.68 0.95 -0.99
2007 Aug 06
1
rank in decreasing order
Hi All, I want to give ranks to elements in a column so I used: total_list$field1.rank <- rank(total_list$field1,ties.method="min") But this gives me the rank in increasing order. How do I get the ranks in decreasing order? I know decreasing = FALSE is not a legal argument here. Thanks. Jiong The email message (and any attachments) is for the sole use of the intended recipient(s)
2015 Oct 08
3
rank(, ties.method="last")
Hi, I ran into a problem where I actually need rank(, ties.method="last"). It would be great to have this feature in base and it's also simple to get (see below). Thanks & cheers, Marius rank2 <- function (x, na.last = TRUE, ties.method = c("average", "first", "last", # new "last" "random", "max",
2004 Mar 30
4
rank() vs SAS proc rank
SAS proc rank has ties options of high and low that would allow producing ranks of the type found in the sports pages, e.g., rank (c(1,1,2,2,2,2,3)) == 1 1 3 3 3 3 7 Could R support these ties.methods?
2007 Aug 17
2
problem using "rank"
Hi All, I had 12766 elements in a column, 12566 are values and 200 are "NA"s. I used the following line to get the ranks: total_list$MB.rank <- rank(-total_list$MB,ties.method="min",na.last=NA) but I got an error message: Error in `$<-.data.frame`(`*tmp*`, "BCRP_PW_F.rank", value = c(3949, 6182, : replacement has 12199 rows, data has 12766 What
2007 Jan 11
1
rank function and NA in 2.3.1
Hi. I am using R 2.3.1 on WIndows XP, and I am having trouble with the rank function in the presence of numerical NA data. I want the NA's all to get the same rank, but they don't. Here is an example from my session: >ct_align_rets_f2$liq[6851:6859] [1] 115396 NA 362595 NA 242986 340805 NA 692905 251533
2006 Aug 25
1
exact Wilcoxon signed rank test with ties and the "no longer under development" exactRanksumTests package
Dear List, after updating the exactRanksumTests package I receive a warning that the package is not developed any further and that one should consider the coin package. I don't find the signed rank test in the coin package, only the Wilcoxon Mann Whitney U-Test. I only found a signed rank test in the stats package (wilcox.test) which is able to calculate the exact pvalues but unfortunately
2006 Jun 21
5
rank(x,y)?
Suppose I have two columns, x,y. I can use order(x,y) to calculate a permutation that puts them into increasing order of x, with ties broken by y. I'd like instead to calculate the rank of each pair under the same ordering, but the rank() function doesn't take multiple values as input. Is there a simple way to get what I want? E.g. > x <- c(1,2,3,4,1,2,3,4) > y <-
2001 Nov 28
2
Problems with rank()
If you enter the following values for x and y: x: 2.2 3.7 2.1 0.4 2.8 0.3 0.4 1.4 5.4 6.0 y: 6.0 8.1 1.8 1.3 5.2 0.6 1.0 1.9 6.8 6.5 and do rank(abs(y-x)), you should get two ties, one at 0.3 and one at 0.5. R, and S-Plus5 by that matter recognise the tie at 0.5 and give it rank 3.5, but gives one of the two 0.3 values rank 1 and one of them 2, whereas they should boh be 1.5. Any suggestions? when
2011 Nov 21
2
count ties after rank?
Hello! I need to use Kruskal-Wallis test and post-hoc test (Dunn's test) for my data. But when I searched around, I only found this function: kruskal.test. But nothing for Dunn's test. So I started to write one myself. But I do not know how to count ties in the data frame. I can use for loops but it seems long and unnecessary since the rank function actually knows the ties. So
2006 Oct 10
1
How to assign a rank to a range of values..
>From the following: basin.map <- readAsciiGrid("c:/temp/area.asc", colname="area") I have a SpatialGridDataFrame which has the x and y cordinate of a cell, and the drainage area of that cell. There are many cells with a low drainage area (in my case, 33000 with an area of 37.16) and one cell with the highest drainage area (again, in my case, a drainage area of of
2010 Apr 05
3
A questionb about the Wilcoxon signed rank test
Hi guys,   I have two data sets of prices: endprice0, endprice1   I use the Wilcox test:   wilcox.test(endprice0, endprice1, paired = TRUE, alternative = "two.sided",  conf.int = T, conf.level = 0.9)   The result is with V = 1819, p-value = 0.8812.   Then I calculated the z-value of the test: z-value = -2.661263. The corresponding p-value is: p-value = 0.003892, which is different from
2011 Apr 12
2
The three routines in R that calculate the wilcoxon signed-rank test give different p-values.......which is correct?
I have a question concerning the Wilcoxon signed-rank test, and specifically, which R subroutine I should use for my particular dataset. There are three different commands in R (that I'm aware of) that calculate the Wilcoxon signed-rank test; wilcox.test, wilcox.exact, and wilcoxsign_test. When I run the three commands on the same dataset, I get different p-values. I'm hoping that
2011 Oct 20
1
p-val issue for ranked two-group test
Hi- I'm wondering if anyone can help me with my code. I'm coming up dry when I try to get a p-value from the following code. If I make a histogram of my resampled distribution, I find the difference between by groups to be significant. I've ranked the data since I have outliers in one of my groups. mange= c(35, 60, 81, 158, 89, 130, 90, 38, 119, 137, 52, 30, 27,
2011 Jul 17
1
creating a matrix of ranked column data
I have a data frame (gom) or a matrix of trace metal data and some other observations from water column samples taken at sea (e.g., 19 samples (rows), 19 variables) I can calc. the rank individually from each column of the attached object. How can I create a matrix that contains the ranked data for each variable (either 1-19, ties=avg)? For example: >gom<-read.csv ("gomdata.csv")
2002 May 07
1
Problem with ties in rank()
Hello All: I have a vector of data, z > z [1] 0.1 0.1 0.1 0.1 0.2 0.2 0.3 0.3 0.3 0.4 0.5 0.5 0.5 0.7 0.7 0.7 0.9 0.9 1.1 [20] 1.1 1.2 1.3 1.4 The first 4 elements have values of 0.1 followed 2 elements with values 0.2. When I invoke rank(z), I expected to get (1+2+3+4)/4 = 2.5 for the first 4 elements in the ranking and (5+6)/2 = 5.5 for elements 5 and 6. But what I do
2015 Oct 21
2
rank(, ties.method="last")
Marius Hofert-4------------------------------ > Den 2015-10-09 kl. 12:14, skrev Martin Maechler: > I think so: the code above doesn't seem to do the right thing. Consider > the following example: > > > x <- c(1, 1, 2, 3) > > rank2(x, ties.method = "last") > [1] 1 2 4 3 > > That doesn't look right to me -- I had expected > > >