Learn R Programming

VGAM (version 0.7-10)

plotdeplot.lmscreg: Density Plot for LMS Quantile Regression

Description

Plots a probability density function associated with a LMS quantile regression.

Usage

plotdeplot.lmscreg(answer, y.arg, add.arg = FALSE, 
    xlab = "", ylab = "density", xlim = NULL, ylim = NULL, 
    llty.arg = par()$lty, col.arg = par()$col, 
    llwd.arg = par()$lwd, ...)

Arguments

Value

  • The list answer, which has components
  • newdataThe argument newdata above from the argument list of deplot.lmscreg, or a one-row data frame constructed out of the x0 argument.
  • yThe argument y.arg above.
  • densityVector of the density function values evaluated at y.arg.

Details

The above graphical parameters offer some flexibility when plotting the quantiles.

References

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

Documentation accompanying the VGAM package at http://www.stat.auckland.ac.nz/~yee contains further information and examples.

See Also

deplot.lmscreg.

Examples

Run this code
fit = vgam(BMI ~ s(age, df=c(4,2)), fam=lms.bcn(zero=1), data=bminz)
y = seq(15, 43, by=0.25)
deplot(fit, x0=20, y=y, xlab="BMI", col="green", llwd=2,
       main="BMI distribution at ages 20 (green), 40 (blue), 60 (red)")
deplot(fit, x0=40, y=y, add=TRUE, col="blue", llwd=2)
deplot(fit, x0=60, y=y, add=TRUE, col="red", llwd=2) -> a

names(a@post$deplot)
a@post$deplot$newdata
head(a@post$deplot$y)
head(a@post$deplot$density)

Run the code above in your browser using DataLab