You are here

P-Value Calculator

Here we have defined the p-value calculator to help you out to measure one side as well as two-sided p-values from the following distributions, normal distribution (z-Stat), t-student, chi-squared, and F stat.

P-values are commonly used in science but some people find this concept intimidating. In this article, we are going to make this concept easy for everyone. We are not only going to define p-values but also teach you how to interpret the results quickly. Further, we have created the p-value calculator to make calculations easy for you.

What is the p-value?

If the H0 (null hypothesis) of a study question is valid, the P-value is the probability of finding the observed, or more extreme, results. The term ‘extreme’ and its concept depend on how the null hypothesis is being evaluated. When the P value is true, it is also defined in terms of rejecting H0, but not a direct likelihood of this state.

What “extreme” actually means determines by the alternative hypothesis, it means the p-value will rely on the alternative hypothesis, which we stated as two-tailed, right-tailed, or left-tailed. In the below-mentioned formulae S represents test statistic (Z-Stat, t-Stat, Chi-Squared Stat, F-Stat), x represents the outcome value of test statistic, Pr (H0) represents the probability of occurrence of an event, by assuming true H0.

In two-tailed test, the p-value can be calculated by this equation

p-value = 2 * Pr(S ≤ -|x| | H0)

In right-tailed test, the p-value can be calculated by this equation

 p-value = Pr(S ≥ x | H0)

In left-tailed test, the p-value can be calculated by this equation

 p-value = Pr(S ≤ x | H0)

Let us explain these meanings since a picture is worth a thousand words. Here we use the fact that the likelihood for a given distribution can be conveniently expressed as the region under the density curve. Two different pictures are hereunder:

  1. For symmetric distribution (Normal)
  2. For skewed distribution (not symmetric)

Figure 1: Symmetric Case (normal distribution)

P value

Figure 2: Skewed Distribution (not symmetric)

P value

In figure 2, the area left or not covered by left-tailed skewed distribution the p-value is equal to the area covered by the right-tailed p-value.

Calculation of p-value from test statistic: How to

If you want to calculate the p-value from any test statistic, it must be known to you which distribution is followed by the test statistic keeping the assumption that H0 is true. Then by using CDF (cumulative distribution function) of that distribution we can find the p-value of the test statistic.

In two-tailed test the p-value can be found by this equation

 p-value = 2 * min{cdf(x) , 1 – cdf(x)}

In right-tailed test the p-value can be found by this equation

 p-value = 1 – cdf(x)

In left-tailed test the p-value can be found by this equation

 p-value = cdf(x)

It is not possible to find the p-value manually because the CDF formulae of probability distributions, commonly used to test the hypothesis, are complicated. So, we need a computer or statistical table to find out the p-value of our test statistic.

Well, now you know how p-value can be measured, however… Why in the first place, do you need to quantify this number? We have two approaches to measure the stat statistic in hypothesis testing; one is the critical value approach while the other is the p-value approach. Both are alternatives to each other. Keep in mind that in later one, researchers pre-set α (level of significance) which shows the probability for rejection of H0 when it is true referred to as type 1 error.  

Without having the p-value we are unable to decide either to reject the H0 or not. But when you have it you just need to compare it with each given α. For understanding must read the below section “how to interpret p-value.”

Interpretation of p-value: How to

By using p-value, you will have two choices:

  1. A small p-value (provide proof against the rejection of the null hypothesis), tells us that data is not compatible with the null hypothesis. 
  2. A high p-value (provide proof in favor of null hypothesis), tells us means that that data is compatible with the null hypothesis. 

Your sample may lead to making a wrong decision concerning the null hypothesis because of its unusualness. For example, you have studied the effect of the COVID-19 vaccine and get the p-value as 0.07. It means random chance is still able to produce the test statistic, we received, or a value much more extreme, in 7 percent of related trials, even though the drug did not affect at all. 

The shortest and best possible answer to the query “what is p-value” is answered as “the smallest level of significance at which the null hypothesis would be rejected.” If you want to take a decision against H0, you have to compare the p-value with α.

  1. If p-value ≥ α, then you have to accept the H0 which means you have lack of evidence to reject the H0.
  2. If p-value ≤ α, then you reject the H0 and accept the H1.

Keep in mind that you have some expertise in the subject area and are well known to the reasons why you are going to apply any statistical technique. Otherwise, you will easily land with a statistically significant but wrong decision

Significance of P-value

