2025-10-20

What is P-Value?

The p-value tells us how likely it is to get results that are like ours or more extreme in cases if the null hypothesis were to be true.

It basically shows, how interesting our values would be if nothing interesting was happening.

Formula:

\[ P\text{-value} = P(\text{Test Statistic} \geq \text{Observed} \mid H_0 \text{is true}) \]

Null Hypothesis and Testing:

What is Null Null Hypothesis (H_0)?

It basically means that there is nothing special that is happening and there is no real difference. We try to find evidence with what we start with.

Test Stastic:

\[ t = \frac{\bar{x}-\mu_0}{s/\sqrt{n}} \]

Where:

  • \(\bar{x}\): Sample mean
  • \(\mu_0\): mean that we assume under H_0
  • \(s\): Sample standard deviation
  • \(n\): Sample size

Example:

blood_pressure <- c(122, 154, 119, 120, 118, 123, 118, 137, 193, 200)

bloodpressure_test <- t.test(blood_pressure, mu = 122, alternative = "less")
bloodpressure_test
## 
##  One Sample t-test
## 
## data:  blood_pressure
## t = 1.8365, df = 9, p-value = 0.9503
## alternative hypothesis: true mean is less than 122
## 95 percent confidence interval:
##      -Inf 158.7661
## sample estimates:
## mean of x 
##     140.4

blood pressure:

Second ggplot

Interactive 3D plot

  • This 3D plot shows how likley the different outcomes are if the null hypothesis is true.

Summary:

  • P-values help us decide if the results have an significance
  • Null Hypothesis usually assumes that there is no effect or difference
  • If “p-value < 0.05” then we reject \(H_0\)

Important formula to remember: \[ t = \frac{\bar{x}-\mu_0}{s/\sqrt{n}} \] Note: Just because it has value statistically does not mean that it has any significance in real scenarios.