2024-11-01
Hypothesis testing is a statistical method used to infer if the results from a sample apply to a population.
This process helps determine if we have enough evidence to reject H₀.
Testing if the mean height of a group is 170 cm.
The p-value measures the probability of obtaining a test result at least as extreme as the observed result, under the assumption that H₀ is true.
# Sample data sample_mean <- 172 population_mean <- 170 std_dev <- 8 n <- 25 # Calculate the t-score and p-value t_score <- (sample_mean - population_mean) / (std_dev / sqrt(n)) p_value <- 2 * (1 - pt(abs(t_score), df = n - 1)) # Display the results t_score
## [1] 1.25
p_value
## [1] 0.2233515
A strong statistical method for drawing conclusions about population parameters from sample data is hypothesis testing. Through a methodical process of formulating hypotheses, selecting a suitable test, and analysing the findings, we may make well-informed choices and comprehend the validity of our conclusions.