transform_plaqr {plaqr} | R Documentation |
Transformation for Partially Linear Additive Quantile Regression
Description
Returns the estimated transformation parameter for the one-parameter symmetric transformation (Geraci and Jones, 2015). Confidence intervals for the transformation parameter can also be created using the bootstrap. The response variable must be strictly positive; a constant can be added to the variable to ensure that all values are positive.
Usage
transform_plaqr(formula, nonlinVars=NULL, tau=.5, data=NULL, lambda=seq(0,1,by=.05),
confint=NULL, B=99, subset, weights, na.action, method = "br",
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. |
lambda |
a real-valued sequence of possible transformation parameters. 0 corresponds to the log transformation and 1 corresponds to the identity. The transformation is symmetric so a negative transformation parameter is redundant and can be avoided. See Geraci and Jones (2015) for more information on the one-parameter, symmetric transformation. |
confint |
a |
B |
the number of bootstrap replications for the confidence interval. If no confidence interval is being created, this argument is ignored. |
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 |
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 |
Value
Returns the following:
parameter |
The transformation parameter |
Y |
The values of the transformed response |
confint |
If a confidence interval is created, this is the confidence interval for the transformation parameter. Otherwise, |
U |
If a confidence interval is created, a |
P |
If a confidence interval is created, a |
Author(s)
Adam Maidman
References
Geraci, M. and Jones, M. (2015). Improved transformation-based quantile regression. Canadian Journal of Statistics 43, 118-132.
Maidman, A., Wang, L. (2017). New Semiparametric Method for Predicting High-Cost Patients. Preprint.
Examples
data(simData)
simData$Y <- exp(simData$y)
transform_plaqr(Y~x1+x2+x3, nonlinVars=~z1+z2, data=simData)
transform_plaqr(Y~x1+x2+x3, nonlinVars=~z1+z2, confint=.95, data=simData)