pairwiseCImethodsProp {pairwiseCI} | R Documentation |
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.
Prop.diff(x, y, conf.level=0.95, alternative="two.sided", ...) Prop.diffAdd2(x, y, conf.level = 0.95, alternative = "two.sided", ...) Prop.ratio(x, y, conf.level=0.95, alternative="two.sided") Prop.or(x, y, conf.level=0.95, alternative="two.sided")
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 |
... |
further arguments to be passed to the individual methods, see details |
Prop.diff
calculates the asymptotic Continuity Corrected confidence interval for the difference
of proportions by calling prop.test
in package stats, where the input are two
vectors x and y giving the number of successes and failures in the two samples;
Prop.diffAdd2
Uses the package binMto to calculate the confidence interval
proposed by Agresti and Caffo (2000).
Prop.ratio
calculates the crude interval for the ratio of proportions
according to Gart and Nam (1988), based on normal approximation on the log-scale.
Prop.or
calculates the adjusted Woolf confidence interval for
the odds ratio of proportions according to Lawson (2005).
A list containing:
conf.int |
a vector containing the lower and upper confidence limit |
estimate |
a single named value |
Frank Schaarschmidt, Institute of Biostatistics, Leibniz University of Hannover, Germany
Prop.diff
uses prop.test
in stats. This is currently the continuity corrected interval CC,
as described in Newcombe R.G. (1998): Interval Estimation for the Difference Between Independent Proportions: Comparison of Eleven Methods. Statistics in Medicine 17, 873-890.
Prop.diffAdd2
: Calls the Agresti-Caffo-Interval as implemented in the package binMto.
The method is described in: Agresti, A. and Caffo, B. (2000): Simple and effective confidence intervals for proportions and differences of proportions result from adding two successes and two failures.
American Statistician 54 (4), 280-288.
Prop.ratio
Gart, JJ and Nam, J (1988): Approximate interval estimation of the ratio of binomial parameters: A review and corrections for skewness.
Biometrics 44, 323-338.
Additional simulation results are given in:
Dann, RS and Koch, GG (2005): Review and evaluation of methods for computing confidence intervals for the ratio of two proportions and considerations for non-inferiority clinical trials.
Journal of Biopharmaceutical Statistics, 15, 85-107.
Prop.or
e.g. in:
Lawson, R (2005): Small sample confidence intervals for the odds ratio.
Communication in Statistics Simulation and Computation, 33, 1095-1113.
# 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.or(x=Age5_PosB_IBA0,y=Age5_PosB_IBA0.5) Prop.ratio(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.or(x=c(16,32),y=c(29,19)) Prop.ratio(x=c(16,32),y=c(29,19))