あなたは自分のモデルの適合の結果を見てみたいような音。 1つの予測因子と相続人の例が、簡単に14に拡張:
インポートstatsmodels、あなたは(あなたがあなたの14個の予測を含めたい場所です)を構築したいモデルを指定:
import statsmodels.api as sm
#read in your data however you want and assign your y, x1...x14 variables
model = sm.OLS(x, y)
がモデルをフィット:
results = model.fit()
今だけお使いのモデルの適合の概要を表示:
print(results.summary())
のThあなたの調整R squared値、Fテスト値、ベータウェイトなどを与えるでしょう:
OLS Regression Results
==============================================================================
Dep. Variable: x R-squared: 0.601
Model: OLS Adj. R-squared: 0.594
Method: Least Squares F-statistic: 87.38
Date: Wed, 24 Aug 2016 Prob (F-statistic): 3.56e-13
Time: 19:51:25 Log-Likelihood: -301.81
No. Observations: 59 AIC: 605.6
Df Residuals: 58 BIC: 607.7
Df Model: 1
Covariance Type: nonrobust
==============================================================================
coef std err t P>|t| [95.0% Conf. Int.]
------------------------------------------------------------------------------
y 0.8095 0.087 9.348 0.000 0.636 0.983
==============================================================================
Omnibus: 0.119 Durbin-Watson: 1.607
Prob(Omnibus): 0.942 Jarque-Bera (JB): 0.178
Skew: -0.099 Prob(JB): 0.915
Kurtosis: 2.818 Cond. No. 1.00
==============================================================================