A p-value measures how surprising a test result would be if a specified null hypothesis were true: it is the probability of a result at least as extreme as the observed one under that assumption. Compare it with a chosen significance level, often 5%. A smaller p-value supports rejecting the null; a larger one calls for failing to reject it, not declaring it true. The 5% cutoff is a convention, not a property of the data. section 4.2.3 section 12.5.1
Read the p-value alongside the question its test asks:
- In linear regression, the F-statistic’s p-value tests the model-wide null that every predictor coefficient is zero. Coefficient p-values address individual predictors; R² answers a different question about explained variation. section 4.2.3 section 4.3
- In logistic regression, the log-likelihood ratio (LLR) p-value tests the model as a whole. Individual predictor p-values can point to variables worth reconsidering, but multicollinearity and classification performance also matter. section 5.2.2 section 5.3
- In a chi-square goodness-of-fit test, the p-value helps assess whether observed category counts differ significantly from counts expected under a proposed distribution. section 12.5.1
Check leading digits against Benford’s law
For world-population leading digits, set the null hypothesis to conformity with a Benford distribution. Compute expected counts, then run `stats.chisquare(bf_populations.Counts, bf_populations.Expected_Counts)`. The result is a statistic of about 7.193 and a p-value of 0.516. Because 0.516 exceeds 0.05, fail to reject the null: these counts do not provide statistically significant evidence against that distribution. section 12.5.1
Separate model and predictor decisions
A `statsmodels` logistic regression predicts raisin variety from morphological measurements. Its model-wide LLR p-value is reported as 0, yet two individual predictors have p-values of 0.473 and 0.822. The model-wide result does not make every predictor significant. A reduced model drops insignificant predictors and considers multicollinearity before its fit and classification results are evaluated. section 5.2.2 section 5.2.3
>>> import scipy.stats as stats >>> x2 = stats.chisquare(bf_populations.Counts, >>> bf_populations.Expected_Counts) >>> print(x2) Power_divergenceResult(statistic=7.192526063677557, pvalue=0.5160103482305225)
The SciPy call shows the observed and expected counts passed to `stats.chisquare()` and the statistic and p-value returned together. section 12.5.1
Significance is only one part of evaluation. Check regression assumptions and fit measures, and assess a classifier’s prediction metrics before using its result to make a decision. section 4.3 section 5.3




