plot.iqrL {qrcm} | R Documentation |
Plot Quantile Regression Coefficients with Longitudinal Data
Description
Plots quantile regression coefficients
\beta(u)
and \gamma(v)
,
based on a fitted model of class “iqrL
”.
Usage
## S3 method for class 'iqrL'
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 options will permit
creating Q-Q plots of |
... |
additional graphical parameters, that can include xlim, ylim, xlab, ylab, col, lwd, cex.lab, cex.axis, axes, frame.plot.
See |
Author(s)
Paolo Frumento paolo.frumento@unipi.it
See Also
iqrL
for model fitting; summary.iqrL
and predict.iqrL
for model summary and prediction.
Examples
# using simulated data
n <- 1000 # n. of observations
n.id <- 100 # n. of clusters
id <- rep(1:n.id, each = n/n.id) # cluster id
x1 <- runif(n) # a level-1 covariate
z1 <- rnorm(n.id) # a level-2 covariate
V <- runif(n.id) # V_i
U <- runif(n) # U_it
alpha <- 2*(V - 1) + z1 # alpha
y_alpha <- 1 + 2*qnorm(U) + 3*U*x1 # y - alpha
y <- y_alpha + alpha[id] # observed outcome
mydata <- data.frame(id = id, y = y, x1 = x1, z1 = z1[id])
model <- iqrL(fx = y ~ x1, fu = ~ I(qnorm(u)) + u,
fz = ~ z1, fv = ~ -1 + I(qnorm(v)), id = id, data = mydata)
par(mfrow = c(2,2))
plot(model, ask = FALSE)