获得p值并调整R sq(python)

时间:2018-03-23 06:23:57

标签: python linear-regression statsmodels

来自以下线性回归模型:

model = sm.OLS(Y, X).fit()

model.summary()
Out[18]: 
<class 'statsmodels.iolib.summary.Summary'>
"""
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                    RUL   R-squared:                       0.905
Model:                            OLS   Adj. R-squared:                  0.905
Method:                 Least Squares   F-statistic:                 1.022e+04
Date:                Fri, 23 Mar 2018   Prob (F-statistic):               0.00
Time:                        11:47:53   Log-Likelihood:                -93208.
No. Observations:               18202   AIC:                         1.865e+05
Df Residuals:                   18185   BIC:                         1.866e+05
Df Model:                          17                                         
Covariance Type:            nonrobust                                         
==============================================================================
                 coef    std err          t      P>|t|      [0.025      0.975]
------------------------------------------------------------------------------
Time          -0.4470      0.006    -71.190      0.000      -0.459      -0.435
op1         -103.2604    137.952     -0.749      0.454    -373.660     167.139
op2         2784.5138   1027.826      2.709      0.007     769.878    4799.150
s11          -25.3125      2.719     -9.309      0.000     -30.642     -19.983
s12            5.4932      0.919      5.975      0.000       3.691       7.295
s13            2.1081      7.112      0.296      0.767     -11.832      16.048
s14           -0.1587      0.065     -2.458      0.014      -0.285      -0.032
s15          -75.7922     14.461     -5.241      0.000    -104.137     -47.447
s17           -0.9392      0.309     -3.036      0.002      -1.545      -0.333
s20            9.3803      2.895      3.240      0.001       3.706      15.054
s21           26.3017      4.863      5.409      0.000      16.770      35.834
==============================================================================
Omnibus:                     2563.379   Durbin-Watson:                   0.043
Prob(Omnibus):                  0.000   Jarque-Bera (JB):             4099.496
Skew:                           0.977   Prob(JB):                         0.00
Kurtosis:                       4.259   Cond. No.                     4.40e+07

有人可以告诉我如何获得调整后的r square,以及那些p值> 0.05的变量吗?

1 个答案:

答案 0 :(得分:1)

RegressionResults.rsquared() herepvalues here