回帰を実行するだけでなく、各回帰係数の有意性基準 (std / mean) を計算し、それらを (Nk) 度の適切な p 値と比較する線形回帰パッケージを紹介してもらえますか?自由の」?または、少なくともそのような計算に使用できる出力を提供しますか?
理想的には Python 用ですが、R も使用します
ありがとうございました!
回帰を実行するだけでなく、各回帰係数の有意性基準 (std / mean) を計算し、それらを (Nk) 度の適切な p 値と比較する線形回帰パッケージを紹介してもらえますか?自由の」?または、少なくともそのような計算に使用できる出力を提供しますか?
理想的には Python 用ですが、R も使用します
ありがとうございました!
R では、lm()
線形モデルに適合しsummary()
、係数推定値、標準誤差、t 統計量、および p 値を含む完全な出力を提供します。https://stat.ethz.ch/R-manual/R-patched/library/stats/html/lm.html
statsmodels は、線形回帰およびその他の推定モデルのすべての標準推論を提供します。
以下の出力は、このノートブック http://statsmodels.sourceforge.net/stable/examples/notebooks/generated/formulas.htmlからコピーされたものです
いくつかの説明を含むブログ:
http://www.datarobot.com/blog/multiple-regression-using-statsmodels/
mod = ols(formula='Lottery ~ Literacy + Wealth + Region', data=df)
res = mod.fit()
print(res.summary())
OLS Regression Results
==============================================================================
Dep. Variable: Lottery R-squared: 0.338
Model: OLS Adj. R-squared: 0.287
Method: Least Squares F-statistic: 6.636
Date: Tue, 02 Dec 2014 Prob (F-statistic): 1.07e-05
Time: 12:52:16 Log-Likelihood: -375.30
No. Observations: 85 AIC: 764.6
Df Residuals: 78 BIC: 781.7
Df Model: 6
Covariance Type: nonrobust
===============================================================================
coef std err t P>|t| [95.0% Conf. Int.]
-------------------------------------------------------------------------------
Intercept 38.6517 9.456 4.087 0.000 19.826 57.478
Region[T.E] -15.4278 9.727 -1.586 0.117 -34.793 3.938
Region[T.N] -10.0170 9.260 -1.082 0.283 -28.453 8.419
Region[T.S] -4.5483 7.279 -0.625 0.534 -19.039 9.943
Region[T.W] -10.0913 7.196 -1.402 0.165 -24.418 4.235
Literacy -0.1858 0.210 -0.886 0.378 -0.603 0.232
Wealth 0.4515 0.103 4.390 0.000 0.247 0.656
==============================================================================
Omnibus: 3.049 Durbin-Watson: 1.785
Prob(Omnibus): 0.218 Jarque-Bera (JB): 2.694
Skew: -0.340 Prob(JB): 0.260
Kurtosis: 2.454 Cond. No. 371.
==============================================================================
Warnings:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.