[R] Percentiles in R

Xavier Abulker xavier_abulker at yahoo.fr
Tue Sep 11 17:53:18 CEST 2007


It looks like 
prctile(X,p) is the same as quantile(X,p)

i.e
x<-0:100
quantile(x,0.5) is the median(x)
and 
quantile(x,0.1)=10 is the value that is greater than 10% percent of the
values in X


&quot;José Luis Aznarte M.&quot; wrote:
> 
> Hi there! Still struggling to translate Matlab code into R's tsDyn
> package.
> Here is my question: Is there in R an equivalent function to Matlab's 
> prctile()? To the moment I thought it was quantile(), but I just 
> realized I was wrong. The definition of the Matlab function:
> 
> prctile
> Percentiles of a sample
> SyntaxY = prctile(X,p)
> Description
> Y = prctile(X,p) calculates a value that is greater than p percent of 
> the values in X. The values of p must lie in the interval [0 100]. For 
> instance, if p = 50 then Y is the median of X
> 
> Thanks!!
> 
> -- 
> --                                                      --
> Jose Luis Aznarte M.       http://decsai.ugr.es/~jlaznarte
> Department of Computer Science and Artificial Intelligence
> Universidad de Granada           Tel. +34 - 958 - 24 04 67
> GRANADA (Spain)                  Fax: +34 - 958 - 24 00 79
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
View this message in context: http://www.nabble.com/Percentiles-in-R-tf4423440.html#a12617896
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list