lasso2 (version 1.2-10)

gl1ce: Generalized Regression With L1-constraint on the Parameters

Description

Fit a generalized regression problem while imposing an L1 constraint on the parameters. Returns an object of class gl1ce.

Usage

gl1ce(formula, data = sys.parent(), weights, subset, na.action,
      family = gaussian, control = glm.control(...), sweep.out = ~ 1,
      x = FALSE, y = TRUE, contrasts = NULL, standardize = TRUE,
      guess.constrained.coefficients = double(p), bound = 0.5, ...)
## S3 method for class 'gl1ce':
family(object, \dots)

Arguments

Value

an object of class gl1ce is returned by gl1ce(). See gl1ce.object for details.

References

See the references in l1ce.

Justin Lokhorst (1999). The LASSO and Generalised Linear Models, Honors Project, Nov.1999, Dept.Statist., Univ. of Adelaide. Available as file Doc/justin.lokhorst.ps.gz in both shar files from http://www.maths.uwa.edu.au/~berwin/software/lasso.html.

See Also

glm for unconstrained generalized regression modeling.

Examples

Run this code
## example from base:
data(esoph)
summary(esoph)
## effects of alcohol, tobacco and interaction, age-adjusted
modEso <- formula(cbind(ncases, ncontrols) ~ agegp + tobgp * alcgp)
glm.E   <- glm(modEso, data = esoph, family = binomial())
gl1c.E <- gl1ce(modEso, data = esoph, family = binomial())
gl1c.E
plot(residuals(gl1c.E) ~ fitted(gl1c.E))

sg1c <- summary(gl1c.E)
sg1c

## Another comparison  glm() / gl1c.E:
plot(predict(glm.E,  type="link"), predict(glm.E,  type="response"),
     xlim = c(-3,0))
points(predict(gl1c.E, type="link"), predict(gl1c.E, type="response"),
       col = 2, cex = 1.5)labels(gl1c.E)#-- oops! empty!!

Run the code above in your browser using DataCamp Workspace