fit.logreg: Fit logistic regression by using logistic LASSO with lambda=0

Description Usage Arguments Value Note Author(s) Examples

View source: R/fit.logreg.R

Description

Fit logistic regression by using logistic LASSO with lambda=0

Usage

1
2
3
4
5
6
7
  fit.logreg(ds, out, wts = rep(1, nrow(ds)),
    verbosity = 0, useCols = NULL, fakeLam,
    imputeDs2FitDsProperties = normalImputationConversion(),
    ..., type.measure = NULL, nfolds = 10, foldid)

  logregLikeGlmnet(x, y, useLambda = Inf, verbosity = 0,
    ...)

Arguments

ds

dataset (numdfr or data.frame)

out

outcome vector

wts

weight vector per observation (does not have to sum to 1, and defaults to equal weights)

verbosity

The higher this value, the more levels of progress and debug information is displayed (note: in R for Windows, turn off buffered output)

useCols

restrict the regression to only include these columns as predictors

fakeLam

optionally pass in the lambdas here

imputeDs2FitDsProperties

see imputeDs2FitDs and EMLasso

...

passed on to glmnet/glm.fit. Not allowed: "x", "y", "family", ("weights", "lambda"), "standardize"

type.measure

see cv.glmnet if NULL (the default) no crossvalidation occurs similar to what happens in fit.glmnet

nfolds

see cv.glmnet

foldid

see cv.glmnet

x

model matrix (as supported by glm)

y

outcomes (as supported by glm)

useLambda

lambda item of the return value

Value

glmnet object

similar to the return value of glmnet

Note

The warning in the old function pointed me to the fact that the weights are _not_ probability weights in a binomial glm!! So, as an alternative, we use glmnet with lambda=0 !!!

Author(s)

Nick Sabbe nick.sabbe@ugent.be

Examples

1
2
y<-rbinom(nrow(iris), 1, 0.5)
lreg<-fit.logreg(iris, y, wts=runif(nrow(iris)), verbosity=1)

EMLasso documentation built on May 2, 2019, 5:49 p.m.