samples: Extract sampling distributions from bootstrapped linear/loess...

Description Usage Arguments Value Author(s) Examples

Description

Extract sampling distributions of various entities from either a linear model or a loess bootstrap. Entities for linear models are currently, model coefficients, residual sum of squares, R-square, and fitted values (given a set of X values in the original bootstrap). For loess, one can extract residual sum of squares and fitted values.

Usage

1
samples(object, name = c("fitted", "coef", "rsquare", "rss"))

Arguments

object

The output from either lm.boot or loess.boot.

name

The name of the entity to extract. The default is fitted values.

Value

Either a vector or matrix depending on the entity extracted. For example, when extracting the sampling distributions for linear model coefficents, the return value is p x R matrix where p is the number of coefficients and R is the number of bootstrap replicates.

Author(s)

Roger D. Peng

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(airquality)
attach(airquality)
lmodel <- lm(Ozone ~ Solar.R + Wind)
lboot <- lm.boot(lmodel, R = 100)

## Get sampling distributions for coefficients
s <- samples(lboot, "coef")

## Histogram for the intercept
hist(s[1,])

simpleboot documentation built on May 2, 2019, 4:16 a.m.