How to perform two-sample one-tailed t-test with numpy/scipy

前端 未结 5 1015
[愿得一人]
[愿得一人] 2020-12-07 20:35

In R, it is possible to perform two-sample one-tailed t-test simply by using

> A = c(0.19826790, 1.36836629, 1.37950911, 1.46951540, 1.481977         


        
5条回答
  •  爱一瞬间的悲伤
    2020-12-07 21:04

    Did you look at this: How to calculate the statistics "t-test" with numpy

    I think that is exactly what this questions is looking at.

    Basically:

    import scipy.stats
    x = [1,2,3,4]
    scipy.stats.ttest_1samp(x, 0)
    
    Ttest_1sampResult(statistic=3.872983346207417, pvalue=0.030466291662170977)
    

    is the same result as this example in R. https://stats.stackexchange.com/questions/51242/statistical-difference-from-zero

提交回复
热议问题