Two bootstrap techniques to get confidence intervals for regression coefficients are the case/pair bootstrap method and the residual bootstrap method.

## Case Bootstrap

The case or sometimes called pair is the response variables paired with the predictor variables .

- For B bootstrap samples
- Take a sample with replacement of size from the corresponding bootstrap sample will be .
- Fit a model to
- Use the bootstrap regression coefficients to form confidence intervals for each coefficients.

## Residual Bootstrap

First fit a model of the form

where

- For B bootstrap samples
- Take a sample with replacement of size from the corresponding bootstrap sample will be .
- Fit model to
- Use the bootstrap regression coefficients to form confidence intervals for each coefficients.

## R Example Case Bootstrap

1 2 3 4 5 6 7 8 9 10 11 12 13 |
library(boot) data(survival) # load survival dataset into memory # fit linear regression model to bootstrap sample (y*, x*) fit.boot <- function(data, i){ fit_b <- lm(log(surv) ~ dose, data[i,]) coef(fit_b) } # bootstrap fit.boot R times surv.boot <- boot(survival, fit.boot, R=1000, ncpus = 4, parallel="snow") surv.boot |

1 2 3 4 5 6 7 8 9 10 11 12 |
ORDINARY NONPARAMETRIC BOOTSTRAP Call: boot(data = survival, statistic = fit.boot, R = 1000, parallel = "snow", ncpus = 4) Bootstrap Statistics : original bias std. error t1* 3.82364794 0.1074865998 0.73254328 t2* -0.00591454 -0.0002720479 0.00157819 |

## R Example Residual Bootstrap

1 2 3 4 5 6 7 8 9 10 11 |
# fit linear regression model to bootstrap sample (y*, x*) fit.boot <- function(res, i, x){ res_b <- res[i] # residual bootstrap fit_b <- lm((log(surv) + res_b) ~ dose, x) coef(fit_b) } # bootstrap fit.boot R times fit <- lm(log(surv) ~ dose, survival) surv.boot <- boot(fit$residuals, fit.boot, R=1000, ncpus = 4, parallel="snow", x=survival) surv.boot |

1 2 3 4 5 6 7 8 9 10 11 12 |
ORDINARY NONPARAMETRIC BOOTSTRAP Call: boot(data = fit$residuals, statistic = fit.boot, R = 1000, x = survival, parallel = "snow", ncpus = 4) Bootstrap Statistics : original bias std. error t1* 3.82364794 -5.742551e-03 0.780623113 t2* -0.00591454 9.932477e-06 0.001006054 |

I didn’t set a seed so other runs might give different values due to random sampling.

t1* and t2* are the bootstrap estimates for the **intercept** and the **dose** term respectively.

These methods are good when there are few samples. The case bootstrap method is robust to outliers because some bootstrap samples will contain the outlier and will not which will capture the uncertainty due of the outliers.

You must log in to post a comment.