The p-value is defined in the bracket of 0 and 1. The smaller p-value provides strong evidence to reject the null hypothesis while the higher p-value provides the base to accept the alternative hypothesis.   

  1. A p-value less than 0.05 or 5 % (commonly ≤ 0.05) is considered enough for statistical significance. It provides strong evidence to reject the null hypothesis as there are less than 5 % chances that the alternative hypothesis is correct. So when it is less than 0.05 we reject the null hypothesis and accept the alternative hypothesis. However, in this case, 95% probability is in favor of acceptance of alternative hypothesis but keep in mind it does not decide whether the research is true or false but it has an only concern with the hypothesis which you are testing. 
  2. A p-value less than 0.05 or 5 % (commonly > 0.05) considered as not enough for statistical significance. It provides strong evidence to accept the null hypothesis as there are more than 5 % chances that the null hypothesis is correct. So when it is greater than 0.05 we reject the alternative hypothesis and accept the null hypothesis.

P-value calculator: How to use

You need not worry about how to estimate the p-value from any test statistics, our calculator is made to give you a p-value against any test statistic and to avoid any complicated calculations. Follow the following steps to get the desired results.

  1. Select the right-tailed, left-tailed, or two-tailed option from the “what do you want” tab. It is dependent on your alternative hypothesis.
  2. Select the test statistic distribution (normal distribution, t-Student, chi-squared, or F-stat) from the “what do you have” tab. If you are not sure about the distribution of test statistics read the remaining part of this article as we explained it. 
  3. Select the degree of freedom in case of other distributions except for normal distribution.
  4. Put the already calculated test statistic from your data.
  5. By default we set the calculator at a 0.05 level of significance you can change it as per your requirements.
  6. Our calculator gives you results against your information inserted into it. 
  7. If you want to increase the precision use the advanced mode of the p-value calculator. 

In the below sections we are going to solve this problem and briefly explain how to find the p-value from z-score, p-value from t-score, p-value from the chi-squared score, and p-value from f-score.

P-Value Calculator

p-value Calculator

P-value calculation from Z-score

If your test score follows the N (0,1), standard normal distribution, you should have to select the z-score option. If your sample size is more than 50 consider that your data is following a normal distribution. 

P value calculation
Density Curve for Standard Normal Random Variable

You can find the p-value from Z-score by using CDF (cumulative distribution function) which is commonly denoted by Φ by undernoted formulae.

P value zero score

P-value calculation from t-score

T-score option can choose if the test statistic follows the t-student distribution. The t-student distribution has almost the same shape as the normal distribution but it has heavier tails that are dependent upon the degree of freedom. It is practically indifferent between a normal distribution and t-student distribution when the sample size increased from 30.

P-value from t-score can be found by using the under mentioned formulae where represents the cumulative distribution function for t-student distribution and d represents the degree of freedom.

Density of desturbtion

The t-score is mostly used to test paired samples (before-after scenario), the difference between two population means, and for population means (in both cases of unknown and known population standard deviation). 

P-value Calculation from Chi-square Score

When test statistic follows the χ²-distribution then chooses χ²-score option in the calculator. When the sum of the square of variables follows the normal distribution then this distribution arises. Do not forget to insert the degree of freedom of χ²-distribution.

density of chi-square
Density of χ2– Distribution

You can find the p-value from the chi-square score by using undernoted formulae wherein the   represents the CDF of χ²-distribution and d denotes the degree of freedom.

Density of x^2 Desturbtion

The χ²-score used in the popular tests of goodness of fit (right-tailed test) having the degree of freedom k-1, the variance of data following normal distribution (one or two-tailed test) having a degree of freedom n-1, and independence test. (Right tailed test) having a degree of freedom (r-1) (c-1).

P-value calculation from F-score

When the test statistic follows F-distribution then you should F-score option of our calculator. The shape of F-distribution is dependent upon two degrees of freedom.

density of f-distribution
Density of F-Distribution

The degree of freedom of F-distribution is a ratio of two degrees of freedom as f-score is the ratio of two independent variables following chi-square distribution with two degrees of freedom (one for each) termed as d1, d2.

We can measure the p-value from F-score by using the under mentioned formulae where represent the cumulative distribution function of F-distribution and (d1, d2) represents the degree of freedom.

To tailed Failed value

The f-score used in the popular tests of overall significance of regression analysis and ANOVA with (k-1, n-k) degree of freedom, equality of variances in two N(0,1) populations with ( ) degree of freedom and comparison of two nested regression models with  degrees of freedom. It is worth noted that all of these tests are right-tailed.

The f-score used in the popular tests of the overall significance of regression analysis and ANOVA with degree of freedom, equality of variances in two N(0,1) populations with ( ) degree of freedom and comparison of two nested regression models with degrees of freedom. It is worth noted that all of these tests are right-tailed.

Top