sqr | R Documentation |
This function computes spline quantile regression (SQR) solution from response vector and design matrix.
It uses the FORTRAN code rqfnb.f
in the "quantreg" package with the kind permission of Dr. R. Koenker.
sqr(
formula,
tau = seq(0.1, 0.9, 0.2),
spar = NULL,
d = 1,
data,
subset,
na.action,
model = TRUE,
weighted = FALSE,
mthreads = TRUE,
method = c("AIC", "BIC"),
ztol = 1e-05
)
formula |
a formula object, with the response on the left of a ~ operator, and the terms, separated by + operators, on the right. |
tau |
sequence of quantile levels in (0,1) |
spar |
smoothing parameter: if |
d |
subsampling rate of quantile levels (default = 1) |
data |
a data.frame in which to interpret the variables named in the formula |
subset |
an optional vector specifying a subset of observations to be used |
na.action |
a function to filter missing data (see |
model |
if |
weighted |
if |
mthreads |
if |
method |
a criterion for smoothing parameter selection if |
ztol |
a zero tolerance parameter used to determine the effective dimensionality of the fit |
object of SQR fit
library(quantreg)
data(engel)
engel$income <- engel$income - mean(engel$income)
tau <- seq(0.1,0.9,0.05)
fit <- rq(foodexp ~ income,tau=tau,data=engel)
fit.sqr <- sqr(foodexp ~ income,tau=tau,spar=0.5,data=engel)
par(mfrow=c(1,1),pty="m",lab=c(10,10,2),mar=c(4,4,2,1)+0.1,las=1)
plot(tau,fit$coef[2,],xlab="Quantile Level",ylab="Coeff1")
lines(tau,fit.sqr$coef[2,])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.