2025-06-08

Definitions

  • Hypothesis Testing: A systematic approach for deciding if the results of a sample study support a specific claim about the population mean.

  • Null Hypothesis(H0): The assumed population mean

  • Alternative Hypothesis(Ha): Hypothesized mean proposed due to sample; claim being tested

  • Test Statistic : A function of the sample data used to decide if H0 is rejected or not rejected

Three Types of Hypothesis Testing

  • Right-Tailed Test : Performed when Ha is proposed to be less than H0

  • Left-Tailed Test : Performed when Ha is proposed to be more than H0

  • Two-Tailed Test : Performed when Ha is proposed to be different than H0

Standard Distribution Curve

Analyzing the Box Plots

  • All sets have the same standard deviation but varying means.

  • The even spread of the population’s box plot is visual representation of its normal distribution.

  • The sample’s box plot is much more clustered than the population’s box plot but has far more outliers.

  • The lack of outliers on the population’s box plot indicates a consistent and predictable data set.

  • The median difference between the population’s box plot and the samples’ box plots suggests there is a significant difference between the groups, we would proceed with a hypothesis test using either sample.

Steps of a Hypothesis Test

  1. State null hypothesis and formulate alternative hypothesis to be tested

  2. Determine test statistic

  3. Determine critical value using given significance level

  4. Compare test statistic and critical value

  5. Write a conclusion regarding the outcome of the test and the implications in regards to the data

Two Tailed Test Example

A company claims that the average battery life of their new smartphone is 12 hours. A consumer group tests 100 phones and finds the average battery life to be 11.8 with a population standard deviation of 0.5 hours. At a 5% significance level, is there any evidence to refute the company’s claim?

Null and Alternative Hypothesis

  • H0: \(\mu\) = 12
  • Ha: \(\mu\) \(\neq\) 12

Two Tailed Test Continued

Z-Score

  • Z = \(\frac{\bar{x}-\mu}{\sigma/\sqrt{n}}\)
  • Z = \(\frac{11.8-12}{0.5/\sqrt{100}}\)
  • Z = -4

Critical Value

  • Z0.025 = \(\pm\) 1.96

Two Tailed Test Continued

Comparison of Z-score and Critical Value

  • |-4| > 1.96

Conclusion

  • Since the Z-score is greater than the critical value, we reject the null hypothesis. There is significant statistical evidence to suggest the average battery life is different than 12 hours and the company’s claim can be refuted.

Distribution Histogram

Distribution Histogram Code

set.seed(100)
# Ensure consistency between trials

sample_data = rnorm(100, mean = 12, sd = 0.5)
# Create new data set

sample_df = data.frame( value = sample_data)
# Create new data frame

ggplot(sample_df, aes(x = sample_data)) + 
  geom_histogram(bins = 15, fill = "orchid", color = "black" ) +
  labs(title = "Distribution of Battery Life", x = "Battery 
       Life (hours)")
# Plot histogram of distribution of battery life

Hypothesis Test for Two-Tailed Test