Learn R Programming

saeRobust (version 0.1.0)

bootstrap: Fit model on Bootstrap sample

Description

These functions help to repeatedly fit a rfh model on bootstrap samples. Use bootstrap as a user interface. boot can be used to extend the framework but is not meant to be used interactively. If you are interested in the parameteric bootstrap for a 'rfh' model you can use the implementation in mse.

Usage

bootstrap(object, matV = variance(object), B = NULL, ...)
boot(object, matV, B, ...)
"boot"(object, matV, B, filter = NULL, postProcessing = identity, ...)
"boot"(object, matV, B, ...)

Arguments

object
a fitted object
matV
the variance of a fitted object used to draw samples. In most cases this is object. Alternatively it may be useful to use a non-robust model.
B
the number of repetitions
...
arguments passed down to methods
filter
a vector indicating which elements in the fittedd object to keep in each repetition.
postProcessing
a function to process the results. Is applied before the filter.

Examples

Run this code
data(milk, package = "sae")
milk$samplingVar <- milk$SD^2
modelFit <- rfh(yi ~ as.factor(MajorArea), milk, "samplingVar")
bootstrapCoefs <- bootstrap(modelFit, B = 2, filter = "coefficients")
do.call(rbind, unlist(bootstrapCoefs, FALSE))

Run the code above in your browser using DataLab