- Mastering Python for Data Science
- Samir Madhavan
- 227字
- 2021-07-16 20:14:19
One-tailed and two-tailed tests
The example in the previous section was an instance of a one-tailed test where the null hypothesis is rejected or accepted based on one direction of the normal distribution.
In a two-tailed test, both the tails of the null hypothesis are used to test the hypothesis.

In a two-tailed test, when a significance level of 5% is used, then it is distributed equally in the both directions, that is, 2.5% of it in one direction and 2.5% in the other direction.
Let's understand this with an example. The mean score of the mathematics exam at a national level is 60 marks and the standard deviation is 3 marks.
The mean marks of a class are 53. The null hypothesis is that the mean marks of the class are similar to the national average. Let's test this hypothesis by first getting the z-score 60:
>>> zscore = ( 53 - 60 ) / 3.0 >>> zscore -2.3333333333333335
The p-value would be:
>>> prob = stats.norm.cdf(zscore) >>> prob 0.0098153286286453336
So, the p-value is 0.98%. The null hypothesis is to be rejected, and the p-value should be less than 2.5% in either direction of the bell curve. Since the p-value is less than 2.5%, we can reject the null hypothesis and clearly state that the average marks of the class are significantly different from the national average.
- JavaScript百煉成仙
- SOA實(shí)踐
- The Android Game Developer's Handbook
- 算法精粹:經(jīng)典計(jì)算機(jī)科學(xué)問(wèn)題的Java實(shí)現(xiàn)
- Rake Task Management Essentials
- 動(dòng)手玩轉(zhuǎn)Scratch3.0編程:人工智能科創(chuàng)教育指南
- JavaScript從入門到精通(第3版)
- 精通MATLAB(第3版)
- Express Web Application Development
- Yii Project Blueprints
- Android玩家必備
- Java網(wǎng)絡(luò)編程實(shí)戰(zhàn)
- Extreme C
- Java語(yǔ)言程序設(shè)計(jì)教程
- Learning Grunt