Hello Gustavo,
Not sure if I've got all the details of your metric, but what about this...
xx <- x[ , combn(5,2)]
i <- seq(2, ncol(xx), 2)
colSums(xx[,i-1] > xx[,i] & xx[,i] > 0) / colSums(xx[,i] > 0)
Michael
On 24 September 2010 02:53, Gustavo Carvalho wrote:
> Please consider this matrix:
>
Please consider this matrix:
x <- structure(c(5, 4, 3, 2, 1, 6, 3, 2, 1, 0, 3, 2, 1, 0, 0, 2, 1,
1, 0, 0, 2, 0, 0, 0, 0), .Dim = c(5L, 5L))
For each pair of columns, I want to calculate the proportion of entries
different than 0 in column j (i > j) that have lower values than the entries
in the s
2 matches
Mail list logo