plaqr {plaqr} | R Documentation |
Partially Linear Additive Quantile Regression
Description
Returns an object of class "plaqr"
and "rq"
that represents a quantile regression fit. A nonlinear term z is transformed using bs(z)
before fitting the model. The formula of the model (as it appears in R
) becomes y~ x1 + x2 + bs(z1) + bs(z2)
where bs(z1)
is a B-spline.
Usage
plaqr(formula, nonlinVars=NULL, tau=.5, data=NULL, subset,
weights, na.action, method = "br", model = TRUE,
contrasts = NULL, splinesettings=NULL, ...)
Arguments
formula |
a formula object, with the response on the left of a |
nonlinVars |
a one-sided formula object, with a |
tau |
the quantile to be estimated, this is a number strictly between 0 and 1 (for now). |
data |
a data.frame in which to interpret the variables named in the formula, or in the subset and the weights argument. If this is missing, then the variables in the formula should be on the search list. This may also be a single number to handle some special cases – see below for details. |
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
weights |
vector of observation weights; if supplied, the algorithm fits to minimize the sum of the weights multiplied into the absolute residuals. The length of weights must be the same as the number of observations. The weights must be nonnegative and it is strongly recommended that they be strictly positive, since zero weights are ambiguous. |
na.action |
a function to filter missing data.
This is applied to the model.frame after any subset argument has been used.
The default (with |
model |
if TRUE then the model frame is returned. This is essential if one wants to call summary subsequently. |
method |
the algorithmic method used to compute the fit. There are several
options: The default method is the modified version of the
Barrodale and Roberts algorithm for |
contrasts |
a list giving contrasts for some or all of the factors
default = |
splinesettings |
a list of length equal to the number of nonlinear effects containing arguments to pass to the |
... |
additional arguments for the fitting routines
(see the |
Value
Returns the following:
coefficients |
Coefficients from the fitted model |
x |
optionally the model matrix, if |
y |
optionally the response, if |
residuals |
the residuals from the fit. |
dual |
the vector dual variables from the fit. |
fitted.values |
fitted values from the fit. |
formula |
the formula that was used in the |
rho |
the value of the objective function at the solution. |
model |
optionally the model frame, if |
linear |
the linear terms used in the model fit. |
nonlinear |
the nonlinear terms used in the model fit. |
z |
the values of the nonlinear terms. |
Author(s)
Adam Maidman
References
Hastie, T. J. (1992) Generalized additive models. Chapter 7 of Statistical Models in S eds J. M. Chambers and T. J. Hastie, Wadsworth & Brooks/Cole.
Koenker, R. W. (2005). Quantile Regression, Cambridge U. Press.
Sherwood, B. and Wang, L. (2016). Partially linear additive quantile regression in ultra-high dimension. The Annals of Statistics 44, 288-317.
Maidman, A., Wang, L. (2017). New Semiparametric Method for Predicting High-Cost Patients. Preprint.
Examples
data(simData)
ss <- vector("list", 2)
ss[[2]]$degree <- 5
ss[[2]]$Boundary.knots <- c(-1, 1)
plaqr(y~., nonlinVars=~z1+z2, data=simData)
#same as plaqr(formula= y~x1+x2+x3, nonlinVars=~z1+z2, data=simData)
plaqr(y~0, nonlinVars=~z1+z2, data=simData, splinesettings=ss) #no linear terms in the model
plaqr(y~., data=simData) #all linear terms