Skip to content

Coding help

2 messages · Ayyappa Chaturvedula, Petr Savicky

#
On Wed, Feb 29, 2012 at 11:58:04AM -0500, Ayyappa Chaturvedula wrote:
Hi.

Can you provide a numerical example? This may require some
more data, where the column CONC has more than one value.

Another question is, what do you mean by computing percentile
for data. I would expect that you specify a number P, such
that 0 \le P < 100 and compute P-th percentile in some data.

Do you want to compute the inverse operation? This would
mean to compute P for each value in the data. For your
column DV, this would be

  DV <- c(156.84,146.56,115.13,207.81,129.53,151.48,158.95,192.37,32.97,151.66)
  p <- 100*(rank(DV)-1)/length(DV)
  cbind(DV, p)

            DV  p
   [1,] 156.84 60
   [2,] 146.56 30
   [3,] 115.13 10
   [4,] 207.81 90
   [5,] 129.53 20
   [6,] 151.48 40
   [7,] 158.95 70
   [8,] 192.37 80
   [9,]  32.97  0
  [10,] 151.66 50

This need not be, what you want. In this case, provide a numerical
example.

Petr Savicky.