General Instructions

To do each example, just click the Submit button. You do not have to type in any R instructions or specify a dataset. That's already done for you.

Bias Estimation

Section 10.3 in Efron and Tibshirani.

Comments

Everything pretty obvious here.

Improved Bias Estimation

Section 10.4 in Efron and Tibshirani.

Comments

More on Resampling Form Estimators

Comments

The function rmedian calculates the median of a bootstrap sample given in resampling form.

The code is a bit tricky. The statement

    n.star <- round(p * n)
converts p back to counts, the round function being there to make sure the result is exactly integer-valued (not just close). Then the statement
    k.star <- rep(1:n, n.star)
converts these back to the index values that were counted: each element of the sequence 1:n is repeated as many times as the corresponding count in n.star. The resulting k.star inside the function definition is just like the k.star outside the function definition except for order, which doesn't matter. Then we can use k.star to make x.star in the usual way, and apply the function that computes the estimator to x.star in the usual way.

We try it out, and indeed do get the same answers either way.

Clearly, this function has nothing particular to do with medians. Changing the last line lets it calculate any other function.