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

qtplot.lmscreg

Quantile Plot for LMS Quantile Regression


Description

Plots quantiles associated with a LMS quantile regression.

Usage

qtplot.lmscreg(object, newdata = NULL,
               percentiles = object@misc$percentiles,
               show.plot = TRUE, ...)

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.", e.g., lms.yjn.

newdata

Optional data frame for computing the quantiles. If missing, the original data is used.

percentiles

Numerical vector with values between 0 and 100 that specify the percentiles (quantiles). The default are the percentiles used when the model was fitted.

show.plot

Logical. Plot it? If FALSE no plot will be done.

...

Graphical parameter that are passed into plotqtplot.lmscreg.

Details

The ‘primary’ variable is defined as the main covariate upon which the regression or smoothing is performed. For example, in medical studies, it is often the age. In VGAM, it is possible to handle more than one covariate, however, the primary variable must be the first term after the intercept.

Value

A list with the following components.

fitted.values

A vector of fitted percentile values.

percentiles

The percentiles used.

Note

plotqtplot.lmscreg does the actual plotting.

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

## Not run: 
fit <- vgam(BMI ~ s(age, df = c(4, 2)), lms.bcn(zero=1), data = bmi.nz)
qtplot(fit)
qtplot(fit, perc = c(25, 50, 75, 95), lcol = "blue", tcol = "blue", llwd = 2)

## End(Not run)

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.