50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

actuar (version 2.3-3)

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 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.

Value

A numeric vector, named if names is TRUE.

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=cj(Fn(cj1)q)+cj1(qFn(cj)Fn(cj)Fn(cj1) for 0qcj and where c0,,cr are the r+1 group boundaries and Fn is the empirical distribution function of the sample.

See Also

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

Examples

Run this code
# NOT RUN {
data(gdental)
quantile(gdental)
Fn <- ogive(gdental)
Fn(quantile(gdental))		# inverse function
# }

Run the code above in your browser using DataLab