bootstrap(data, statistic, B = 1000,
args.stat = NULL, seed = NULL, sampler = samp.bootstrap,
label = NULL, statisticNames = NULL, block.size = 100,
trace = FALSE)
bootstrap2(data, statistic, treatment, data2 = NULL, B = 1000,
ratio = FALSE,
args.stat = NULL, seed = NULL, sampler = samp.bootstrap,
label = NULL, statisticNames = NULL, block.size = 100,
trace = FALSE)
permutationTest(data, statistic, B = 999,
alternative = "two.sided", resampleColumns = NULL,
args.stat = NULL, seed = NULL, sampler = samp.permute,
label = NULL, statisticNames = NULL, block.size = 100,
trace = FALSE)
permutationTest2(data, statistic, treatment, data2 = NULL, B = 999,
alternative = "two.sided", ratio = FALSE, paired = FALSE,
args.stat = NULL, seed = NULL, sampler = samp.permute,
label = NULL, statisticNames = NULL, block.size = 100,
trace = FALSE)mean(myData, trim = .2).treatment or
data2.data; the second sample."two.sided", "greater", or "less".
If statistic returns a vector, this may be a vector
of the same length.FALSE then statistics for two samples are combined using
statistic1 - statistic2 (the statistics from the two samples).
If TRUE, it uses statistic1 / statistic2.data);
if supplied then only these columns of the data are permuted.
For example, for a permutation test of the correlation of x and y,
only one of the variables should be perstatistic, if
it is a function.TRUE then observations in data and
data2 are paired, and permutations are done within each pair.
Not yet implemented.help(samp.bootstrap).statistic, giving names.B replicates are done this many at a time.TRUE an indication of progress is printed."bootstrap2"), that inherits from "resample",
with components:B rows and p columns.length(observed).p rows, with columns
"observed", "mean" (the mean of the replicates),
and other columns appropriate to resampling; e.g. the bootstrap
objects have columns "SE" and "Bias",
while the permutation test objects have "Alternative"
and "PValue".print, plot, hist, qqnorm,
quantile.data2statistic = colMeans(data)statistic = mean(myData$x)statistic = mean(myData[, "x"]) For the statistic, you may supply a function, or an expression.
For example, if data = x, you may specify any of
statistic = meanstatistic = mean(x)statistic = mean(data)resample-package,
samp.bootstrap,
limits.percentile,
limits.t.mydata <- data.frame(a = runif(40), b = rnorm(40))
boot1 <- bootstrap(mydata, colMeans)
boot1
par(mfrow = c(2,1))
plot(boot1)
qqnorm(boot1)
par(mfrow = c(1,1))
boot2 <- bootstrap(mydata, mean(a))
boot2Run the code above in your browser using DataLab