calc_width {mcstatsim}R Documentation

Calculate Average Width of Confidence Intervals and its Monte Carlo Standard Error

Description

This function computes the average width of a set of confidence intervals, represented by their lower and upper bounds, along with the Monte Carlo Standard Error (MCSE) of this average width. The average width provides insight into the precision of the estimation process, with narrower intervals typically indicating more precise estimates. The MCSE of the width offers a measure of the uncertainty associated with the average width calculation, useful for assessing the variability of interval estimates across simulations or bootstrap samples.

Usage

calc_width(lower_bound, upper_bound)

Arguments

lower_bound

A numeric vector of lower bounds of confidence intervals.

upper_bound

A numeric vector of upper bounds of confidence intervals, corresponding to 'lower_bound'.

Value

A list with two components: 'width', the average width of the confidence intervals, and 'width_mcse', the Monte Carlo Standard Error of the average width. This MCSE provides a quantification of the uncertainty in the average width estimate.

Examples

set.seed(123) # For reproducibility
estimates <- rnorm(100, mean = 50, sd = 10)
ci_lower <- estimates - 1.96 * 10
ci_upper <- estimates + 1.96 * 10
width_info <- calc_width(ci_lower, ci_upper)
print(width_info)

[Package mcstatsim version 0.5.0 Index]