I've been reading a lot these last few days about how to get a p-value from bootstrap for regression models (not by permutation). For each coefficient of the model, the null hypothesis is that the coefficient equals 0 and H1 is that it is different to 0 (bilateral test).
The most noticeable similar subjects are the following two questions on stackexchange, but the answers confuse me a lot:
- How to obtain p-values of coefficients from bootstrap regression?
- Computing p-value using bootstrap with R
From what I've read, I noticed several approaches, but I can't figure out which is the valid one:
-
Should my bootstrap function return the test statistic calculated for each sample, or the estimate?
-
Should I calculate the proportion of the test statistic/estimate above 0 or above the point estimate of the base model?
-
Should I multiply the result by 2 because the test is bilateral or use absolute values?
Best Answer
Suppose we want to test the null hypothesis that a regression coefficient = 0 using bootstrap, and say we decide 0.05 to be the level of significance. Now, we can generate the sampling distribution for each coefficient using bootstrap. It is easy to check if 0 falls within 95% confidence interval, thus we can easily decide whether we can reject the null or not.
To get a p-value, we need to check what is the quantile value of 0 in the sampling distribution. (I am using a quantile based approach there are other methods to do it which can be found here Fox on Regression) After you get the quantile,Q, the p-value is 2*Q or 2*(1-Q) depending on whether Q > 0.5 or less than 0.5.
As an illustration of the approach, consider this
Build linear model
Bootstrap
Here is the model
Notice the p-values
Subset of regression coefficient generated using bootstrap
Generate p-values with bootstrap
Comparing p-values from t-test and bootstrap
T test
Bootstrap
The highly significant p-values with coefficients < 1e-8 are all 0 with bootstrap with 1e4 iterations. Furthermore, the ranking of p-values is comparable as well.