plot.iMqr {Mqrcm} | R Documentation |
Plot M-Quantile Regression Coefficients
Description
Plots M-quantile regression coefficients
\beta(p)
as a function of p
,
based on a fitted model of class “iMqr
”.
Usage
## S3 method for class 'iMqr'
plot(x, conf.int = TRUE, polygon = TRUE, which = NULL, ask = TRUE, ...)
Arguments
x |
an object of class “ |
conf.int |
logical. If TRUE, asymptotic 95% confidence intervals are added to the plot. |
polygon |
logical. If TRUE, confidence intervals are represented by shaded areas via |
which |
an optional numerical vector indicating which coefficient(s) to plot. If which = NULL, all coefficients are plotted. |
ask |
logical. If which = NULL and ask = TRUE (the default), you will be asked interactively which coefficients to plot. |
... |
additional graphical parameters, that can include xlim, ylim, xlab, ylab, col, lwd, cex.lab, cex.axis, axes, frame.plot.
See |
Details
Using iMqr
, each M-quantile regression coefficient \beta(p)
is described by a linear
combination of known parametric functions of p
. With this command, a plot of
\beta(p)
versus p
is created.
Author(s)
Paolo Frumento paolo.frumento@unipi.it
See Also
iMqr
for model fitting; summary.iMqr
and predict.iMqr
for model summary and prediction.
Examples
# using simulated data
n <- 250
x <- runif(n)
qy <- function(p,x){p^2 + x*log(p)}
# true quantile function: Q(p | x) = beta0(p) + beta1(p)*x, with
# beta0(p) = p^2
# beta1(p) = log(p)
y <- qy(runif(n), x) # to generate y, plug uniform p in qy(p,x)
par(mfrow = c(1,2))
plot(iMqr(y ~ x, formula.p = ~ slp(p,3)), ask = FALSE)
# flexible fit with shifted Legendre polynomials