Search code examples
pythonscipystatisticsdata-sciencedata-analysis

How to set significance level for scipy.stats test


I'm using scipy.stats.ttest_ind and scipy.stats.wilcoxon to perform t test and the Wilcoxon test, but I have no idea how can I set the significant level for them. In the official documents, nothing about it is mentioned and it seems like no arguments of these two methods are about it. Does anyone know how to set it?

The official documents:

https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.ttest_ind.html https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.ttest_ind.html


Solution

  • The tests also report the p-value to the user. This p-value can be used to test a hypothesis at the significance level of your choice. We reject the null hypothesis if the p-value is less than the significance level. For example, with a p-value of 0.073 we reject at the significance level of 10% but do not reject at a significance level of 5%.