Computes coefficients for the quantile regression spacing method.

quantRegSpacing(
  dep_col,
  data,
  var_names,
  alpha,
  jstar,
  algorithm = "rq.fit.sfn_start_val",
  small = 0.001,
  trunc = FALSE,
  start_list = NA,
  weight_vec = NULL,
  outputQuantiles = FALSE,
  calculateAvgME = FALSE,
  lambda = NULL,
  ...
)

Arguments

dep_col

Column of response variable.

data

Regression specification matrix.

var_names

RHS regression variable names.

alpha

Quantiles to be estimated.

jstar

First quantile to be estimated (usually the center one)

algorithm

The name of a function which will estimate a quantile regression. Defaults to rq.fit.sfn_start_val. Must be a string, as it is passed to `do.call`

small

Minimum size of residuals for computational accuracy.

trunc

Boolean value; if true, replace those dependent values less than small with small itself; else, only use rows with residuals greater than small

start_list

Starting values for regression optimization.

weight_vec

vector of optional weights

outputQuantiles

TRUE or FALSE, whether to output quantiles

calculateAvgME

TRUE or FALSE, whether to output average marginal effects

lambda

optional penalty parameter, ignored except for penalized regression algorithms

...

other parameters passed to the algorithm

Value

Returns a list of coefficients. num_betas is an x by p matrix of estimated parameters for each supplied quantiles. pseudo_r is a 1 by p matrix of psuedo R^2 values for each quantile estimate. warnings is a 1 by p matrix of warnings produced by each quantile regression call. iter: is a 1 by p matrix of iterations ran by each quantile regression call.