ko.glm {kosel}R Documentation

Statistics of the knockoffs procedure for glmnet regression models.

Description

Returns the vector of statistics W of the revisited knockoffs procedure for regressions available in the R package glmnet. Most of the parameters come from glmnet(). See glmnet documentation for more details.

Usage

ko.glm(x, y, family = "gaussian", alpha = 1,
  type.gaussian = ifelse(nvars < 500, "covariance", "naive"),
  type.logistic = "Newton", type.multinomial = "ungrouped",
  nVal = 50, random = FALSE)

Arguments

x

Input matrix, of dimension nobs x nvars; each row is an observation vector. Can be in sparse matrix format (inherit from class "sparseMatrix" as in package Matrix; not yet available for family="cox")

y

Response variable. Quantitative for family="gaussian", or family="poisson" (non-negative counts). For family="binomial" should be either a factor with two levels, or a two-column matrix of counts or proportions (the second column is treated as the target class; for a factor, the last level in alphabetical order is the target class). For family="multinomial", can be a nc>=2 level factor, or a matrix with nc columns of counts or proportions. For either "binomial" or "multinomial", if y is presented as a vector, it will be coerced into a factor. For family="cox", y should be a two-column matrix with columns named 'time' and 'status'. The latter is a binary variable, with '1' indicating death, and '0' indicating right censored. The function Surv() in package survival produces such a matrix.

family

Response type: "gaussian","binomial","poisson","multinomial","cox". Not available for "mgaussian".

alpha

The elasticnet mixing parameter, with 0 <= alpha <= 1. alpha=1 is the lasso penalty, and alpha=0 the ridge penalty. The default is 1.

type.gaussian

See glmnet documentation.

type.logistic

See glmnet documentation.

type.multinomial

See glmnet documentation.

nVal

Length of lambda sequence - default is 50.

random

If TRUE, the matrix of knockoffs is different for every run. If FALSE, a seed is used so that the knockoffs are the same. The default is FALSE.

Value

A vector of dimension nvars corresponding to the statistics W.

See Also

ko.sel

Examples

# see ko.sel


[Package kosel version 0.0.1 Index]