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

gx.quantile

Estimate the Quantile for a Specified Fractile


Description

Estimates and displays the quantile for a specified fractile of a data set by linear interpolation from the ranked data. If the function is run as temp <- gx.quantile(xx, f) the quantile is not displayed, but retained in temp for subsequent use or display.

Usage

gx.quantile(xx, f, display = TRUE)

Arguments

xx

the data set for which the quantile is to be estimated.

f

the fractile for which the quantile is required, must be in the range zero to 1.

display

the default is to display the fractile and estimated quantile on the current device. If no display is required, set display = FALSE.

Value

q

the estimated quantile.

Note

Any less than detection limit values represented by negative values, or zeros or other numeric codes representing blanks in the data, must be removed prior to executing this function, see ltdl.fix.df.

Any NAs in the data vector are removed prior to estimation.

The result is an approximation, and the result from the quantile function will likely differ by some small amount.

Author(s)

Based on a script shared on S-News by Nick Ellis, April 2002

See Also

Examples

## Make test data available
data(kola.o)
attach(kola.o)

## Estimate the 80th percentile, f = 0.8
gx.quantile(As, 0.8)
temp <- gx.quantile(As, 0.8)
temp

## Clean-up and detach test data
rm(temp)
detach(kola.o)

rgr

Applied Geochemistry EDA

v1.1.15
GPL-2
Authors
Robert G. Garrett
Initial release
2018-03-05

We don't support your browser anymore

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