Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

quantile.grouped.data

Quantiles of Grouped Data


Description

Sample quantiles corresponding to the given probabilities for objects of class "grouped.data".

Usage

## S3 method for class 'grouped.data'
quantile(x, probs = seq(0, 1, 0.25),
         names = TRUE, ...)

Arguments

x

an object of class "grouped.data".

probs

numeric vector of probabilities with values in [0, 1].

names

logical; if true, the result has a names attribute. Set to FALSE for speedup with many probs.

...

further arguments passed to or from other methods.

Details

The quantile function is the inverse of the ogive, that is a linear interpolation of the empirical quantile function.

The equation of the quantile function is

x = (c[j] (Fn(c[j-1]) - q) + c[j-1] (q - Fn(c[j])))/(Fn(c[j]) - Fn(c[j-1]))

for 0 <= q <= 1 and where c[0], …, c[r] are the r + 1 group boundaries and Fn is the empirical distribution function of the sample.

Value

A numeric vector, named if names is TRUE.

Author(s)

See Also

ogive for the smoothed empirical distribution of which quantile.grouped.data is an inverse; grouped.data to create grouped data objects.

Examples

data(gdental)
quantile(gdental)
Fn <- ogive(gdental)
Fn(quantile(gdental))		# inverse function

actuar

Actuarial Functions and Heavy Tailed Distributions

v3.1-2
GPL (>= 2)
Authors
Vincent Goulet [cre, aut], Sébastien Auclair [ctb], Christophe Dutang [aut], Nicholas Langevin [ctb], Xavier Milhaud [ctb], Tommy Ouellet [ctb], Alexandre Parent [ctb], Mathieu Pigeon [aut], Louis-Philippe Pouliot [ctb], Jeffrey A. Ryan [aut] (Package API), Robert Gentleman [aut] (Parts of the R to C interface), Ross Ihaka [aut] (Parts of the R to C interface), R Core Team [aut] (Parts of the R to C interface), R Foundation [aut] (Parts of the R to C interface)
Initial release
2021-03-30

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.