calculate_confidence_intervals: Confidence interval from estimate and standard error

View source: R/utils.R

calculate_confidence_intervalsR Documentation

Confidence interval from estimate and standard error

Description

Computes a symmetric confidence interval given a point estimate and its standard error. Returns NA bounds when either input is NA.

Usage

calculate_confidence_intervals(
  estimate,
  se,
  confidence_level = 0.95,
  method = "normal"
)

Arguments

estimate

Numeric point estimate (scalar or vector)

se

Standard error of the estimate

confidence_level

Confidence level in (0, 1), default 0.95

method

"normal" (default) for symmetric normal-theory interval; "log-normal" for a delta-method interval on the log scale (requires estimate > 0)

Value

Named list with ci_lower, ci_upper, method, and confidence_level

Examples

calculate_confidence_intervals(0.5, 0.05)
calculate_confidence_intervals(0.5, 0.05, confidence_level = 0.99)
calculate_confidence_intervals(NA, 0.05)

fb4package documentation built on May 8, 2026, 1:07 a.m.