**What is p-value?**

The p-value is a measure used in statistics to help determine **the strength of the evidence** against a null hypothesis.

**Null Hypothesis**: The initial assumption made for statistical testing, usually stating “no effect” or “no difference.”

Essentially, it indicates the probability of observing the given data, or something more extreme, if the null hypothesis is true.

A smaller p-value indicates that the observed data is less likely to have occurred by random chance alone, given that the null hypothesis is true.

In other words, **a small p-value suggests that the evidence is inconsistent with the null hypothesis**.

Therefore, when the p-value is small (typically below a predetermined threshold like 0.05), researchers often reject the null hypothesis in favor of the alternative hypothesis, which suggests some effect or difference.

**Understanding p-value with Example**

**Imagine you have a coin. **When you toss this coin, there are two possible outcomes: heads or tails.

Now, if the coin is fair (not rigged), the probability of getting heads is 0.5, and the probability of getting tails is also 0.5.

**Hypotheses**:

**Null Hypothesis (H0)**: The coin is fair. This means the probability of getting heads is 0.5.**Alternative Hypothesis (H1)**: The coin is rigged (or not fair).

**1. Observe the Results**

Let’s say you decide to toss this coin **10 times** to see how many times you get heads.

If the coin is truly fair (as per the null hypothesis), you’d expect to get heads about 5 times out of 10.

However, you get heads **9 times **out of 10. **This seems unusual for a fair coin, right?**

**2. Calculating the p-value**

We’ve tossed the coin 10 times and observed 9 heads.

If the coin is fair, the probability of getting heads on any single toss is 0.5.

**Using the Binomial Distribution**

The number of heads in 10 tosses of a fair coin follows **a binomial distribution**.

- Binomial Distribution: Representing the number of successes in a fixed number of Bernoulli trials.
- Bernoulli Trials: A random experiment with exactly two possible outcomes, “success” and “failure”

See Also: Binomial Distribution: Definition, Calculation with Example

We can use the binomial distribution formula to calculate the probability of getting exactly* k* successes (heads) in *n* trials (tosses) when the success probability for each trial is *p*:

- is the binomial coefficient, representing the number of ways to choose
*k*successes from*n*trials. *P*is the probability of success on a single trial.*1-p*is the probability of failure on a single trial.

**Calculating for 9 and 10 Heads**

We want to know the probability of getting 9 or more heads in 10 tosses if the coin is fair.

So, we’ll calculate the probability for 9 and 10 heads and sum them up to get the p-value.

Probability of exactly 9 heads:

Probability of exactly 10 heads:

The p-value is** the sum** of these probabilities:

**We find out the p-value is 0.011**

Let’s assume, after the calculations, our p-value is **0.011** (this is a hypothetical value for the sake of explanation).

**3. Making a Decision**

With a p-value of 0.011, which is less than 0.05, **we have evidence to reject the null hypothesis**. This suggests that our observed result (9 heads out of 10) is **quite unusual** if the coin were truly fair.

**Therefore, we might conclude that the coin seems rigged or biased towards heads.**

However, remember that this doesn’t prove the coin is rigged; it just suggests that the result we observed is unlikely if the coin were fair.

By calculating the p-value and comparing it to a threshold (like 0.05), we can make informed decisions about our hypotheses!

**Key Takeaways**

- The p-value helps determine the significance of results.
- A smaller p-value suggests that the observed data is inconsistent with the null hypothesis.
- Commonly, a threshold of 0.05 is used to determine significance.

**Formula of p-value?**

The formula for p-value **depends on the type of test being conducted**.

So, there is no one concrete formula for P-Value.

**Why is the Threshold Set at 0.05?**

The 0.05 threshold, often termed as the significance level (α), is more of a convention than a hard rule.

It was popularized by the statistician **R.A. Fisher.** While he himself acknowledged it was somewhat arbitrary, it became a standard in many scientific fields.

**However, it’s crucial to understand that there’s no scientific basis for this exact threshold.** When reporting results, it’s recommended to provide the exact p-value rather than just stating its significance.

**Relationship between p-value and Test Statistics**

The p-value is directly related to the test statistic.

A more extreme test statistic will result in a smaller p-value. It’s essential to differentiate between:

**p-value**: The probability we discussed above.**Test Statistic**: A standardized value used to determine the p-value.**Critical Value**: The threshold value that determines significance.

**Relationship between p-value and Sample Size:**

**As the sample size increases, the p-value can become more sensitive.**

Even small differences from the null hypothesis can become significant with a large sample size.

**What is p-hacking?**

P-hacking, or data dredging, refers to the practice of manipulating data or analysis to achieve a desired p-value.

While intentionally doing this is unethical, researchers might unintentionally p-hack by:

- Running multiple tests and only reporting the significant ones.
- Stopping data collection once they achieve significance.