Understanding Hypothesis Testing
- Tests a claim against evidence.
- Wide ranging importance and usefulness in medicine, technology and business.
Understanding Hypothesis Testing
Used to verify claims or conclude information based on observations and data.
Example: A company claims that the average range of their electric vehicle is 300 miles with full charge
Use hypothesis testing to evaluate validity of such a claim.
\[t = \frac{\bar{x} - \mu_0}{s/\sqrt{n}}\]
\(\bar{x}\) = sample mean
\(\mu_0\) = hypothesized mean
\(s\) = sample standard deviation
\(n\) = sample size
## miles ## Min. :255.0 ## 1st Qu.:291.8 ## Median :314.0 ## Mean :309.9 ## 3rd Qu.:331.2 ## Max. :346.0
The sample has 20 random range measurements in miles.
# Perform one-sample t-test t.test(range$miles, mu = 300)
## ## One Sample t-test ## ## data: range$miles ## t = 1.6664, df = 19, p-value = 0.112 ## alternative hypothesis: true mean is not equal to 300 ## 95 percent confidence interval: ## 297.4656 322.3344 ## sample estimates: ## mean of x ## 309.9