plotdeplot.lmscreg | R Documentation |
Plots a probability density function associated with a LMS quantile regression.
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, ...)
answer |
Output from functions of the form
|
y.arg |
Numerical vector. The values of the response variable at which to evaluate the density. This should be a grid that is fine enough to ensure the plotted curves are smooth. |
add.arg |
Logical. Add the density to an existing plot? |
xlab , ylab |
Caption for the x- and y-axes. See |
xlim , ylim |
Limits of the x- and y-axes. See |
llty.arg |
Line type.
See the |
col.arg |
Line color.
See the |
llwd.arg |
Line width.
See the |
... |
Arguments passed into the |
The above graphical parameters offer some flexibility when plotting the quantiles.
The list answer
, which has components
newdata |
The argument |
y |
The argument |
density |
Vector of the density function values evaluated at |
While the graphical arguments of this function are useful to the user, this function should not be called directly.
Thomas W. Yee
Yee, T. W. (2004). Quantile regression via vector generalized additive models. Statistics in Medicine, 23, 2295–2315.
deplot.lmscreg
.
fit <- vgam(BMI ~ s(age, df = c(4,2)), lms.bcn(zero = 1), bmi.nz)
## Not run: 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 (orange)")
deplot(fit, x0 = 40, y = y, add = TRUE, col = "blue", llwd = 2)
deplot(fit, x0 = 60, y = y, add = TRUE, col = "orange", llwd = 2) -> aa
names(aa@post$deplot)
aa@post$deplot$newdata
head(aa@post$deplot$y)
head(aa@post$deplot$density)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.