percentile.lcens: Empirical Cumulative Percent

View source: R/percentile.lcens.R

percentile.lcensR Documentation

Empirical Cumulative Percent

Description

Computes the empirical cumulative percent or percent exceedance of observed data for specific values: methods for "lcens" and "qw" data.

Usage

## 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, ...)

Arguments

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 FALSE and there are missing values in x, then the result will be NA. The default value is TRUE.

percent

a logical value indicating whether the result should be expressed as a percent or proportion. The default value, TRUE, will express the result as a percent.

exact

logical, if TRUE, then force strict comparisons. Any other value is ignored in the current version.

...

not used, required for method function

Value

A named vector as long as q corresponding to the requested value.

Note

The stats package contains the ecdf function that performs a similar function when test is "<=."

See Also

ecdf

Examples


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)


USGS-R/smwrQW documentation built on Oct. 11, 2022, 6:13 a.m.