coverfun: Calculate error coverage

Description Usage Arguments Value Author(s) Examples

Description

Given computed p-values, compute the coverage of a statistical test

Usage

1
coverfun(p, alpha = 0.05, one.tailed = FALSE, na.rm = TRUE)

Arguments

p

A vector of p-values

alpha

Type-I error level

one.tailed

(logical) one-tailed test?

na.rm

Remove NAs from p-value vector?

Value

The coverage (fraction of p-values between 0 and alpha for 1-tailed, or alpha/2 and 1-alpha/2 for 2-tailed)

Author(s)

Ben Bolker

Examples

1
2
3
x = matrix(rnorm(1000),ncol=10)
p = pnorm(x)
apply(p,2,coverfun)

bbolker/cpcbp documentation built on May 11, 2019, 9:28 p.m.