Plots the quantiles associated with a LMS quantile regression.
plotqtplot.lmscreg(fitted.values, object, newdata = NULL,
percentiles = object@misc$percentiles, lp = NULL,
add.arg = FALSE, y = if (length(newdata)) FALSE else TRUE,
spline.fit = FALSE, label = TRUE, size.label = 0.06,
xlab = NULL, ylab = "",
pch = par()$pch, pcex = par()$cex, pcol.arg = par()$col,
xlim = NULL, ylim = NULL,
llty.arg = par()$lty, lcol.arg = par()$col, llwd.arg = par()$lwd,
tcol.arg = par()$col, tadj = 1, ...)
Matrix of fitted values.
Data frame at which predictions are made. By default, the original data are used.
Numerical vector with values between 0 and 100 that specify the percentiles (quantiles). The default is to use the percentiles when fitting the model. For example, the value 50 corresponds to the median.
Length of percentiles
.
Logical. Add the quantiles to an existing plot?
Logical. Add the response as points to the plot?
Logical. Add a spline curve to the plot?
Logical. Add the percentiles (as text) to the plot?
Numeric. How much room to leave at the RHS for the label. It is in percent (of the range of the primary variable).
Caption for the x-axis. See par
.
Caption for the x-axis. See par
.
Plotting character. See par
.
Character expansion of the points.
See par
.
Color of the points.
See the col
argument of par
.
Limits of the x-axis. See par
.
Limits of the y-axis. See par
.
Line type. Line type.
See the lty
argument of par
.
Color of the lines.
See the col
argument of par
.
Line width.
See the lwd
argument of par
.
Color of the text
(if label
is TRUE
).
See the col
argument of par
.
Text justification.
See the adj
argument of par
.
Arguments passed into the plot
function
when setting up the entire plot. Useful arguments here include
main
and las
.
The matrix of fitted values.
The above graphical parameters offer some flexibility when plotting the quantiles.
Yee, T. W. (2004). Quantile regression via vector generalized additive models. Statistics in Medicine, 23, 2295--2315.
# 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)
# }
Run the code above in your browser using DataLab