Description Usage Arguments Details Value Author(s) References See Also Examples
This function calculates quantile-based summary statistics for location, scale and shape of a distribution, unconditional or conditional.
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, ...)
|
fun |
quantile function. |
probs |
a vector of probabilities. |
formula |
an object of class |
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 |
tsf |
transformation to be used. Possible options are |
symm |
logical flag. If |
dbounded |
logical flag. If |
lambda.p, delta.p |
vectors with values of transformation parameters to fit models for quantiles |
lambda.q, delta.q |
vectors with values of transformation parameters to fit models for quantiles |
ci |
logical flag. If |
R |
number of bootstrap replications. |
x |
a numeric vector. |
predictLs |
list of arguments for |
... |
other arguments for |
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
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. |
Marco Geraci
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.
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.