- 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.
- UI圖標(biāo)創(chuàng)意設(shè)計(jì)
- 自己動(dòng)手實(shí)現(xiàn)Lua:虛擬機(jī)、編譯器和標(biāo)準(zhǔn)庫(kù)
- Java開發(fā)入行真功夫
- Amazon S3 Cookbook
- TypeScript項(xiàng)目開發(fā)實(shí)戰(zhàn)
- Mastering Apache Spark 2.x(Second Edition)
- 批調(diào)度與網(wǎng)絡(luò)問(wèn)題的組合算法
- Mastering Apache Camel
- 小學(xué)生C++趣味編程從入門到精通
- MySQL數(shù)據(jù)庫(kù)應(yīng)用技術(shù)及實(shí)戰(zhàn)
- Building Microservices with .NET Core 2.0(Second Edition)
- Mastering Linux Kernel Development
- Go語(yǔ)言從入門到進(jìn)階實(shí)戰(zhàn)(視頻教學(xué)版)
- Python從入門到項(xiàng)目實(shí)踐(超值版)
- Procedural Content Generation for Unity Game Development