proportion.CI: Large Sample Confidence Interval for a Population Proportion

Description Usage Arguments Details Value Examples

View source: R/proportion.CI.R

Description

proportion.CI provides a pointwise estimation and a confidence interval for a population proportion.

Usage

1
proportion.CI(x, n, conf.level)

Arguments

x

a single numeric value corresponding with either the proportion estimate or the number of successes of the sample.

n

a single positive integer corresponding with the sample size.

conf.level

a single numeric value corresponding with the confidence level of the interval; must be a value in (0,1).

Details

Counts of successes and failures must be nonnegative and hence not greater than the corresponding numbers of trials which must be positive. All finite counts should be integers.

If the number of successes are given, then the proportion estimate is computed.

Value

A list containing the following components:

estimate

numeric value corresponding with the sample proportion estimate.

CI

a numeric vector of length two containing the lower and upper bounds of the confidence interval.

Independently on the user saving those values, the function provides a summary of the result on the console.

Examples

1
2
3
4
5
#Given the sample proportion estimate
proportion.CI(0.3, 100, conf.level=0.95)

#Given the number of successes
proportion.CI(30,100,conf.level=0.95)

LearningStats documentation built on April 21, 2021, 9:06 a.m.