2024-02-05

Introduction to P-Values

P-values are used to make decisions based on sample data, such as whether or not a given correlation between two or more variables are valid.

What are P-Values?

The probability that a particular statistical measure, such as the Mean or Standard Deviation (SD) of an assumed probability distribution representing the null hypothesis will be greater than or equal to observed results.

Interpreting P-Values

  • High P-Value (>= 0.05): Evidence against the null hypothesis. We may reject it.
  • Low P-Value (< 0.05): Weak evidence against the null hypothesis. In the social sciences, we may not reject it.
  • Very Low P-value (< 0.00000035): Very weak evidence against the null hypothesis. In the physical sciences, we may not reject it.

P-Values in 3D

Assuming a normal distribution, the following slide represents variations in the distribution of p-values for different scenarios involving the sum x + y, where x and y are individual variables that may be correlated to one another.

## Warning: `includeHTML()` was provided a `path` that appears to be a complete HTML document.
## ✖ Path: plotly_3d_plot.html
## ℹ Use `tags$iframe()` to include an HTML document. You can either ensure `path` is accessible in your app or document (see e.g. `shiny::addResourcePath()`) and pass the relative path to the `src` argument. Or you can read the contents of `path` and pass the contents to `srcdoc`.
plotly

Randomly Generated p-values

P-values here are randomly distributed in a uniform way between 0 and 1 given a seed of 123. This is a demonstration graph, and not necessarily informative.

##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
## 0.0006248 0.2454707 0.4663707 0.4985590 0.7554713 0.9942698

Mathematical Notation

In statistical formulas, p-values are often denoted by \(p\). The formula for a two-sample t-test is given by:

\[ t = \frac{\bar{X}_1 - \bar{X}_2}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}} \], where \(t\) is the test statistic.

Hypothesis Testing Process

  1. Formulate Hypotheses: Null hypothesis (\(H_0\)) and alternative hypothesis (\(H_A\)).
  2. Collect Data: Obtain a sample and collect relevant data.
  3. Calculate Test Statistic: Compute the test statistic based on the sample data.
  4. Calculate P-Value: Determine the probability of observing the data under the null hypothesis.
  5. Make a Decision: Compare the p-value to the significance level (\(\alpha\)).