Calculates confidence interval coverage and width. The function also calculates the associated Monte Carlo standard errors. The confidence interval percentage is based on how you calculated the lower and upper bounds.

calc_coverage(
  res_dat,
  lower_bound,
  upper_bound,
  true_param,
  perfm_criteria = c("coverage", "width")
)

Arguments

res_dat

data frame or tibble containing the simulation results.

lower_bound

name of the column containing the lower bound estimates of the confidence intervals.

upper_bound

name of the column containing the upper bound estimates of the confidence intervals.

true_param

name of the column containing the true parameters.

perfm_criteria

character or character vector indicating the performance criteria to be calculated.

Value

A tibble containing the number of simulation iterations, performance criteria estimate(s) and the associated MCSE.

Examples

calc_coverage(res_dat = t_res, lower_bound = lower_bound, upper_bound = upper_bound, true_param = true_param)
#> # A tibble: 1 x 5 #> K coverage coverage_mcse width width_mcse #> <int> <dbl> <dbl> <dbl> <dbl> #> 1 1000 0.951 0.00683 0.791 0.00179