[R] bootstrapping in regression
Thomas Mang
thomas.mang at fiwi.at
Thu Jan 29 23:51:56 CET 2009
Greg Snow wrote:
> What you are describing is actually a permutation test rather than a bootstrap (related concepts but with a subtle but important difference).
>
> The way to do a permutation test with multiple x's is to fit the reduced model (use all x's other than x1 if you want to test x1) on the original data and store the fitted values and the residuals.
>
> Permute the residuals (randomize their order) and add them back to the fitted values and fit the full model (including x1 this time) to the permuted data set. Do this a bunch of times and it will give you the sampling distribution for the slope on x1 (or whatever your set of interest is) when the null hypothesis that it is 0 given the other variables in the model is true.
Hi,
Thanks to you and Tom for the correction regarding bootstrapping vs
permutation, and to Chuck for the cool link. Yes of course I described a
permutation.
I have a question here: I am not sure if I understand your 'fit the full
model ... to the permuted data set'. Am I correct to suppose that once
the residuals of the reduced-model fit have been permuted and added back
to the fitted values, the values obtained this way (fitted + permuted
residuals) now constitute the new y-values to which the full model is
fitted? Is that correct ?
Do you know if this procedure is also valid for a mixed-effects model ?
thanks a lot,
Thomas
> Permuting just x1 only works if x1 is orthogonal to all the other predictors, otherwise the permuting destroys the relationship with the other predictors and does not do the test you want.
>
> Bootstrapping depends on sampling with replacement, not permuting, and is used more for confidence intervals than for tests (the reference by John Fox given to you in another reply can help if that is the approach you want to take).
>
> Hope this helps,
>
More information about the R-help
mailing list