| pval_aucpr | R Documentation |
Calculates the Precision-Recall (PR) Area Under the Curve (AUC) given a vector of p-values and the true classes (causal (alternative) vs non-causal (null)).
This is a wrapper around PRROC::pr.curve(), which actually calculates the AUC (see that for details).
pval_aucpr(pvals, causal_indexes, curve = FALSE)
pvals |
The vector of association p-values to analyze.
|
causal_indexes |
The vector of causal indexes, defining the true classes used for AUC calculation.
Values of |
curve |
If |
If curve = FALSE, returns the PR AUC scalar value.
If curve = TRUE, returns the PRROC object as returned by PRROC::pr.curve(), which can be plotted directly, and which contains the AUC under the named value auc.integral.
However, if the input pvals is NULL (taken for case of singular association test, which is rare but may happen), then the returned value is NA.
PRROC::pr.curve(), which is used internally by this function.
pval_power_calib() for calibrated power estimates.
# simulate truly null p-values, which should be uniform pvals <- runif(10) # for toy example, take the first two p-values to be truly causal causal_indexes <- 1:2 # calculate desired measure pval_aucpr( pvals, causal_indexes )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.