pval_type_1_err {simtrait} | R Documentation |
Estimate type I error rate
Description
Given a significance level and p-values with known causal status, this function estimates the type I error rate, defined as the proportion of null p-values that are below or equal to the threshold.
Note that these simple empirical estimates are likely to be zero unless the number of p-values is much larger than 1/alpha
.
Usage
pval_type_1_err(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).
|
causal_indexes |
The vector of causal indexes, whose p-values will be omitted.
Values of |
alpha |
The desired significance level (default 0.05). May be a vector. |
Value
The type I error rate estimates at each alpha
See Also
pval_srmsd()
to directly quantify null p-value uniformity, a more robust alternative to type I error rate.
pval_infl()
for the more traditional inflation factor, which focuses on the median of the full distribution (combination of causal and null cases).
Examples
# simulate truly null p-values, which should be uniform
pvals <- runif(10)
# for toy example, take the first p-value to be truly causal (will be ignored below)
causal_indexes <- 1
# estimate desired measure
pval_type_1_err( pvals, causal_indexes )