Learn R Programming

metaHelper (version 1.0.0)

CI_from_proportions: Confidence Interval for Proportions

Description

Calculates a confidence interval for proportions. For a discussion on the differences between methods to calculate confidence intervals, see the Stack Overflow discussion under References. This method uses the R package "confintr" to calculate the confidence intervals.

Usage

CI_from_proportions(events, n, method = "Clopper-Pearson")

Value

List of confidence interval of proportions if input length > 1. If input length = 1 Lower CI and Upper CI.

Arguments

events

number of events

n

sample size

method

the method ("Clopper-Pearson", "Agresti-Coull", "Wilson") that should be used to calculate the confidence intervals.

References

Confintr Function Description Stackoverflow Method Discussion

Examples

Run this code
# CI for 9 events in a sample of 10
CI_from_proportions(9, 10)

Run the code above in your browser using DataLab