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

cdf.lmscreg

Cumulative Distribution Function for LMS Quantile Regression


Description

Computes the cumulative distribution function (CDF) for observations, based on a LMS quantile regression.

Usage

cdf.lmscreg(object, newdata = NULL, ...)

Arguments

object

A VGAM quantile regression model, i.e., an object produced by modelling functions such as vglm and vgam with a family function beginning with "lms.".

newdata

Data frame where the predictions are to be made. If missing, the original data is used.

...

Parameters which are passed into functions such as cdf.lms.yjn.

Details

The CDFs returned here are values lying in [0,1] giving the relative probabilities associated with the quantiles newdata. For example, a value near 0.75 means it is close to the upper quartile of the distribution.

Value

A vector of CDF values lying in [0,1].

Note

The data are treated like quantiles, and the percentiles are returned. The opposite is performed by qtplot.lmscreg.

The CDF values of the model have been placed in @post$cdf when the model was fitted.

Author(s)

Thomas W. Yee

References

Yee, T. W. (2004). Quantile regression via vector generalized additive models. Statistics in Medicine, 23, 2295–2315.

See Also

Examples

fit <- vgam(BMI ~ s(age, df=c(4, 2)), lms.bcn(zero = 1), data = bmi.nz)
head(fit@post$cdf)
head(cdf(fit))  # Same
head(depvar(fit))
head(fitted(fit))

cdf(fit, data.frame(age = c(31.5, 39), BMI = c(28.4, 24)))

VGAM

Vector Generalized Linear and Additive Models

v1.1-5
GPL-3
Authors
Thomas Yee [aut, cre], Cleve Moler [ctb] (author of several LINPACK routines)
Initial release
2021-01-13

We don't support your browser anymore

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