Skip to contents

Calculates confidence intervals using the Wald method with optional back-transformation. For LogNormal transform, the CI is computed on the log scale and then exponentiated. For other transforms, standard symmetric intervals are computed.

Usage

compute_ci(estimate, se, ci_level = 0.95, transform = "identity")

Arguments

estimate

The parameter estimate(s), can be a vector

se

The standard error(s) of the estimate(s), can be a vector

ci_level

Confidence level between 0 and 1 (e.g., 0.95 for 95% CI). Defaults to 0.95.

transform

Transformation type(s), can be a vector: "LogNormal", "AddErr", "Proportional", or "Identity". Defaults to "Identity".

Value

A list with lower and upper vectors for the CI bounds

Examples

if (FALSE) { # \dontrun{
compute_ci(1.5, 0.2)$lower
df %>% mutate(
  ci_lower = compute_ci(estimate, se)$lower,
  ci_upper = compute_ci(estimate, se)$upper
)
} # }