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

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

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

Usage

1
2
3
4
5
6
7
8
9
qlss(...)
## Default S3 method:
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

fun

quantile function.

probs

a vector of probabilities.

formula

an object of class formula: a symbolic description of the model to be fitted. The details of model specification are given under 'Details'.

data

a data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model.

type

possible options are rq for quantile regression (default) or rqt for transformation-based quantile regression.

tsf

transformation to be used. Possible options are mcjI for Proposal I transformation models (default), mcjI for Proposal II transformation models, bc for Box-Cox and ao for Aranda-Ordaz transformation models.

symm

logical flag. If TRUE (default) a symmetric transformation is used.

dbounded

logical flag. If TRUE the response is assumed to be doubly bounded on [a,b]. If FALSE the response is assumed to be singly bounded (ie, strictly positive).

lambda.p, delta.p

vectors with values of transformation parameters to fit models for quantiles probs. Must be the same length as probs.

lambda.q, delta.q

vectors with values of transformation parameters to fit models for quantiles 1-probs. Must be the same length as probs.

ci

logical flag. If TRUE, bootstrapped confidence intervals for the predictions are calculated.

R

number of bootstrap replications.

x

a numeric vector.

predictLs

list of arguments for predict.rq.

...

other arguments for fun, rq or tsrq.

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

Value

qlss returns an object of class qlss. This is a list that contains three elements:

location

summary statistic(s) for location.

scale

summary statistic(s) for scale.

method

summary statistic(s) for shape.

Author(s)

Marco Geraci

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# 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")

Qtools documentation built on May 2, 2019, 6:09 p.m.