Understanding P-Values and Bootstrap Sampling Distributions
Statistics & ExperimentsModel answerLast updated
Discuss why regression software displays p = 0.000, how to report it correctly, and how bootstrap resampling estimates coefficient uncertainty.
You've just fitted a linear regression model and notice that one coefficient's p-value is displayed as 0.000 in your statistical software output.
Part 1: Is it actually possible for a p-value to be exactly zero? What are the likely reasons software would display it this way, and how should you properly communicate the statistical significance of this result?
Part 2: Describe how you would use bootstrap resampling to estimate the sampling distribution of this regression coefficient. Explain what the expected value of the bootstrap distribution represents and how it relates to the true population parameter.
Hints
Hint 1
Consider that continuous distributions have non-zero density everywhere and think about numerical precision limits
Hint 2
Bootstrap resamples from your observed data—what does that tell you about where the bootstrap distribution will be centered?
Hint 3
Different data structures (time series, clustered, heteroskedastic) require different bootstrap resampling strategies
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Model Answer
Part 1: The Zero P-Value Phenomenon
Can a p-value truly be zero?
No. For standard parametric tests, p-values are computed from continuous distributions (t, normal, F, chi-squared) that have positive probability density across their entire support. A coefficient's two-sided p-value is computed as:
$$p = 2 \cdot P(T_{df} > |t|), \quad \text{where} \quad t = \frac{\hat{\beta}}{\text{SE}(\hat{\beta})}$$
Since the t-distribution's tails asymptote to zero but never reach it, any finite test statistic yields a strictly positive p-value. A displayed value of 0.000 means the true value is extremely small, not actually zero.
Why software shows 0.000:
-
Display formatting: Output rounded to three decimal places. A value like $p = 2.4 \times 10^{-5}$ appears as
0.000. -
Floating-point underflow: For very large test statistics (roughly $|t| > 37$ in normal approximations), tail probabilities fall below machine precision (~$10^{-308}$ for doubles) and underflow to exactly zero in memory.
-
Numerical precision limits: Some packages report
< 2.2e-16(machine epsilon) because computing $1 - \text{CDF}(x)$ for extreme $x$ loses precision. Using survival functions directly (scipy.stats.t.sf) maintains accuracy deeper into the tail. -
Resampling artifacts: Permutation or bootstrap tests with $B$ resamples have discrete resolution $1/B$. Without the continuity correction, zero extreme resamples yields exactly $p = 0$; the honest minimum is $p = 1/(B+1)$.
Genuine zeros indicate problems:
- Standard error of exactly zero (perfect multicollinearity, duplicate features, target leakage)
- Numerical instability or software bugs
- Degenerate model specification
These warrant immediate investigation.
How to report it properly:
- Use inequality notation: Report "p < 0.001" rather than "p = 0.000" or "p = 0"
- Provide the test statistic: Give $t = 8.3$ with degrees of freedom, which contains the same information without false precision
- Lead with effect size: "$\hat{\beta} = 0.037$ (95% CI: 0.028–0.046), t = 8.3, p < 0.001"
- Distinguish statistical from practical significance: With large samples, tiny effects become "statistically significant." In quantitative finance contexts, ask whether a 0.03% return prediction survives transaction costs.
- Acknowledge model dependence: Extreme tail probabilities assume correct specification, normality, homoskedasticity, and independence. Real data—especially financial time series—violate these through heavy tails, heteroskedasticity, and autocorrelation. Use robust standard errors (White, HAC/Newey-West) and treat the specific exponent as unreliable.
- Adjust for multiple comparisons: When testing many coefficients, apply Bonferroni or Benjamini-Hochberg corrections.
Part 2: Bootstrap Estimation of Sampling Distribution
Core principle:
The bootstrap treats your observed sample as a proxy for the population. By resampling with replacement from your data, you simulate drawing new samples from that empirical distribution, allowing you to estimate how your estimator varies across samples.
Algorithm (pairs/case bootstrap for regression):
- Fit the original model on data $(X, y)$ to obtain $\hat{\beta}$
- For $b = 1, \ldots, B$ iterations (typically 2,000–10,000):
- Sample $n$ observations with replacement: $(X^_b, y^_b)$
- Refit the model to get $\hat{\beta}^*_b$
- Analyze the bootstrap distribution ${\hat{\beta}^_1, \ldots, \hat{\beta}^_B}$:
- Standard error: $\text{SE}_{boot} = \text{sd}(\hat{\beta}^*)$
- Percentile CI: 2.5th and 97.5th percentiles
- Bias-corrected accelerated (BCa): Adjusts for both bias and skewness; generally preferred
Implementation sketch:
import numpy as np
def bootstrap_regression_coef(X, y, coef_index, B=5000):
n = X.shape[0]
beta_original = np.linalg.lstsq(X, y, rcond=None)[0][coef_index]
bootstrap_estimates = []
for _ in range(B):
indices = np.random.choice(n, size=n, replace=True)
X_boot, y_boot = X[indices], y[indices]
beta_boot = np.linalg.lstsq(X_boot, y_boot, rcond=None)[0][coef_index]
bootstrap_estimates.append(beta_boot)
bootstrap_estimates = np.array(bootstrap_estimates)
se_boot = np.std(bootstrap_estimates, ddof=1)
ci_boot = np.percentile(bootstrap_estimates, [2.5, 97.5])
bias_boot = np.mean(bootstrap_estimates) - beta_original
return {
'estimate': beta_original,
'se': se_boot,
'ci': ci_boot,
'bias': bias_boot
}
Resampling scheme selection:
The appropriate bootstrap method depends on your data structure:
- Pairs bootstrap (above): Resamples entire observations. Robust to heteroskedasticity; treats predictors as random.
- Residual bootstrap: Fixes $X$, resamples residuals $e^$, generates $y^ = X\hat{\beta} + e^*$. Assumes i.i.d. homoskedastic errors.
- Wild bootstrap: Uses $y^* = X\hat{\beta} + \hat{e}_i v_i$ where $v_i$ are Rademacher or similar. Handles heteroskedasticity with fixed design.
- Block bootstrap: Resamples contiguous blocks of observations. Critical for time series to preserve autocorrelation structure; naive i.i.d. resampling severely understates standard errors.
What the bootstrap expectation represents:
This is the key conceptual point. The bootstrap distribution is centered near your sample estimate $\hat{\beta}$, not the true population parameter $\beta$.
$$E^[\hat{\beta}^] \approx \frac{1}{B}\sum_{b=1}^B \hat{\beta}^*_b \approx \hat{\beta}$$
The bootstrap cannot generate information about $\beta$ that wasn't already in your sample. Instead, it leverages an analogy:
$$(\hat{\beta}^* - \hat{\beta}) \mid \text{data} ;;\text{mimics};; (\hat{\beta} - \beta)$$
The relationship between bootstrap resamples and your sample mirrors the relationship between your sample and the population.
Using the bootstrap distribution:
- Variance estimation: $\text{Var}^(\hat{\beta}^)$ estimates $\text{Var}(\hat{\beta})$. Under regularity conditions, the bootstrap is asymptotically consistent.
- Bias estimation: $\text{Bias}(\hat{\beta}) = E[\hat{\beta}] - \beta$ is estimated by $\bar{\beta}^* - \hat{\beta}$. For OLS under standard assumptions, this should be near zero. Only apply bias correction $\hat{\beta}_{corrected} = 2\hat{\beta} - \bar{\beta}^*$ when bias is substantial (e.g., $|\text{bias}| > 0.25 \cdot \text{SE}$), as correcting noise adds variance.
Limitations:
- Cannot fix systematic bias: The bootstrap faithfully reproduces whatever your estimator converges to. It doesn't correct for omitted variable bias, endogeneity, selection bias, or data leakage.
- Requires sufficient sample size: Needs enough data to make the empirical distribution a reasonable proxy for the true distribution.
- Fails for non-regular cases: Can break down for extreme quantiles, parameters at boundaries, or heavy-tailed distributions with infinite variance.
- Computational cost: Requires fitting the model $B$ times.
Connecting both parts:
A bootstrap p-value has resolution limited by $B$. It cannot confirm parametric claims of $p = 10^{-15}$, only bound it as $p < 1/(B+1)$. This reinforces the recommendation to report confidence intervals and effect sizes rather than chasing precise extreme p-values.