Hypothesis testing is a method of making statistical decisions using experimental data. It is used to infer whether a hypothesis about a population parameter should be accepted or rejected.
2025-04-11
Hypothesis testing is a method of making statistical decisions using experimental data. It is used to infer whether a hypothesis about a population parameter should be accepted or rejected.
Example:
Two-tailed test with significance level \(\alpha = 0.05\).
Test statistic (z-test for mean):
\[ z = \frac{\bar{x} - \mu_0}{\sigma / \sqrt{n}} \]
Where: - \(\bar{x}\): sample mean - \(\mu_0\): hypothesized mean - \(\sigma\): population standard deviation - \(n\): sample size
set.seed(123) sample_data <- rnorm(100, mean = 51, sd = 10) sample_mean <- mean(sample_data) sample_sd <- sd(sample_data) n <- length(sample_data) z_stat <- (sample_mean - 50) / (sample_sd / sqrt(n)) p_value <- 2 * (1 - pnorm(abs(z_stat))) list(z_stat = round(z_stat, 2), p_value = round(p_value, 4))
## $z_stat ## [1] 2.09 ## ## $p_value ## [1] 0.037
Thank you for learning about Hypothesis Testing.