How do I do a F-test in python

后端 未结 4 1489
借酒劲吻你
借酒劲吻你 2020-12-23 17:17

How do I do an F-test to check if the variance is equivalent in two vectors in Python?

For example if I have

a = [1,2,1,2,1,2,1,2,1,2]
b = [1,3,-1,2         


        
4条回答
  •  生来不讨喜
    2020-12-23 17:35

    To do a one way anova you can use

    import scipy.stats as stats
    
    stats.f_oneway(a,b)
    

    One way Anova checks if the variance between the groups is greater then the variance within groups, and computes the probability of observing this variance ratio using F-distribution. A good tutorial can be found here:

    https://www.khanacademy.org/math/probability/statistics-inferential/anova/v/anova-1-calculating-sst-total-sum-of-squares

提交回复
热议问题