percentile | R Documentation |
Computes the empirical cumulative percent or percent exceedance of observed data
for specific values.
percentile(x, q, test = ">=", na.rm = TRUE, percent = TRUE, ...) ## Default S3 method: percentile(x, q, test = ">=", na.rm = TRUE, percent = TRUE, ...)
x |
a numeric vector representing the observed data. |
q |
a vector of quantiles for which the cumulative percent or percent exceedence is desired. |
test |
a character string indicating the test. The default value, '>=,' is the percent equalling or exceeding the quantile and '<' would return the cumulative percent below the quantile. |
na.rm |
a logical value indication whether missing values (NAs) should
be removed or not. If na.rm is |
percent |
a logical value indicating whether the result should be
expressed as a percent or proportion. The default value, |
... |
not used, required for method function |
A named vector as long as q
corresponding to the requested
value.
The stats package contains the ecdf
function that performs a
similar function when test
is "<=."
ecdf
set.seed(2342) Xr <- rlnorm(24) # The percentage of the observarions greater than or equal to 2 percentile(Xr, 1:5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.