rlassologit | R Documentation |
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
rlassologit(x, ...)
## S3 method for class '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 class '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),
...
)
## Default S3 method:
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),
...
)
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
|
data |
an optional data frame, list or environment. |
post |
logical. If |
intercept |
logical. If |
model |
logical. If |
penalty |
list with options for the calculation of the penalty. |
control |
list with control values.
|
y |
dependent variable (vector or matrix) |
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.
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 |
Belloni, A., Chernozhukov and Y. Wei (2013). Honest confidence regions for logistic regression with a large number of controls. arXiv preprint arXiv:1304.3969.
## Not run:
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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.