bootcoefs: Bootstrap the regression coefficients for a robust linear...

Description Usage Arguments Details Value Methods (by class) References Examples

View source: R/bootcoefs-methods.R

Description

This function provides an easy interface and useful output to bootstrapping the regression coefficients of robust linear regression models

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
bootcoefs(object, R = 999, method = c("frb", "residuals", "cases"),
  ncpus = NULL, cl = NULL, ...)

## S3 method for class 'complmrob'
bootcoefs(object, R = 999, method = c("frb",
  "residuals", "cases"), ncpus = NULL, cl = NULL, ...)

## S3 method for class 'lmrob'
bootcoefs(object, R = 999, method = c("frb", "residuals",
  "cases"), ncpus = NULL, cl = NULL, ...)

Arguments

object

the model to bootstrap the coefficients from

R

the number of bootstrap replicates.

method

one of "frb" for fast and robust bootstrap, "residuals" to resample the residuals or "cases" to resample the cases.

ncpus

the number of CPUs to utilize for bootstrapping.

cl

a snow or parallel cluster to use for bootstrapping.

...

currently ignored.

Details

The default method is to use fast and robust bootstrap as described in the paper by M. Salibian-Barrera, et al. (see references). The other options are to bootstrap the residuals or to bootstrap cases (observations), but the sampling distribution of the estimates from these methods can be numerically instable and take longer to compute.

Value

A list of type bootcoefs for which print, summary and plot methods are available

Methods (by class)

References

M. Salibian-Barrera, S. Aelst, and G. Willems. Fast and robust bootstrap. Statistical Methods and Applications, 17(1):41-71, 2008.

Examples

1
2
3
4
5
6
data <- data.frame(lifeExp = state.x77[, "Life Exp"], USArrests[ , -3])
mUSArr <- complmrob(lifeExp ~ ., data = data)
bc <- bootcoefs(mUSArr, R = 200) # the number of bootstrap replicates should
                                 # normally be higher!
summary(bc)
plot(bc) # for the model diagnostic plots

Example output

Robust linear regression with compositional covariates
complmrob(formula = lifeExp ~ ., data = data)

Standard errors and derived statistics are base on 200 bootstrap replications

Coefficients:
            Estimate     bias Std. Error Pr(b<>0)   
(Intercept) 70.65261 -0.24198    2.06894  0.00498 **
Murder      -2.23318 -0.01281    0.46259  0.00498 **
Assault     -1.04628  0.12812    1.10469  0.18905   
Rape         3.27946 -0.15222    0.61214  0.00498 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Confidence intervals:
            Estimate   2.5 %  97.5 %
(Intercept)  70.6526 65.6610 74.2156
Murder       -2.2332 -3.3032 -1.3616
Assault      -1.0463 -2.6442  1.6064
Rape          3.2795  1.9121  4.2620

Robust residual standard error: 0.6931 
Multiple R-squared: 0.7115	Adjusted R-squared: 0.6992
Warning: Ignoring unknown aesthetics: ymax

complmrob documentation built on May 29, 2017, 7:10 p.m.