CI {pgirmess}R Documentation

Confidence interval of percentages

Description

Provides a n x 2 matrix with the lower limit (column 1) and upper limit (column 2) of the 95 percent confidence interval of percentages

Usage

CI(x, y, totrials = FALSE)

Arguments

x a vector with the number of positive observations
y a vector of the same length as x with the number of negative observations, or of the total number of observations
totrials if false (the default) y is the number of negative observations; if true, y is the total number of observations

Details

Wrapper of prop.test().

Value

A matrix of length(x) rows and 2 columns. Column 1: lower limit; column 2: upper limit of the 95 percent confidence interval

Author(s)

Patrick Giraudoux <pgiraudo@univ-fcomte.fr

See Also

prop.test

Examples


x<-c(2,10,7,8,7) # eg: number of positive cases
y<-c(56,22,7,20,5)# eg: number of negative cases
CI(x,y)

x<-c(2,10,7,8,7) # eg: number of positive cases
y<-c(4,11,7,16,10)# eg: total number of cases
CI(x,y,totrials=TRUE)


[Package pgirmess version 1.3.7 Index]