I'm using statsmodels.api to inspect the statistical parameters from different combinations of variables. You can use print(results.summary())
to get
OLS Regression Results
==============================================================================
Dep. Variable: y R-squared: 0.454
Model: OLS Adj. R-squared: 0.454
Method: Least Squares F-statistic: 9694.
Date: Mon, 30 Jul 2018 Prob (F-statistic): 0.00
Time: 10:14:47 Log-Likelihood: -9844.7
No. Observations: 11663 AIC: 1.969e+04
Df Residuals: 11662 BIC: 1.970e+04
Df Model: 1
Covariance Type: nonrobust
==============================================================================
coef std err t P>|t| [0.025 0.975]
------------------------------------------------------------------------------
x1 -1.4477 0.015 -98.460 0.000 -1.477 -1.419
==============================================================================
Omnibus: 1469.705 Durbin-Watson: 1.053
Prob(Omnibus): 0.000 Jarque-Bera (JB): 2504.774
Skew: 0.855 Prob(JB): 0.00
Kurtosis: 4.493 Cond. No. 1.00
==============================================================================
but say I was just interested in a couple of these parameters, say, No. observations
and R-squared
. How can I print just certain parameters such as these? Using print(results)
just gives a pointer to the results
object:
print(results)
<statsmodels.regression.linear_model.RegressionResultsWrapper object at 0x0000020DAB8028D0>