Using plot_lm_summary

Get Data

In [12]:
import statsmodels.api as sm
import statsmodels.formula.api as smf
from linearmodelplot import plot_lm_summary

import warnings
warnings.simplefilter('ignore',FutureWarning)
In [8]:
iris = sm.datasets.get_rdataset('iris').data
In [9]:
iris.columns = ['Sepal_Length','Sepal_Width','Petal_Length','Petal_Width','Species']
In [10]:
lm = smf.ols("Sepal_Width ~ Sepal_Length + Petal_Length", data=iris).fit()
In [11]:
plot_lm_summary(lm);
In [6]:
lm.summary()
Out[6]:
OLS Regression Results
Dep. Variable: Sepal_Width R-squared: 0.456
Model: OLS Adj. R-squared: 0.449
Method: Least Squares F-statistic: 61.71
Date: Mon, 08 Oct 2018 Prob (F-statistic): 3.48e-20
Time: 15:36:27 Log-Likelihood: -42.058
No. Observations: 150 AIC: 90.12
Df Residuals: 147 BIC: 99.15
Df Model: 2
Covariance Type: nonrobust
coef std err t P>|t| [0.025 0.975]
Intercept 1.0381 0.288 3.602 0.000 0.469 1.608
Sepal_Length 0.5612 0.065 8.590 0.000 0.432 0.690
Petal_Length -0.3353 0.031 -10.940 0.000 -0.396 -0.275
Omnibus: 0.483 Durbin-Watson: 1.730
Prob(Omnibus): 0.785 Jarque-Bera (JB): 0.269
Skew: -0.095 Prob(JB): 0.874
Kurtosis: 3.085 Cond. No. 80.7


Warnings:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.