coverage_prob: Calculate the empirical coverage probability of a matrix of...

Description Usage Arguments Value Examples

Description

Calculate the empirical coverage probability of a matrix of confidence intervals.

Usage

1
coverage_prob(conf_intervals, truth)

Arguments

conf_intervals

Matrix of confidence intervals in which each row is a CI, the first column is the lower confidence limit, and the second column is the upper confidence limit.

truth

True value of the parameter for which the CIs were constructed.

Value

Empirical coverage probability.

Examples

1
2
3
4
xbar <- replicate(1000, mean(rnorm(25)))
ME <- qnorm(0.975) / 5
CIs <- cbind(xbar - ME, xbar + ME)
coverage_prob(CIs, 0)

fditraglia/fmscr documentation built on May 16, 2019, 12:10 p.m.