print.resample: Methods for common generic functions for resample objects

View source: R/resample.R

print.resampleR Documentation

Methods for common generic functions for resample objects

Description

Methods for common generic functions. The methods operate primarily on the replicates (resampled statistics).

Usage

## S3 method for class 'resample'
print(x, ...)
## S3 method for class 'resample'
hist(x, ..., resampleColumns = 1:x$p, xlim = NULL,
                xlab = NULL, main = "", col = "blue", border = 0,
                breaks = "FD", showObserved = TRUE,
                legend = TRUE, args.legend = NULL)
## S3 method for class 'resample'
plot(x, ...)
## S3 method for class 'resample'
qqnorm(y, ..., resampleColumns = 1:y$p, ylab = NULL,
                pch = if(y$R < 100) 1 else ".")
## S3 method for class 'resample'
quantile(x, ...)

Arguments

x,y

a "resample" object, usually produced by one of bootstrap, bootstrap2, permutationTest, or permutationTest2.

...

additional arguments passed to the corresponding generic function.
For plot.resample, these are passed to hist.resample.

resampleColumns

integer subscripts, or names of statistics. When a statistic is a vector, resampleColumns may be used to select which resampling distributions to plot.

xlim

limits for the x axis.

xlab, ylab

x and y axis labels.

main

main title

col

color used to fill bars, see hist.

border

color of the order around the bars, see hist.

breaks

method for computing breaks, see hist.

showObserved

logical, if TRUE then vertical lines are shown at the observed statistic and mean of the bootstrap replicates.

legend

logical, if TRUE a legend is added. Not used if showObserved = FALSE.

args.legend

NULL or a list of arguments to pass to legend.

pch

plotting character, see par.

Details

hist.resample displays a histogram overlaid with a density plot, with the observed value of the statistic indicated.

plot.resample currently just calls hist.resample.

Value

For quantile.resample, a matrix with one row for each statistic and one column for each value in probs. This uses type=6 when calling quantile, for wider (more accurate) quantiles than the usual default.

The other functions are not called for their return values.

Author(s)

Tim Hesterberg timhesterberg@gmail.com,
https://www.timhesterberg.net/bootstrap-and-resampling

See Also

resample-package, bootstrap, bootstrap2, jackknife, permutationTest,
permutationTest2, quantile.

Examples


# See full set of examples in resample-package
data(Verizon)
CLEC <- with(Verizon, Time[Group == "CLEC"])
bootC <- bootstrap(CLEC, mean, seed = 0)
print(bootC)
hist(bootC)
qqnorm(bootC)
quantile(bootC, probs = c(.25, .975))
# That is the percentile interval with expand = FALSE
CI.percentile(bootC)


resample documentation built on June 13, 2022, 5:08 p.m.