bootstrapSamples: Obtain bootstrap samples for linear regression coefficients

Description Usage Arguments Details Author(s) Examples

View source: R/bootstrapSamples.R

Description

Obtain bootstrap samples for linear regression coefficients using six different methods.

Usage

1

Arguments

lmodObs

The observed linear model estimated by least squares. A fitted model object of class inheriting from 'lm'.

formula

A string that can be coerced into class 'formula'. Usually of the form response variable \sim predictor variables. A symbolic description of the model to be fitted.

data

data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model.

B

The number of bootstrap replicates. Usually this will be a single positive integer.

Details

This function is a wrapper for bootCases, bootResids, and bootWild. This function obtains the bootstrapped sampling distributions for linear regression coefficients obtained in each of six methods: case resampling, residual resampling, Wild bootstrap with Mammen's Two-Point Distribution, Wild bootstrap with Mammen's Continuous Distribution, Wild boostrap with Rademacher Distribution, and Wild bootstrap with Standard Normal Distribution.

Author(s)

Natalie DelRocco

Examples

1
2
3
4
5
library(faraway)
data(prostate)
lmod <- lm(lpsa ~ lcavol + age + lweight, prostate)
bootsamps <- bootstrapSamples(lmodObs=lmod, formula='lpsa ~ lcavol + age + lweight',
                              data=prostate, B=1000)

ndelrocco/lmBootCompare documentation built on Dec. 10, 2019, 12:38 p.m.