Learn R Programming

KOBT (version 0.1.0)

kobt.select: Knockoff Variable Selection

Description

Use knockoff to conduct variable selection with false discovery rarte control.

Usage

kobt.select(score, fdr = 0.1, type = "modified")

Arguments

score

An n by 2p matrix of test statistics, which includes test statistics from n samples, p variables (first p columns), and p knockoff variables (last p columns).

fdr

The targeted false discovery rate (FDR), the default value is 0.1.

type

A charactor showing the type of calculated false discovery rate: (1) modified and (2) usual FDR, the default value is modified.

Value

Indices of selected columns/variables in the n by p original design matrix.

References

candes2018panningKOBT

Examples

Run this code
# NOT RUN {
set.seed(1010)
n <- 100
p <- 100
signal.num <- 20
W_left <- matrix(rnorm(n = n*signal.num, mean = 1, sd = 1), nrow = n)
W_right <- matrix(rnorm(n = n*(2*p-signal.num), mean = 0, sd = 1), nrow = n)
W <- cbind(W_left, W_right)
selected.index <- kobt.select(score = W)

# }

Run the code above in your browser using DataLab