CIsim(n, samples = 100, rdist = rnorm, args = list(),
estimand = 0, conf.level = 0.95, method = t.test,
method.args = list(), interval = function(x) {
do.call(method, c(list(x, conf.level = conf.level), method.args))$conf.int
}, estimate = function(x) {
do.call(method, c(list(x, conf.level = conf.level), method.args))$estimate
}, verbose = TRUE)
rdist
htest
can be used here.method
lower
, upper
,
estimate
, cover
('Yes' or 'No'), and
sample
is returned invisibly. See the examples
for a way to use this to display the intervals
graphically.CIsim(10,1000) # 1000 95\% intervals using t.test; population is N(0,1)
CIsim(10,1000, rdist=rexp, estimand=1) # this time population is Exp(1)
if (require(Hmisc)) {
xYplot(Cbind(estimate,lower,upper) ~ sample,
data=CIsim(10,100, rdist=rexp, estimand=1),
par.settings=col.mosaic(), groups=cover)
ladd(panel.abline(h=1))
}
Run the code above in your browser using DataLab