View source: R/knockoff_filter.R
calculate_w_statistics | R Documentation |
Computes W statistics by comparing test statistics from original variables with those from their knockoff counterparts. These statistics are used for variable selection with FDR control.
calculate_w_statistics(t_orig, t_knock, method = "median")
t_orig |
Vector of test statistics for original variables |
t_knock |
Vector or list of test statistics for knockoff variables. If a list, should contain M vectors of the same length as t_orig. |
method |
Method for computing W statistics:
|
Vector of W statistics for variable selection
# Example with difference method
t_orig <- c(5.2, 3.1, 8.7, 2.4, 6.9)
t_knock <- list(
c(2.1, 4.2, 3.3, 1.8, 2.9),
c(1.9, 3.8, 4.1, 2.2, 3.1)
)
w_median <- calculate_w_statistics(t_orig, t_knock, method = "median")
w_diff <- calculate_w_statistics(t_orig, t_knock, method = "difference")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.