Description Usage Arguments Value Author(s) References Examples

Fits a quantile regression model with the LASSO penalty. Algorithm is similar to LASSO code presented in Koenker and Mizera (2014).

1 2 3 |

`x` |
Matrix of predictors. |

`y` |
Vector of response values. |

`tau` |
Conditional quantile being modelled. |

`lambda` |
Tuning parameter. |

`weights` |
Weights for the objective function. |

`intercept` |
Whether model should include an intercept. Constant does not need to be included in "x". |

`coef.cutoff` |
Coefficients below this value will be set to zero. |

`method` |
Use method "br" or "fn" as outlined in quantreg package. Method "fn" better for large n or p. Default will choose "br" or "fn" based on n and p. |

`penVars` |
Variables that should be penalized. With default value of NULL all variables are penalized. |

`...` |
Additional items to be sent to rq. Note this will have to be done carefully as rq is run on the augmented data to account for penalization and could provide strange results if this is not taken into account. |

Returns the following:

`coefficients` |
Coefficients from the penalized model. |

`PenRho` |
Penalized objective function value. |

`residuals` |
Residuals from the model. |

`rho` |
Objective function evaluation without the penalty. |

`tau` |
Conditional quantile being modelled. |

`n` |
Sample size. |

Ben Sherwood

[1] Koenker, R. and Mizera, I. (2014). Convex optimization in R. *Journal of Statistical Software*, **60**, 1–23.

[2] Tibshirani, R. (1996). Regression shrinkage and selection via the lasso.
*Journal of the Royal Statistical Society. Series B*, **58**, 267–288.

[3] Wu, Y. and Liu, Y. (2009). Variable selection in quantile regression. *Statistica
Sinica*, **19**, 801–817.

1 2 3 | ```
x <- matrix(rnorm(800),nrow=100)
y <- 1 + x[,1] - 3*x[,5] + rnorm(100)
lassoModel <- rq.lasso.fit(x,y,lambda=1)
``` |

```
Loading required package: quantreg
Loading required package: SparseM
Attaching package: 'SparseM'
The following object is masked from 'package:base':
backsolve
Loading required package: regpro
Loading required package: denpro
Warning message:
In rq.fit.br(x, y, tau = tau, ...) : Solution may be nonunique
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.