Description Usage Arguments Details Value Author(s) References See Also Examples

Fit a generalized linear model via penalized maximum likelihood. The regularization path is computed for the lasso (or elastic net penalty), scad (or snet) and mcp (or mnet penalty), at a grid of values for the regularization parameter lambda. Fits linear, logistic, Poisson and negative binomial (fixed scale parameter) regression models.

1 2 3 4 5 6 7 |

`formula` |
symbolic description of the model, see details. |

`data` |
argument controlling formula processing
via |

`weights` |
optional numeric vector of weights. If |

`x` |
input matrix, of dimension nobs x nvars; each row is an observation vector |

`y` |
response variable. Quantitative for |

`x.keep, y.keep` |
logical values: keep response variables or keep response variable? |

`offset` |
Not implemented yet |

`contrasts` |
the contrasts corresponding to |

`...` |
Other arguments passing to |

The sequence of models implied by `lambda`

is fit by coordinate
descent. For `family="gaussian"`

this is the lasso, mcp or scad sequence if
`alpha=1`

, else it is the enet, mnet or snet sequence.
For the other families, this is a lasso (mcp, scad) or elastic net (mnet, snet) regularization path
for fitting the generalized linear regression
paths, by maximizing the appropriate penalized log-likelihood.
Note that the objective function for `"gaussian"`

is

*1/2*
weights*RSS + λ*penalty,*

if `standardize=FALSE`

and

*1/2*
\frac{weights}{∑(weights)}*RSS + λ*penalty,*

if `standardize=TRUE`

. For the other models it is

*-∑ (weights * loglik) + λ*penalty*

if `standardize=FALSE`

and

*-\frac{weights}{∑(weights)} * loglik + λ*penalty*

if `standardize=TRUE`

.

An object with S3 class `"glmreg"`

for the various types of models.

`call` |
the call that produced this object |

`b0` |
Intercept sequence of length |

`beta` |
A |

`lambda` |
The actual sequence of |

`dev` |
The computed deviance (for |

`nulldev` |
Null deviance (per observation). This is defined to be 2*(loglike_sat -loglike(Null)); The NULL model refers to the intercept model. |

`nobs` |
number of observations |

`pll` |
penalized log-likelihood values for standardized coefficients in the IRLS iterations. For |

`pllres` |
penalized log-likelihood value for the estimated model on the original scale of coefficients |

`fitted.values` |
predicted values depending on |

Zhu Wang <[email protected]>

Breheny, P. and Huang, J. (2011) *Coordinate descent
algorithms for nonconvex penalized regression, with applications to
biological feature selection*. *Ann. Appl. Statist.*, **5**: 232-253.

Zhu Wang, Shuangge Ma, Michael Zappitelli, Chirag Parikh, Ching-Yun Wang and Prasad Devarajan (2014)
*Penalized Count Data Regression with Application to Hospital Stay after Pediatric Cardiac Surgery*, *Statistical Methods in Medical Research*.
2014 Apr 17. [Epub ahead of print]

`print`

, `predict`

, `coef`

and `plot`

methods, and the `cv.glmreg`

function.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ```
#binomial
x=matrix(rnorm(100*20),100,20)
g2=sample(0:1,100,replace=TRUE)
fit2=glmreg(x,g2,family="binomial")
#poisson and negative binomial
data("bioChemists", package = "pscl")
fm_pois <- glmreg(art ~ ., data = bioChemists, family = "poisson")
coef(fm_pois)
fm_nb1 <- glmreg(art ~ ., data = bioChemists, family = "negbin", theta=1)
coef(fm_nb1)
## Not run:
fm_nb2 <- glmregNB(art ~ ., data = bioChemists)
coef(fm_nb2)
## End(Not run)
``` |

mpath documentation built on July 21, 2018, 5:04 p.m.

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.