sbayesboot()
performs a Bayesian bootstrap of a regression model.
Value
sbayesboot()
takes a fitted regression model and returns a matrix
of bootstrapped coefficients (with intercept). These could be easily
converted to a data frame for ease of summary.
Details
The code underpinning sbayesboot()
is largely derived from
code provided by Grant McDermott and Vincent Arel-Bundock. My approach here
takes the flexibility of McDermott's model-agnostic code (along with the
ease of specifying clusters) and combines it with Arel-Bundock's
update()
approach to the actual bootstrapping. I may have screwed
something up, so feel free to point to cases where I did screw up.
Examples
# \donttest{
M1 <- lm(mpg ~ disp + wt + hp, mtcars)
# Default options
BB1 <- sbayesboot(M1)
# Cluster bootstrap on cylinder variable
BB2 <- sbayesboot(M1, cluster=~cyl)
# }