pairwiseCImethodsCount: Confidence intervals for two sample comparisons of count data

Description Usage Arguments Details Value Author(s) References Examples

Description

Confidence interval methods available for pairwiseCI for comparison of two independent samples. Methods for count data.

Usage

1
2
3
Poisson.ratio(x, y, conf.level=0.95, alternative="two.sided")
Quasipoisson.ratio(x, y, conf.level=0.95, alternative="two.sided")
Negbin.ratio(x, y, conf.level=0.95, alternative="two.sided")

Arguments

x

vector of observations in the first sample

y

vector of observations in the second sample

alternative

character string, either "two.sided", "less" or "greater"

conf.level

the comparisonwise confidence level of the intervals, where 0.95 is default

Details

Note, that for all the methods, a separate glm is fitted for each two-sample comparison! When a common model can be reasonbly assumed for all the data, there are smarter methods of constructing confidence intervals for groupwise comparisons, based on a common model, see e.g. the function confint in package stats, the function confint.glm in package MASS and the function confint.glht in package multcomp.

Note, that the code used here is slightly changed from the original code by Venables and Ripley, or Bates and Watts. An limit is imposed on the parameter space in which the profile is constructed. By that limitation, intervals can also be constructed for extreme cases with all observations in one group being zero.

Note, that the Poisson.ratio can be used when only one count is present in each group. For Quasipoisson.ratio, Negbin.ratio, repeated observations are necessary in each group.

Value

A list containing:

conf.int

a vector containing the lower and upper confidence limit

estimate

a single named value

Author(s)

Daniel Gerhard, Frank Schaarschmidt

References

Venables WN and Ripley BD (2002). Modern Applied Statistics using S, Fourth Edition. Springer New York. Bates, D.M. and Watts, D.G.(1988). Nonlinear Regression Analysis and Its Applications. John Wiley and Sons, New York.

Examples

1
2
3
4
5
6
7
8
9
df <- data.frame(count = rpois(n=20, lambda=5), treat=rep(LETTERS[1:4], each=5))

QPCI<-pairwiseCI(count ~ treat, data=df,
 alternative="two.sided", control="A", method="Quasipoisson.ratio")
 
QPCI


 

pairwiseCI documentation built on May 1, 2019, 6:51 p.m.