pairwiseCImethodsCont {pairwiseCI} | R Documentation |
Confidence interval methods implemented for continuous data in pairwiseCI
Description
Confidence interval methods available for pairwiseCI for comparison of two independent samples. Methods for continuous variables.
Usage
Param.diff(x, y, conf.level=0.95, alternative="two.sided", ...)
Param.ratio(x, y, conf.level=0.95, alternative="two.sided", ...)
Lognorm.diff(x, y, conf.level=0.95, alternative="two.sided", sim=10000, ...)
Lognorm.ratio(x, y, conf.level=0.95, alternative="two.sided", sim=10000, ...)
HL.diff(x, y, conf.level=0.95, alternative="two.sided", ...)
HL.ratio(x, y, conf.level=0.95, alternative="two.sided", ...)
Median.diff(x, y, conf.level=0.95, alternative="two.sided", ...)
Median.ratio(x, y, conf.level=0.95, alternative="two.sided", ...)
HD.diff(x, y, conf.level=0.95, alternative="two.sided", ...)
HD.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 |
sim |
a single integer value, specifying the number of samples to be drawn for calculation of the empirical distribution of the generalized pivotal quantities |
... |
further arguments to be passed to the individual methods, see details |
Details
Param.diff
calculates the confidence interval for the difference
in means of two Gaussian samples by calling t.test
in package stats,
assuming homogeneous variances if var.equal=TRUE
,
and heterogeneous variances if var.equal=FALSE
(default);
Param.ratio
calculates the Fiellers (1954) confidence interval for the ratio
of two Gaussian samples by calling ratio.t.test
in package mratios,
assuming homogeneous variances if var.equal=TRUE
.
If heterogeneous variances are assumed (setting var.equal=FALSE
, the default), the test by Tamhane and Logan (2004) is inverted by solving a quadratic equation according to Fieller,
where the estimated ratio is simply plugged in order to get Satterthwaite approximated degrees of freedom. See Hasler and Vonk (2006) for some simulation results.
Lognorm.diff
calculates the confidence interval for the difference
in means of two Lognormal samples, based on general pivotal quantities (Chen and Zhou, 2005); currently, further arguments (...)
are not used;
Lognorm.ratio
calculates the confidence interval for the ratio
in means of two Lognormal samples, based on general pivotal quantities (Chen and Zhou, 2005); currently, further arguments (...)
are not used;
HL.diff
calculates the Hodges-Lehmann confidence interval for the difference of locations
by calling wilcox.exact
in package exactRankTests ;
HL.ratio
calculates the Hodges-Lehmann-like confidence interval for the ratio of locations
by calling wilcox.exact
in package exactRankTests for the logarithms of observations;
HD.diff
calculates a percentile bootstrap confidence interval for the difference
of “Harrell-Davis” estimates for location using code copied from hdquantile
in package Hmisc
and boot.ci
in boot, the number of bootstrap replications can be set
via R=999
(default) ;
HD.ratio
calculates a percentile bootstrap confidence interval for the ratio
of “Harrell-Davis” estimates for location using code copied from hdquantile
in package Hmisc
and boot.ci
in package boot, the number of bootstrap replications can be set
via R=999
(default);
Median.diff
calculates a percentile bootstrap confidence interval for the difference
of Medians using boot.ci
in package boot, the number of bootstrap replications can be set
via R=999
(default);
Median.ratio
calculates a percentile bootstrap confidence interval for the ratio
of Medians using boot.ci
in package boot, the number of bootstrap replications can be set
via R=999
(default);
Value
A list containing:
conf.int |
a vector containing the lower and upper confidence limit |
estimate |
a single named value |
References
Param.diff
uses t.test
in stats.
- Fieller EC (1954): Some problems in interval estimation.
Journal of the Royal Statistical Society, Series B, 16, 175-185.
- Tamhane, AC, Logan, BR (2004): Finding the maximum safe dose level for heteroscedastic data.
Journal of Biopharmaceutical Statistics 14, 843-856.
- Hasler, M, Vonk, R, Hothorn, LA: Assessing non-inferiority of a new treatment in a three arm trial in the presence of heteroscedasticity (submitted).
- Chen, Y-H, Zhou, X-H (2006): Interval estimates for the ratio and the difference of two lognormal means.
Statistics in Medicine 25, 4099-4113.
- Hothorn, T, Munzel, U: Non-parametric confidence interval for the ratio.
Report University of Erlangen, Department Medical Statistics 2002; available via:
http://www.imbe.med.uni-erlangen.de/~hothorn/.
HD.diff
xxx
HD.ratio
xxx
Median.diff
xxx
Median.ratio
xxx
Examples
##############################################
# Dieldrin example: Two-sample situation:
# The dieldrin example
data(dieldrin)
Ray<-subset(dieldrin, River=="Ray")$dieldrin
Thames<-subset(dieldrin, River=="aThames")$dieldrin
Ray
Thames
## CI for the difference of means,
# assuming normal errors and homogeneous variances :
thomo<-Param.diff(x=Thames, y=Ray, var.equal=TRUE)
# allowing heterogeneous variances
thetero<-Param.diff(x=Thames, y=Ray, var.equal=FALSE)
## Fieller CIs for the ratio of means,
# also assuming normal errors:
Fielhomo<-Param.ratio(x=Thames, y=Ray, var.equal=TRUE)
# allowing heterogeneous variances
Fielhetero<-Param.ratio(x=Thames, y=Ray, var.equal=FALSE)
## Hodges-Lehmann Intervalls for difference and ratios:
HLD<-HL.diff(x=Thames, y=Ray)
# allowing heterogeneous variances
HLR<-HL.ratio(x=Thames, y=Ray)
## Percentile Bootstrap intervals of Harrell-Davis estimators:
HDD<-HD.diff(x=Thames, y=Ray)
# allowing heterogeneous variances
HDR<-HD.ratio(x=Thames, y=Ray)
## Percentile Bootstrap intervals of Medians:
MedianD<-Median.diff(x=Thames, y=Ray)
# allowing heterogeneous variances
MedianR<-Median.ratio(x=Thames, y=Ray)
thomo
thetero
Fielhomo
Fielhetero
HLD
HLR
HDD
HDR
MedianD
MedianR
# # #
# Lognormal CIs:
x<-rlnorm(n=10, meanlog=0, sdlog=1)
y<-rlnorm(n=10, meanlog=0, sdlog=1)
Lognorm.diff(x=x, y=y)
Lognorm.ratio(x=x, y=y)
[Package
pairwiseCI version 0.1-15
Index]