pval_power_calib {simtrait}R Documentation

Estimate calibrated power

Description

Given a significance level alpha and p-values with known causal status, this function estimates the calibrated power. First it estimates the p-value threshold at which the desired type I error of alpha is achieved, then it uses this p-value threshold (not alpha) to estimate statistical power. Note that these simple empirical estimates are likely to be inaccurate unless the number of p-values is much larger than 1/alpha.

Usage

pval_power_calib(pvals, causal_indexes, alpha = 0.05)

Arguments

pvals

The vector of association p-values to analyze. This function assumes all p-values are provided (a mix of null and alternative tests). NA values are allowed in input and removed. Non-NA values outside of [0, 1] will trigger an error.

causal_indexes

The vector of causal indexes, defining the true classes used for calibrated power estimation. Values of causal_indexes as returned by sim_trait work. There must be at least one causal index and at least one non-causal case.

alpha

The desired significance level (default 0.05). May be a vector.

Value

The calibrated power estimates at each alpha

See Also

pval_aucpr(), a robust proxy for calibrated power that integrates across significance thresholds.

Examples

# 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
# estimate desired measure
pval_power_calib( pvals, causal_indexes )


[Package simtrait version 1.1.3 Index]