Introduction

In this presentation, we explore Hypothesis Testing, a core concept in inferential statistics.

What is Hypothesis Testing?

Hypothesis testing is a statistical method that helps us make decisions based on data.

Let \(H_0\) be the null hypothesis and \(H_1\) the alternative.

Example Scenario

We want to test if the mean weight of a product is 500g.

\(H_0: \mu = 500\)
\(H_1: \mu \neq 500\)

R Code for Hypothesis Test

set.seed(123)
sample_data <- rnorm(30, mean = 505, sd = 10)
t.test(sample_data, mu = 500)
## 
##  One Sample t-test
## 
## data:  sample_data
## t = 2.5286, df = 29, p-value = 0.01715
## alternative hypothesis: true mean is not equal to 500
## 95 percent confidence interval:
##  500.8657 508.1922
## sample estimates:
## mean of x 
##   504.529

ggplot Example

Another ggplot Plot

Base R 2D Plot (Instead of plotly)

Conclusion

Hypothesis testing is fundamental for drawing conclusions from data. It enables evidence-based decisions.