python的哪个统计模块支持事后测试(Tukey,Scheffe或其他)的一种方差分析? [英] What statistics module for python supports one way ANOVA with post hoc tests (Tukey, Scheffe or other)?

查看:88
本文介绍了python的哪个统计模块支持事后测试(Tukey,Scheffe或其他)的一种方差分析?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试遍历Python的多个统计模块,但似乎找不到任何支持one-way ANOVA事后测试的模块.

I have tried looking through multiple statistics modules for Python but can't seem to find any that support one-way ANOVA post hoc tests.

推荐答案

使用方差分析的一种方法

one way ANOVA can be used like

from scipy import stats
f_value, p_value = stats.f_oneway(data1, data2, data3, data4, ...)

这是ANOVA的一种方法,它返回F值和P值.
如果P值低于您的设置,则有显着差异.

This is one way ANOVA and it returns F value and P value.
There is significant difference If the P value is below your setting.


Tukey-kramer HSD测试可以像


The Tukey-kramer HSD test can be used like

from statsmodels.stats.multicomp import pairwise_tukeyhsd
print pairwise_tukeyhsd(Data, Group)

这是多重比较. 输出就像

This is multicomparison. The output is like

Multiple Comparison of Means - Tukey HSD,FWER=0.05
================================================
group1 group2 meandiff   lower    upper   reject
------------------------------------------------
  0      1    -35.2153 -114.8741 44.4434  False 
  0      2     46.697   -40.4993 133.8932 False 
  0      3    -7.5709    -87.49  72.3482  False 
  1      2    81.9123    5.0289  158.7956  True 
  1      3    27.6444   -40.8751  96.164  False 
  2      3    -54.2679 -131.4209 22.8852  False 
------------------------------------------------

请参阅 网站上如何设置参数.
statsmodels的tukeyhsd不返回P值.
因此,如果您想知道P值,请根据这些输出值进行计算或使用R.

Please refer to this site how to set the arguments.
The tukeyhsd of statsmodels doesn't return P value.
So, if you want to know P value, calculate from these outputted value or use R.

这篇关于python的哪个统计模块支持事后测试(Tukey,Scheffe或其他)的一种方差分析?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