Learn R Programming

BootstrapTests (version 0.1.0)

plot.bootstrapTest: Plot and print the bootstrap test statistics distribution

Description

The plot and print methods work for objects of class bootstrapTest. The print method prints the summary of the bootstrap test results. The plot method plots the distribution of bootstrapped test statistics as a histogram, with the true test statistic and the 95 bootstrapped test statistics highlighted. In the regression test case, the estimated regression line is plotted as well.

Usage

# S3 method for bootstrapTest
plot(
  x,
  xlim = NULL,
  breaks = NULL,
  legend.x = NULL,
  legend.y = NULL,
  ask = interactive(),
  plot_estimated_line = NULL,
  ...
)

# S3 method for bootstrapTest print(x, ...)

Value

These functions have no return value and are called solely for their side effects.

Arguments

x

an object of class bootstrapTest_independence or bootstrapTest

xlim

limits for the x-axis of the histogram

breaks

breaks for the histogram

legend.x

position of the legend on the x-axis

legend.y

position of the legend on the y-axis

ask

if TRUE, the user is asked to press Return to see the next plot. Used only if x is an object of class bootstrapTest_regression.

plot_estimated_line

Boolean describing whether to plot the estimated regression line in case x is of class "bootstrapTest_regression", i.e. output from perform_regression_test. By default, plot_estimated_line = NULL, with the meaning that the plot is done only if one estimated way of bootstrapping is given.

...

additional arguments passed to the hist function (in the case of the plot method) or ignored (in the case of the print method).

References

Derumigny, A., Galanis, M., Schipper, W., & van der Vaart, A. (2025). Bootstrapping not under the null? ArXiv preprint, tools:::Rd_expr_doi("10.48550/arXiv.2512.10546")

See Also

perform_independence_test, perform_GoF_test, perform_regression_test, which are the functions that generate such object x.