[英]How to extract the F statistic and the P value from results.f_test in statsmodels python
我運行OLS.fit()並使用擬合的模型來獲取特定類別的f值,例如在ANCOVA中。
res = OLS.fit()
R = [[0,1,0], [0,0,1]]
res.f_test(R)
結果的形式為
<F test: F=array([[ 2.21065884]]), p=[[ 0.10971892]], df_denom=5918, df_num=2>
如何從這種格式中獲取F數組和p值? 甚至有可能嗎?
分配結果以存儲它,然后檢查屬性。
fres = res.f_test(R)
dir(fres)
fres.fvalue
fres.pvalue
或類似,因為我正在使用statsmodels master
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.