boot_grf: Simple clustered bootstrap.

View source: R/rank_average_treatment.R

boot_grfR Documentation

Simple clustered bootstrap.

Description

Inspired by the 'boot' function in the bootstrap package with clusters + half-sampling added. A future TODO could be to add parallel (not necessarily worth it) https://stat.ethz.ch/R-manual/R-devel/library/parallel/doc/parallel.pdf

Usage

boot_grf(data, statistic, R, clusters, half.sample = TRUE, ...)

Arguments

data

A data frame with the original data.

statistic

A function computing estimate(s) with signature (data, indices, ...) where data is the original data, and indices a vector which defines the bootstrap sample.

R

The number of bootstrap replications.

clusters

Integer vector of cluster assignment, setting to 1:N corresponds to an ordinary unclustered bootstrap.

half.sample

Whether to do half sample bootstrap (half the clusters are drawn). Default is TRUE.

...

Additional arguments passed on to statistic.

Value

A list with the original estimate t0, and bootstrap estimates t.

References

Angelo Canty and Brian Ripley (2021). boot: Bootstrap R (S-Plus) Functions.


grf documentation built on June 24, 2024, 5:20 p.m.