Description Usage Arguments Details Value Author(s) References Examples

View source: R/QICD_functions.R

LASSO.fit.nonpen obtains coefficient estimates for Lasso penalized quantile regression with some nonpenalized coefficients. It is called by the QICD.nonpen function to obtain initial estimates when they are not provided.

1 | ```
LASSO.fit.nonpen(y, x, z, tau, lambda, intercept, coef.cutoff, weights=NULL)
``` |

`y` |
Vector of responses. |

`x` |
n x p matrix of covariates. |

`z` |
n x q matrix of observations with each row corresponding to one observation. Penalties (and variable selection) WILL NOT be applied to these coefficients. Do not include column of 1's; set intercept=TRUE, if intercept is desired. |

`tau` |
Conditional quantile being modelled. |

`lambda` |
Tuning parameter. Must be positive. |

`intercept` |
If TRUE, an intercept is included in the model. If FALSE, no intercept is included. |

`coef.cutoff` |
Coefficients with magnitude less than this value are set to 0. |

`weights` |
If not NULL, weights must be a vector of length n with a positive weight for each observation. This is used for the linear programming solution for the SCAD and MCP penalties. |

This is a barebones function that only provides coefficient estimates. It will not provide any warnings or errors, so you need to check that inputs are accurate and appropriate. The rq.lasso.fit function should be used to obtain more information from the Lasso fit.

Returns a vector containing the intercept (if intercept=TRUE) and the estimated coefficients for each column in x and z.

Adam Maidman

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

1 2 3 4 5 6 7 8 9 | ```
library(splines)
n = 50
p = 100
x <- matrix(rnorm(n*p),nrow=n)
z1 <- runif(n)
z <- bs(z1)
y <- 0 + x[,1] - 3*x[,5] + z1^3 + rnorm(n)
fit1 <- LASSO.fit.nonpen(y,x,z, tau=.5, lambda=1, intercept=TRUE, coef.cutoff=1e-08)
fit2 <- LASSO.fit.nonpen(y,x,z, tau=.5, lambda=.1, intercept=TRUE, coef.cutoff=1e-08)
``` |

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.