medianStats: Median Value

median.lcensR Documentation

Median Value

Description

Computes the sample median: methods for "lcens," "mcens," and "qw" data.

Usage

## S3 method for class 'lcens'
median(x, na.rm = FALSE, ...)

## S3 method for class 'mcens'
median(x, na.rm = FALSE, ...)

## S3 method for class 'qw'
median(x, na.rm = FALSE, ...)

Arguments

x

the censored data object.

na.rm

remove missing values before computation?

...

potentially further arguments for methods; not used in the default or lcens method.

Value

A vector of length one representing the sample median.

Note

The median is computed using the flipped Kaplan-Meier method described in Helsel (2012).

References

Helsel, D.R. 2012, Statistics for censored environmental data using Minitab and R: New York, Wiley, 324 p.

See Also

censQuantile

Examples

median(as.lcens(1:4, 2))


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