Learn R Programming

hdm (version 0.3.2)

rlassologit: rlassologit: Function for logistic Lasso estimation

Description

The function estimates the coefficients of a logistic Lasso regression with data-driven penalty. The method of the data-driven penalty can be chosen. The object which is returned is of the S3 class rlassologit

Usage

rlassologit(x, ...)

# S3 method for formula rlassologit( formula, data = NULL, post = TRUE, intercept = TRUE, model = TRUE, penalty = list(lambda = NULL, c = 1.1, gamma = 0.1/log(n)), control = list(threshold = NULL), ... )

# S3 method for character rlassologit( x, data = NULL, post = TRUE, intercept = TRUE, model = TRUE, penalty = list(lambda = NULL, c = 1.1, gamma = 0.1/log(n)), control = list(threshold = NULL), ... )

# S3 method for default rlassologit( x, y, post = TRUE, intercept = TRUE, model = TRUE, penalty = list(lambda = NULL, c = 1.1, gamma = 0.1/log(n)), control = list(threshold = NULL), ... )

Value

rlassologit returns an object of class rlassologit. An object of class rlassologit is a list containing at least the following components:

coefficients

parameter estimates

beta

parameter estimates (without intercept)

intercept

value of intercept

index

index of selected variables (logicals)

lambda

penalty term

residuals

residuals

sigma

root of the variance of the residuals

call

function call

options

options

Arguments

x

regressors (matrix)

...

further parameters passed to glmnet

formula

an object of class 'formula' (or one that can be coerced to that class): a symbolic description of the model to be fitted in the form y~x.

data

an optional data frame, list or environment.

post

logical. If TRUE, post-lasso estimation is conducted.

intercept

logical. If TRUE, intercept is included which is not penalized.

model

logical. If TRUE (default), model matrix is returned.

penalty

list with options for the calculation of the penalty. c and gamma constants for the penalty.

control

list with control values. threshold is applied to the final estimated lasso coefficients. Absolute values below the threshold are set to zero.

y

dependent variable (vector or matrix)

Details

The function estimates the coefficients of a Logistic Lasso regression with data-driven penalty. The option post=TRUE conducts post-lasso estimation, i.e. a refit of the model with the selected variables.

References

Belloni, A., Chernozhukov and Y. Wei (2013). Honest confidence regions for logistic regression with a large number of controls. arXiv preprint arXiv:1304.3969.

Examples

Run this code
if (FALSE) {
library(hdm)
## DGP
set.seed(2)
n <- 250
p <- 100
px <- 10
X <- matrix(rnorm(n*p), ncol=p)
beta <- c(rep(2,px), rep(0,p-px))
intercept <- 1
P <- exp(intercept + X %*% beta)/(1+exp(intercept + X %*% beta))
y <- rbinom(length(y), size=1, prob=P)
## fit rlassologit object
rlassologit.reg <- rlassologit(y~X)
## methods
summary(rlassologit.reg, all=F)
print(rlassologit.reg)
predict(rlassologit.reg, type='response')
X3 <- matrix(rnorm(n*p), ncol=p)
predict(rlassologit.reg, newdata=X3)
}

Run the code above in your browser using DataLab