Hypothesis testing is a statistical method used to make decisions.
We test:
\[H_0: \mu = \mu_0\] \[H_a: \mu \ne \mu_0\]
Hypothesis testing is a statistical method used to make decisions.
We test:
\[H_0: \mu = \mu_0\] \[H_a: \mu \ne \mu_0\]
We calculate:
\[t = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}\]
The significance level (\(\alpha\)) is usually 0.05 or 0.01.
The p-value measures how strong the evidence is against \(H_0\).
If p-value < \(\alpha\), reject \(H_0\).
Suppose we test:
We calculate the test statistic and make a decision.
set.seed(1) data <- data.frame(x = rnorm(100)) ggplot(data, aes(x)) + geom_histogram(bins = 20)
ggplot(data, aes(sample = x)) + stat_qq() + stat_qq_line()
plot_ly(x = ~data$x, type = "histogram")
mean(data$x)
## [1] 0.1088874
sd(data$x)
## [1] 0.8981994
Hypothesis testing helps us make decisions using data.