Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
After fitting a regression in Python, five statsmodels methods can help you investigate what its results mean: summary(), conf_int(), get_robustcov_results(), get_influence(), and compare_lr_test(). They answer different questions about the model’s output, parameter uncertainty, inference, influential observations, and nested-model fit. Here, “why” means diagnostic and inferential clues—not proof of causation.
How to choose the right statsmodels function
Statsmodels’ basic workflow is to specify a model, fit it, and inspect the resulting fitted-results object. These methods extend that inspection, but they are not interchangeable: choose one based on the question you need to answer.
| # | Preview | Product | Price | |
|---|---|---|---|---|
| 1 |
|
Discovering Statistics Using IBM SPSS Statistics | $85.98 | Buy on Amazon |
| 2 |
|
Beginning Statistics 3e Textbook | $129.00 | Buy on Amazon |
| 3 |
|
Second Course in Statistics, A: Regression Analysis | $205.43 | Buy on Amazon |
| 4 |
|
Applied Linear Regression (Wiley Series in Probability and Statistics) | $92.56 | Buy on Amazon |
| 5 |
|
The Art of Statistics: How to Learn from Data | $13.50 | Buy on Amazon |
| Method | Question answered | What it cannot establish by itself |
|---|---|---|
summary() |
What does the fitted model report at a glance? | That the model’s assumptions hold or that the specification is complete. |
conf_int() |
How uncertain are the fitted parameter estimates? | That the model is correctly specified or supports a causal interpretation. |
get_robustcov_results() |
How does inference change under a different covariance estimate? | That omitted variables, functional-form errors, or confounding have been fixed. |
get_influence() |
Can particular observations materially affect the fit? | That a flagged observation is an error or should automatically be removed. |
compare_lr_test() |
Does a less-restricted nested model improve fit enough to reject the restricted one? | That the improvement is practically important or causal. |
1. Use summary() for the overview
For many fitted results objects, summary() gathers model information and statistical output into a report. The getting-started guide demonstrates printing it with print(res.summary()). Use the summary to orient yourself: review the estimates, reported uncertainty, fit information, and other details shown for that model. It is a starting point, not a complete diagnostic report.
The summary API documents an alpha argument for the confidence-interval significance level and a slim option that can reduce diagnostic information. Available details may depend on the results class and statsmodels version. The current getting-started guide corroborates the summary workflow; detailed parameter notes for this method are labeled statsmodels 0.14.6, while the stable documentation identifies version 0.15.0.
#1 Best Overall
2. Use conf_int() to inspect parameter uncertainty
Call conf_int() on fitted results to obtain confidence intervals for the parameter estimates. Read each interval alongside its estimate: the interval describes uncertainty under the fitted model and its inferential assumptions, rather than offering a guarantee about the estimate in every possible model.
A narrow interval does not validate the model specification, rule out omitted-variable bias, or establish causation. Use it to understand precision conditional on the model you actually fitted.
Rank #2
3. Use get_robustcov_results() to examine covariance-sensitive inference
get_robustcov_results() creates a new results instance with a robust covariance estimate as its default. The choice of covariance type matters: select one that is intended to address a feature of your data or error structure, and report that choice when presenting estimates and inference.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Because this changes the estimated covariance—and therefore uncertainty measures such as standard errors—it can change inferential conclusions without changing the underlying fitted specification. Robust covariance does not repair omitted variables, an incorrect functional form, or confounding, and it does not make a causal interpretation valid.
Rank #3
4. Use get_influence() to investigate influential observations
For OLS results, get_influence() returns an OLSInfluence object with measures used to assess observation influence and outlier behavior. Statsmodels’ diagnostics example illustrates studentized residuals, leverage, and Cook’s-distance-based influence plots. Together, these can help you find cases worth examining; they do not identify errors automatically.
Review a flagged case in context, check whether its data are valid, and consider sensitivity analysis—such as comparing results with and without the observation when that comparison is substantively justified. Do not delete observations solely because a diagnostic measure flags them.
5. Use compare_lr_test() for an appropriate nested-model comparison
compare_lr_test() performs a likelihood-ratio test framed as whether a restricted model is correct relative to a less-restricted model. The comparison requires appropriately nested models: the restricted model must be a restriction of the less-restricted one. Report the test statistic, degrees of freedom, and p-value so readers can assess the comparison.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →A test result addresses the specified fit comparison; it is not an effect-size estimate, a measure of practical importance, or evidence of causation on its own.
Best Value
Use diagnostics to investigate assumptions, not certify a model
Beyond these five results methods, statsmodels’ regression diagnostics example covers tests for residual normality (Omni and Jarque–Bera), autocorrelation (Durbin–Watson and Breusch–Godfrey), heteroskedasticity (Breusch–Pagan and Goldfeld–Quandt), and linearity (Harvey–Collier), as well as influence measures. Many tests return tuples without annotations; consult the relevant method documentation or docstrings to interpret the returned values.
The diagnostics notebook also demonstrates residual-versus-fitted, normal-quantile, scale-location, leverage, and VIF views. Patterns can suggest possible nonlinearity, nonnormal residuals, nonconstant variance, leverage, or influential observations. Treat a test or plot as evidence about a particular assumption and a reason to investigate further—not as a universal pass/fail verdict on model quality.
Quick Recap
Which function should you run next?
- Need a compact account of the fitted results? Start with
summary(). - Need to express uncertainty around individual parameter estimates? Inspect
conf_int(). - Concerned that the covariance estimate may not suit the data’s error structure? Choose an appropriate robust covariance type with
get_robustcov_results(). - Wondering whether certain cases drive the fit? Examine the measures from
get_influence()and investigate flagged observations. - Comparing a restricted model with an appropriate less-restricted nested model? Use
compare_lr_test()and report the test statistic, degrees of freedom, and p-value.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Recommended Free Tools

