[R] Boot

John Fox jfox at mcmaster.ca
Fri Mar 7 13:27:46 CET 2003


Dear Jacob,

The appendix on bootstrapping to my R and S-PLUS Companion, available on 
the web at 
<http://www.socsci.mcmaster.ca/jfox/Books/Companion/appendix-bootstrapping.pdf>, 
discusses fixed-X resampling (which is what you're getting at here, I 
think) and includes an example.

I hope that this helps,
  John

At 09:21 AM 3/7/2003 +0200, Jacob van Wyk wrote:
>Hallo
>Could anybody please help.
>I have a simple linear regression model with 5 predictors. I want to
>use "bootstrap residuals" to make inferences regarding beta(2)hat. After
>fitting the model y=b0+b1+b2+b3+b4+b5 I tried the following:
>
>mod <- lm(y ~ x1+x2+x3+x4+x5)
>res <- resid(mod)
>pred <- predict(mod)
>
>Now, I have tried
>
>boot(res, lm(res+pred ~ x1+x2+x3+x4+x5)$coef[3], R=1999)
>
>The problem is with the "statistic". How should I "define" this?

-----------------------------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox at mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox
-----------------------------------------------------



More information about the R-help mailing list