ci_t: t-interval confidence interval for the mean of continuous...

View source: R/utils-helpers.R

ci_tR Documentation

t-interval confidence interval for the mean of continuous data

Description

Computes a t-distribution confidence interval for a sample mean.

Usage

ci_t(x, conf_level = 0.95)

Arguments

x

Numeric vector of observations

conf_level

Confidence level

Details

Used by the quantile-binned summary layer (see er_plot_add_quantiles()) and er_vpc_add_observed()/ er_vpc_add_simulated() to compute a confidence interval for the mean response within an exposure bin, for continuous (and, as an approximation, count) responses. This is the continuous-response analogue of ci_clopper_pearson(). NAs in x are dropped before computing the interval.

Value

Named numeric vector (lower, upper), with confidence level stored as an attribute. Returns c(lower = NA, upper = NA) if fewer than 2 non-missing values are supplied.

Examples

ci_t(rnorm(20))


erplots documentation built on Oct. 4, 2026, 5:06 p.m.