A P-Value is the probability under the assumption of no effect or no difference
(null hypothesis), of obtaining a result equal to or more extreme than what was actually observed
The formula for calculating the t-statistic in a two-sample t-test is:
\[ t = \frac{\bar{X}_1 - \bar{X}_2}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}} \]
Where:
\[ ( \bar{X}_1\ ) \:and\: ( \bar{X}_2\ ) are\: the\: sample\: means\,\\ ( s_1^2\ )\: and\: ( s_2^2 ) are \:the\: sample\: variances\\ ( n_1 )\: and\: ( n_2 ) are \:the\: sample \:sizes\\The\: p-value\: is\: calculated\: based\: on\: the\: t-distribution\: with\: ( n_1 + n_2 - 2 ) \:degrees\: of\: freedom. \]
The most common p-value threshold for statistical significance is 0.05
Null Hypothesis
group1 <- rnorm(30, mean = 5)
group2 <- rnorm(30, mean = 5.5)
t.test(group1, group2)$p.value
[1] 0.009354922
P-values play a significant role in research by helping researchers assess the strength of evidence against the null hypothesis. They indicate the probability of observing results as extreme as those obtained, assuming the null hypothesis is true. The equation to calculate the p-value in a t-test is:
Interpreting p-values correctly is crucial in making informed, statistically sound conclusions in studies.