This function generates knockoff variables using the following approaches:

  • Continuous variables: Ordinary least squares (OLS) regression.

  • Factor variables: Multinomial logistic regression. If X is empty, knockoffs are sampled from the marginal distribution of y.

simple.recovery(y, X)

Arguments

y

A response vector that can be either "numeric" or "factor". The vector is passed to cv.glmnet for fitting the model.

X

A data frame of covariates that are passed to cv.glmnet for model fitting.

Value

A simulated response vector y.sim with the same type and length as y.

See also