View source: R/pwutilityfunctions.R
empirical_fdr | R Documentation |
This function computes the empirical false discovery rate (FDR) for a given set of p-values or similar scores, assuming a subset of indices represent true null hypotheses.
empirical_fdr(val, true_null_indices, ...)
val |
A numeric vector of p-values or test statistics. |
true_null_indices |
A numeric vector of indices indicating the positions
in |
... |
Further arguments to |
The FDR is computed as the cumulative count of true nulls up to a given rank, divided by the rank itself. The function returns values sorted in ascending order.
A numeric vector of FDR values corresponding to each threshold in the
sorted val
.
set.seed(123)
val <- runif(10) # Generate 10 random uniform values
true_null_indices <- c(3, 6, 8) # Indices of true nulls
empirical_fdr(val, true_null_indices)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.