conf_interval_width: Compute width of confidence interval

conf_interval_widthR Documentation

Compute width of confidence interval

Description

Calculate the width of a confidence interval given a standard error and sample size. Based on the t distribution.

Usage

conf_interval_width(se, n = Inf, confidence_level = 0.95, single_arm = T)

Arguments

se

(numeric scalar) The standard error.

n

(numeric scalar) The sample size. Defaults to Inf.

confidence_level

(numeric scalar) The confidence level. Defaults to .95.

single_arm

(logical scalar) Whether to calculate the width for a single arm. Defaults to TRUE.

Value

The width of the confidence interval.

Examples

conf_interval_width(1) #about 1.96
conf_interval_width(1, confidence_level = .99) #about 2.58

Deleetdk/kirkegaard documentation built on Feb. 28, 2025, 5:04 p.m.