- Mastering Python for Data Science
- Samir Madhavan
- 232字
- 2021-07-16 20:14:19
A p-value
A p-value is the probability of rejecting a null-hypothesis when the hypothesis is proven true. The null hypothesis is a statement that says that there is no difference between two measures. If the hypothesis is that people who clock in 4 hours of study everyday score more that 90 marks out of 100. The null hypothesis here would be that there is no relation between the number of hours clocked in and the marks scored.
If the p-value is equal to or less than the significance level (α), then the null hypothesis is inconsistent and it needs to be rejected.

Let's understand this concept with an example where the null hypothesis is that it is common for students to score 68 marks in mathematics.
Let's define the significance level at 5%. If the p-value is less than 5%, then the null hypothesis is rejected and it is not common to score 68 marks in mathematics.
Let's get the z-score of 68 marks:
>>> zscore = ( 68 - classscore.mean() ) / classscore.std() >>> zscore 2.283
Now, let's get the value:
>>> prob = 1 - stats.norm.cdf(zscore) >>> prob 0.032835182628040638

So, you can see that the p-value is at 3.2%, which is lower than the significance level. This means that the null hypothesis can be rejected, and it can be said that it's not common to get 68 marks in mathematics.
- Google Flutter Mobile Development Quick Start Guide
- 精通Nginx(第2版)
- Apache Oozie Essentials
- Visual C++程序設計學習筆記
- 數據庫程序員面試筆試真題與解析
- Boost C++ Application Development Cookbook(Second Edition)
- Game Programming Using Qt Beginner's Guide
- Mastering Python Scripting for System Administrators
- x86匯編語言:從實模式到保護模式(第2版)
- Learning Apache Kafka(Second Edition)
- C語言程序設計
- Python Data Analysis Cookbook
- NetBeans IDE 8 Cookbook
- Python從入門到精通
- 基于GPU加速的計算機視覺編程:使用OpenCV和CUDA實時處理復雜圖像數據