Topic: P-value in hypothesis testing
Goal: Understand what a p-value is and how to interpret it
Key Points:
- Define the p-value
- The basic idea behind how it’s calculated
- How to compute and visualze it using R
2025-11-17
Topic: P-value in hypothesis testing
Goal: Understand what a p-value is and how to interpret it
Key Points:
For a right tailed test, the p-value is : \[ p = P(T \ge t_{\text{obs}} \mid H_0 \text{ is true}) \]
For a left tailed test : \[ p = P(T \le t_{\text{obs}} \mid H_0 \text{ is true}) \]
We test a population mean: \[ H_0: \mu = \mu_0 \\ H_a: \mu \ne \mu_0 \] we collect a sample \(X_1, \dots, X_n\) with mean \(\bar{X}\) and standard deviation \(s\).
The test statistic is : \[ t = \frac{\bar{X} - \mu_0}{s / \sqrt{n}} \]
t_test_result
## ## One Sample t-test ## ## data: Sample_data ## t = 0.99041, df = 99, p-value = 0.3244 ## alternative hypothesis: true mean is not equal to 5 ## 95 percent confidence interval: ## 4.909283 5.271528 ## sample estimates: ## mean of x ## 5.090406