pairwiseCImethodsProp {pairwiseCI}R Documentation

Confidence interval methods implemented for proportions in pairwiseCI

Description

For the comparison of two independent samples of binomial observations, confidence intervals for the difference (RD), ratio (RR) and odds ratio (OR) of proportions are implemented.

Usage


Prop.diff(x, y, conf.level=0.95, alternative="two.sided", CImethod="CC", ...)
Prop.ratio(x, y, conf.level=0.95, alternative="two.sided", CImethod="GNC")
Prop.or(x, y, conf.level=0.95, alternative="two.sided", CImethod="Woolf")

Arguments

x observations of the first sample: either a vector with number of success and failure, or a data.frame with two columns (the success and failures))
y observations of the second sample: either a vector with number of success and failure, or a data.frame with two columns (the success and failures))
alternative character string, either "two.sided", "less" or "greater"
conf.level the comparisonwise confidence level of the intervals, where 0.95 is default
CImethod a single character string, see below for details
... further arguments to be passed to the individual methods, see details

Details

Generally, the input are two vectors x and y giving the number of successes and failures in the two samples, or, alternatively, two data.frames x and y each containing one column for the successes and one column for the failures, and the rows containing repeated observations from the same treatment. Please note, that except for function prop.or with CImethod="Quasibinomial" the confidence intervals available in this function are based on sums over the rows of x and y and hence do NOT APPROPRIATELY account for extra.binomial variability between repeated observations for the same treatment!

Value

A list containing:

conf.int a vector containing the lower and upper confidence limit
estimate a single named value

References

Examples


# The rooting data.

data(rooting)

# the first comparison should be the same as:

Age5_PosB_IBA0 <- subset(rooting,
 Age=="5" & Position=="B" & IBA=="0")[,c("root", "noroot")]
Age5_PosB_IBA0.5 <- subset(rooting,
 Age=="5" & Position=="B" & IBA=="0.5")[,c("root", "noroot")]

Age5_PosB_IBA0
Age5_PosB_IBA0.5

Prop.diff(x=Age5_PosB_IBA0, y=Age5_PosB_IBA0.5)

Prop.ratio(x=Age5_PosB_IBA0, y=Age5_PosB_IBA0.5)

Prop.or(x=Age5_PosB_IBA0, y=Age5_PosB_IBA0.5)

# is the same as input two vectors x,y each containing
# the count of successes and the count of failures

 colSums(Age5_PosB_IBA0)
 colSums(Age5_PosB_IBA0.5)

Prop.diff(x=c(16,32),y=c(29,19))

Prop.ratio(x=c(16,32),y=c(29,19))

Prop.or(x=c(16,32),y=c(29,19))

 

[Package pairwiseCI version 0.1-11 Index]