knockoff_filter: Apply Knockoff Filter for Variable Selection

View source: R/knockoff_filter.R

knockoff_filterR Documentation

Apply Knockoff Filter for Variable Selection

Description

Applies the knockoff filter to select variables while controlling the false discovery rate (FDR) at a specified level.

Usage

knockoff_filter(W, fdr = 0.1, offset = 1)

Arguments

W

Vector of W statistics from calculate_w_statistics

fdr

Target false discovery rate (default: 0.1)

offset

Offset parameter for knockoff filter (default: 1)

Value

Vector of indices of selected variables

Examples


# Generate some example W statistics
W <- c(2.1, -0.5, 3.8, -1.2, 4.5, 0.3, -2.1, 1.9)

# Apply knockoff filter
selected <- knockoff_filter(W, fdr = 0.1)
print(selected)  # Indices of selected variables


CoxMK documentation built on Sept. 9, 2025, 5:24 p.m.

Related to knockoff_filter in CoxMK...