conf_int: conf_int

Description Usage Arguments Value Examples

View source: R/conf_int.R

Description

A helper function for generating symmetric confidence intervals using a t or standard normal distribution. The confidence interval is a 100(1 - alpha)% confidence interval.

Usage

1
conf_int(.tbl, .alpha, .interval = "t")

Arguments

.tbl

Output from mk_stat or stratified_estimator

.alpha

The confidence level.

.interval

Either "t" or "z". If "t", degrees of freedom are inferred from the input .tbl

Value

A list with

level

The percentage of the confidence interval, 100(1-alpha)

df

NA if .interval="z", otherwise the degrees of freedom used in t interval

lower

The lower bound of the confidence interval

upper

The upper bound of the confidence interval

Examples

1
2
3
4
5
6
7
# Simplified output similar to stratified_sample
ds <- tibble::tibble(Ntotal=10, ntotal=4, point=3, se=1)
conf_int(ds, 0.05, "t")

# Simplified output from mk_stat
d <- tibble::tibble(n = 4, point=3, se=1)
conf_int(d, 0.05, "t")

danjdrennan/surveyr documentation built on Dec. 19, 2021, 8:08 p.m.