QREM | R Documentation |
Fitting a quantile regression model via the EM algorithm.
QREM( func, linmod, dframe, qn, userwgts = NULL, ..., err = 10, maxit = 1000, tol = 0.001, maxInvLambda = 300 )
func |
The fitting function (lm, lmer, or gam). |
linmod |
A formula (the linear model for fitting in the M step). |
dframe |
A data frame containing the columns in the formula. |
qn |
The selected quantile. Must be in (0,1). |
userwgts |
The user-provided sampling weights (optional. Default=NULL.) |
... |
Any arguments to be passed to func (except for the formula and weights). Note that gam requires the family of the error distribution. |
err |
The initial value for the estimation error (default=10). Must be greater than tol (below). |
maxit |
The maximum number of EM iterations (default=1000). |
tol |
The error tolerance level (default=0.001). |
maxInvLambda |
The maximum value of the weight for WLS fitting (default=300). |
A list containing the following
coef The estimated regression coefficients (a list).
fitted.mod The output from lm(), lmer(), or gam() in the last EM iteration.
empq The percentage of points below the regression line (the empirical quantile).
ui The quantile regression residuals.
weights The weights used in the WLS solution.
iter The number of EM iterations.
err The final EM error (convergence criterion).
data(simdf) qremFit <- QREM(lm,linmod=y~x*x2 +x3, df=simdf, qn=0.2) summary(aov(qremFit$fitted.mod)) summary(qremFit$fitted.mod)$coef
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.