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.
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)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")
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.
Response type: "gaussian","binomial","poisson","multinomial","cox". Not available for "mgaussian".
The elasticnet mixing parameter, with 0 <= alpha <= 1. alpha=1 is the lasso penalty, and alpha=0 the ridge penalty. The default is 1.
See glmnet documentation.
See glmnet documentation.
See glmnet documentation.
Length of lambda sequence - default is 50.
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.
A vector of dimension nvars corresponding to the statistics W.