Learn R Programming

SciencesPo (version 1.3.9)

bootstrap: Method for Bootstrapping

Description

This method is intended to be provides statistical models that support bootstrapping.

This function is used to estimating standard errors when the distribution is not know.

This method is used to bootstrapping statistical models, typically of class lm or glm.

Usage

bootstrap(x, ...)

## S3 method for class 'default': bootstrap(x, nboots = 100, FUN, ...)

## S3 method for class 'model': bootstrap(x, ...)

Arguments

x
is a vector or a fitted model object whose parameters will be used to produce bootstrapped statistics. Model objects are from the class glm or lm.
nboots
The number of bootstraps.
FUN
the name of the statistic to bootstrap, ie., 'mean', 'var', 'cov', etc as a string.
...
further arguments passed to or used by other methods.

Value

  • A list with the alpha and beta slots set. Note that alpha corresponds to ancillary parameters and beta corresponds to systematic components of the model.

encoding

UTF-8

Examples

Run this code
x = runif(10, 0, 1)
bootstrap(x,FUN=mean)

Run the code above in your browser using DataLab