# directadjusting::delta_method_confidence_intervals
dt_1 <- directadjusting::delta_method_confidence_intervals(
statistics = 0.9,
variances = 0.1,
conf_lvl = 0.95,
conf_method = "log"
)
# you can also supply your own math for computing the confidence intervals
dt_2 <- directadjusting::delta_method_confidence_intervals(
statistics = 0.9,
variances = 0.1,
conf_lvl = 0.95,
conf_method = quote(theta * exp(z * theta_standard_error / theta))
)
dt_3 <- directadjusting::delta_method_confidence_intervals(
statistics = 0.9,
variances = 0.1,
conf_lvl = 0.95,
conf_method = list(
g = quote(log(theta)),
g_inv = quote(exp(g))
)
)
dt_4 <- directadjusting::delta_method_confidence_intervals(
statistics = 0.9,
variances = 0.1,
conf_lvl = 0.95,
conf_method = list(
g = quote(stats::qnorm(theta)),
g_inv = quote(stats::pnorm(g))
)
)
stopifnot(
all.equal(dt_1, dt_2, check.attributes = FALSE),
all.equal(dt_1, dt_3, check.attributes = FALSE)
)
Run the code above in your browser using DataLab