diffproportion.CI: Large Sample Confidence Interval for the Difference between...

Description Usage Arguments Details Value Examples

View source: R/diffproportion.CI.R

Description

diffproportion.CI provides a pointwise estimation and a confidence interval for the difference between two population proportions.

Usage

1
diffproportion.CI(x1, x2, n1, n2, conf.level)

Arguments

x1

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

x2

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

n1

a single positive integer value corresponding with one sample size.

n2

a single positive integer value corresponding with the other 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

a numeric value corresponding with the difference between the two sample proportions.

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
6
7
8
#Given the sample proportion estimate
diffproportion.CI(0.3,0.4,100,120,conf.level=0.95)

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

#Given in one sample the number of successes and in the other the proportion estimate
diffproportion.CI(0.3,48,100,120,conf.level=0.95)

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