delta_method_confidence_intervals: Confidence Intervals

View source: R/direct_adjusting.R

delta_method_confidence_intervalsR Documentation

Confidence Intervals

Description

Computes different kinds of confidence intervals given the statistics and their variance estimates.

Usage

delta_method_confidence_intervals(
  statistics,
  variances,
  conf_lvl = 0.95,
  conf_method = "identity"
)

Arguments

statistics

⁠[numeric]⁠ (mandatory, no default)

statistics for which to calculate confidence intervals

variances

⁠[numeric]⁠ (mandatory, no default)

variance estimates of statistics used to compute confidence intervals

conf_lvl

⁠[numeric]⁠ (mandatory, default 0.95)

confidence level of confidence intervals in ⁠]0, 1[⁠

conf_method

⁠[character]⁠ (mandatory, default "identity")

see section Confidence interval methods

Value

data.table with columns

  • statistic: the values you supplied via argument statistics

  • variance: the values you supplied via argument variances

  • ci_lo: lower bound of confidence interval

  • ci_hi: upper bound of confidence interval

Confidence interval methods

Currently supported confidence interval methods and their formulae: - identity: STAT + Z * STD_ERR - log: STAT * exp(Z * STD_ERR/STAT) - log-log: STAT^exp(-Z * (STD_ERR/(abs(log(STAT)) * STAT)))

Where - 'STAT' is the statistic, - 'Z' is the quantile from the standard normal distribution for the lower or upper bound, and - 'STD_ERR“ is the standard error (square root of the variance)


WetRobot/directadjusting documentation built on Dec. 14, 2024, 1:04 a.m.