Skip to content
Home » Blog » Understanding p-values in statistics for beginners

Understanding p-values in statistics for beginners

For those who have already studied statistics, p-values will be very much familiar. When I first learned about machine learning, I didn’t understand what a p-value was. I was only told that if the value was less than 0.05, then the machine learning was considered valid. I didn’t know the reason why that was the case. On this opportunity, I will discuss what a p-value is, how to use it, and provide some examples.

Disclaimer: Since this article is targeted at readers who are learning basic statistics, I will use the terms “reject” and “accept” the hypothesis to make it easier to understand. However, technically, statistics never actually prove a hypothesis to be true. Statistics only provide a basis for rejecting or failing to reject a hypothesis based on evidence from the data analyzed.

What is a p-value?

Probability value, commonly known as p-value, is a number that describes the probability of obtaining the observed data under the null hypothesis in a statistical test. Or, to put it more simplistically, p-value is a number that measures how strong our data is against the null hypothesis (H₀).

What is the null hypothesis (H₀)

A statistical test always begins with a null hypothesis. The null hypothesis states that there is no relationship between the variables you are studying. In other words, the initial hypothesis is an initial assumption that we make, stating that “there is no effect,” “there is no difference,” or “there is no relationship between the variables.”

An example of creating a null hypothesis is as follows. Suppose we are testing a fever-reducing drug on 100 people who have a high fever. Then, the null hypothesis we create is as follows:

  • Null hypothesis (H0) = the new drug does not reduce fever
  • Alternative hypothesis (H1) = the new drug is proven to reduce fever

So, the point is that in the initial stage, statisticians are skeptical about what is being researched. For example, there is a question, “Why be skeptical first? Don’t we already assume that the research will surely have an effect? Because if we already know that there is no connection, then there is no point in researching it, right?”

Basically, it is easier to disproving than proving. When disproving, there are only two possible answers: yes or no. But when proving, there are many possible answers. Statistics work with this concept; they work to disprove or support the initial hypothesis.

How to calculate the p-value

Basically, you can use applications such as (SPSS, Python, and R).

You can also use a table to find the p-value, which you can find online, or you can use a p-value calculator. Once you have found the p-value you are looking for, you can more easily reject or accept the initial hypothesis you have made.

Mathematically, the p-value is obtained by calculating the area under the probability distribution curve using the concept of integrals in calculus. The area calculated is all possible statistical values that are as extreme or more extreme than the observed value, relative to the total area of the curve. In this process, standard deviation plays an important role because it shows how far the data spreads from the mean, which affects the shape and width of the distribution.

P-value and inferential statistics

Inferential statistics is a method of analyzing data from a population using a sample. The final result of inferential statistics is a conclusion that describes the general condition of a population. P-values play an important role in inferential statistics, as they determine whether a hypothesis can be accepted or rejected.

Basically, each study has its own parameters for determining what p-value is appropriate to use as a reference.

Basically, the smaller the p-value, the better, but in general, the value used for research is x ≤ 0.005. There are some fields of research that use a threshold value of up to 0.001.

Also read: Deep work: how to focus in a world full of distractions