View source: R/percentile.lcens.R
percentile.lcens | R Documentation |
Computes the empirical cumulative percent or percent exceedance of observed data for specific values: methods for "lcens" and "qw" data.
## S3 method for class 'lcens' percentile(x, q, test = ">=", na.rm = TRUE, percent = TRUE, exact = TRUE, ...) ## S3 method for class 'qw' percentile(x, q, test = ">=", na.rm = TRUE, percent = TRUE, exact = TRUE, ...)
x |
a vector of class "lcens" or "qw" representing the observed data. |
q |
a vector of numeric 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, |
exact |
logical, if |
... |
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(as.lcens(Xr, 2), 1:5) # Compare to the raw data: percentile(Xr, 1:5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.