Learn R Programming

Qtools (version 1.0)

qlss: Quantile-based Summary Statistics for Location, Scale and Shape

Description

This function calculates quantile-based summary statistics for location, scale and shape of a distribution, unconditional or conditional.

Usage

qlss(...)
## S3 method for class 'default':
qlss(fun = "qnorm", probs = 0.1, ...)
## S3 method for class 'formula':
qlss(formula, data, type = "rq", tsf = NULL, symm = TRUE, dbounded = FALSE,
lambda.p = NULL, delta.p = NULL, lambda.q = NULL, delta.q = NULL,
probs = 0.1, ci = FALSE, R = 500, predictLs = NULL, ...)
## S3 method for class 'numeric':
qlss(x, probs = 0.1, ...)

Arguments

Value

qlss returns an object of class qlss. This is a list that contains three elements:locationsummary statistic(s) for location.scalesummary statistic(s) for scale.methodsummary statistic(s) for shape.

Details

This function computes a number of quantile-based summary statistics for location (median), scale (inter-quartile range), and shape (Bowley skewness and shape index) of a distribution. These statistics can be computed for unconditional and conditional distributions. In the latter case, a formula specifies a linear quantile function, which is fitted with rq. The default qlss function computes the summary statistics of a standard normal distribution or of any other distribution via the argument fun. The latter must be a function with p as its probability argument (see for example qnorm, qt, qchisq, qgamma, etc.) The argument p

References

Geraci M and Jones MC. Improved transformation-based quantile regression. Canadian Journal of Statistics 2015;43(1):118-132. Gilchrist W. Statistical modelling with quantile functions. Chapman and Hall/CRC; 2000.

See Also

rq, tsrq, tsrq2

Examples

Run this code
# Compute summary statistics of a normal distribution
qlss()

# Compute summary statistics of a t distribution with 3 df
qlss(fun = "qt", df = 3, probs = 0.05)

# Compute summary statistics for a sample using a sequence of probabilities
x <- rnorm(1000)
qlss(x, probs = c(0.1, 0.2, 0.3, 0.4))

# Compute summary statistics for Volume conditional on Height
trees2 <- trees[order(trees$Height),]
fit <- qlss(Volume ~ Height, data = trees2)
plot(fit, z = trees2$Height, xlab = "height")

# Use a quadratic model for Height
fit <- qlss(Volume ~ poly(Height,2), data = trees2)
plot(fit, z = trees2$Height, xlab = "height")

Run the code above in your browser using DataLab