初学者です。
statsmodels.sandbox.regression.gmm.IV2SLS(ソース)のfitモジュールを用いデータを分析したのですが、サマリの可視化の仕方がわかりません。
import pandas as pd data = pd.read_csv("filename.csv") result = ssrg.IV2SLS(endog = data["y"], exog = data["c"], instrument = data[["iv1","iv2"]]).fit() print(result)
とすると、
>>> <statsmodels.regression.linear_model.RegressionResultsWrapper at 0x2668f448208>
としか表示されません。
ここから、
※別の例から引用 OLS Regression Results ============================================================================== Dep. Variable: Lottery R-squared: 0.348 Model: OLS Adj. R-squared: 0.333 Method: Least Squares F-statistic: 22.20 Date: Mon, 14 May 2018 Prob (F-statistic): 1.90e-08 Time: 21:48:09 Log-Likelihood: -379.82 No. Observations: 86 AIC: 765.6 Df Residuals: 83 BIC: 773.0 Df Model: 2 Covariance Type: nonrobust =================================================================================== coef std err t P>|t| [0.025 0.975] ----------------------------------------------------------------------------------- Intercept 246.4341 35.233 6.995 0.000 176.358 316.510 Literacy -0.4889 0.128 -3.832 0.000 -0.743 -0.235 np.log(Pop1831) -31.3114 5.977 -5.239 0.000 -43.199 -19.424 ============================================================================== Omnibus: 3.713 Durbin-Watson: 2.019 Prob(Omnibus): 0.156 Jarque-Bera (JB): 3.394 Skew: -0.487 Prob(JB): 0.183 Kurtosis: 3.003 Cond. No. 702. ==============================================================================
のようなよくある結果をプリントしたいのですが、どうしたらよいでしょうか。
なお
results.summary()
としても
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-121-c942b82acb49> in <module>() ----> 1 result.summary() ~\Anaconda3\lib\site-packages\statsmodels\sandbox\regression\gmm.py in summary(self, yname, xname, title, alpha) 325 top_right = [('R-squared:', ["%#8.3f" % self.rsquared]), 326 ('Adj. R-squared:', ["%#8.3f" % self.rsquared_adj]), --> 327 ('F-statistic:', ["%#8.4g" % self.fvalue] ), 328 ('Prob (F-statistic):', ["%#6.3g" % self.f_pvalue]), 329 #('Log-Likelihood:', None), #["%#6.4g" % self.llf]), ~\Anaconda3\lib\site-packages\statsmodels\tools\decorators.py in __get__(self, obj, type) 95 if _cachedval is None: 96 # Call the "fget" function ---> 97 _cachedval = self.fget(obj) 98 # Set the attribute in obj 99 # print("Setting %s in cache to %s" % (name, _cachedval)) ~\Anaconda3\lib\site-packages\statsmodels\sandbox\regression\gmm.py in fvalue(self) 217 restriction = np.eye(k_vars) 218 idx_noconstant = lrange(k_vars) --> 219 del idx_noconstant[self.model.data.const_idx] 220 fval = self.f_test(restriction[idx_noconstant]).fvalue # without constant 221 return fval TypeError: list indices must be integers or slices, not NoneType
となってしまいます。ソースを読んでもいまいちよくわかりません。
教えて下さると幸いです。

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/07/05 01:22
2018/07/05 08:32