Learn R Programming

stepPlr (version 0.91)

plr: Logistic regression with a quadratic penalization on the coefficients

Description

This function fits a logistic regression model penalizing the size of the L2 norm of the coefficients.

Usage

plr(x, y, weights = rep(1,length(y)), lambda = 1e-4, cp = "bic")

Arguments

Value

A plr object is returned. predict, print, and summary functions can be applied.coefficientsvector of the coefficient estimatescovariancea sandwich estimate of the covariance matrix for the coefficientsdeviancedeviance of the fitted modelnull.deviancedeviance of the null modeldfdegrees of freedom of the fitted modelscoredeviance + cp*dfnobsnumber of observationscpcomplexity parameter used when computing the scorefitted.valuesfitted probabilitieslinear.predictorslinear predictors computed with the estimated coefficientslevelIf any categorical factors are input, level - the list of level sets - is automatically generated and returned. See step.plr for details of how it is generated.

Details

We proposed using logistic regression with a quadratic penalization on the coefficients for detecting gene interactions as described in "Penalized Logistic Regression for Detecting Gene Interactions (2006)" by Park and Hastie. However, this function plr may be used for a general purpose. We thank Michael Saunders of SOL, Stanford University for providing the solver used for the convex optimization in this function.

References

Mee Young Park and Trevor Hastie (2006) Penalized Logistic Regression for Detecting Gene Interactions - available at the authors' websites, http://stat.stanford.edu/~mypark or http://stat.stanford.edu/~hastie/pub.htm.

See Also

predict.plr, step.plr

Examples

Run this code
n <- 100

p <- 10
x <- matrix(rnorm(n*p),nrow=n)
y <- sample(c(0,1),n,replace=TRUE)
fit <- plr(x,y,lambda=1)

p <- 3
z <- matrix(sample(seq(3),n*p,replace=TRUE),nrow=n)
x <- data.frame(x1=factor(z[ ,1]),x2=factor(z[ ,2]),x3=factor(z[ ,3]))
y <- sample(c(0,1),n,replace=TRUE)
fit <- plr(x,y,lambda=1)
# 'level' is automatically generated. Check 'fit$level'.

Run the code above in your browser using DataLab