Hypothesis Testing for Means

Elementary Statistics

MTH-161D | Spring 2025 | University of Portland

April 4, 2025

Objectives

Previously… (1/2)

The \(t\)-distribution

The larger the degrees of freedom the more closely the $t$-distribution resembles the standard normal distribution.

The larger the degrees of freedom the more closely the \(t\)-distribution resembles the standard normal distribution.

Previously… (2/2)

Confidence Intervals for One Mean

\[ \begin{aligned} \bar{x} \ &\pm\ t^*_{df} \times \frac{s}{\sqrt{n}} \end{aligned} \]

Confidence Intervals for Difference of Two Means

\[ \begin{aligned} \bar{x}_1 - \bar{x}_2 \ &\pm\ t^*_{df} \times \sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}} \end{aligned} \]

Case Study I

Every year, the US releases to the public a large data set containing information on births recorded in the country. This data set has been of interest to medical researchers who are studying the relation between habits and practices of expectant mothers and the birth of their children. We will work with a random sample of 1,000 cases from the data set released in 2014.

Here are four examples in the data set.

fage mage weeks visits weight sex habit
34 34 37 14 6.96 male nonsmoker
36 31 41 12 8.86 female nonsmoker
37 36 37 10 7.51 female nonsmoker
NA 16 38 NA 6.19 male nonsmoker

Case Study I: Baby Weights - Smoker vs Non-Smoker

We would like to know, is there convincing evidence that newborns from mothers who smoke have a different average birth weight than newborns from mothers who don’t smoke?

Here is the summary statistics for the dataset.

habit n Mean SD
nonsmoker 867 7.269873 1.232846
smoker 114 6.677193 1.596645

Case Study I: CLT Conditions

Conditions:

Since both conditions are satisfied, the difference in sample means may be modeled using a \(t\)-distribution.

Case Study I: Examining the Distributions (1/2)

The top panel represents birth weights for infants whose mothers smoked during pregnancy. The bottom panel represents the birth weights for infants whose mothers who did not smoke during pregnancy.

The top panel represents birth weights for infants whose mothers smoked during pregnancy. The bottom panel represents the birth weights for infants whose mothers who did not smoke during pregnancy.

Case Study I: Examining the Distributions (2/2)

Case Study I: One Sample t-test (1/4)

Consider one group (smoking) from the data. It is known that a newborn baby has an average weight of \(7.5\) lbs. We want to test whether the average weight for the smoking group is less than the average using a one sample t-test.

Is the data (smoking group) a convincing evidence to support the claim of the average weight to be less than \(7.5\) lbs?

Case Study I: One Sample t-test (2/4)

Case Study I: One Sample t-test (3/4)

Case Study I: One Sample t-test (4/4)

Using R to find the p-value

df <- 113 # degrees of freedom
t <- -5.48495 # test statistic
pt(t,df) # p-value
## [1] 1.278671e-07

Conclusions:

Case Study I: Two Sample t-test (1/4)

habit n Mean SD
nonsmoker 867 7.269873 1.232846
smoker 114 6.677193 1.596645

Is there a difference in weight means between the smoking group and nonsmoking group?

Case Study I: Two Sample t-test (2/4)

Case Study I: Two Sample t-test (3/4)

Case Study I: Two Sample t-test (4/4)

Using R to compute the p-value

df <- 113 # degrees of freedom
t <- -3.8165 # test statistic
pt(t,df) # p-value
## [1] 0.000110671

Conclusions:

Activity: Conduct a Hypothesis Test for Means

  1. Make sure you have a copy of the F 4/4 Worksheet. This will be handed out physically. This worksheet will be available on Moodle after class.
  2. Work on your worksheet by yourself for 10 minutes. Please read the instructions carefully. Ask questions if anything need clarifications.
  3. Get together with another student.
  4. Discuss your results.
  5. Submit your worksheet on Moodle as a .pdf file.

References

Diez, D. M., Barr, C. D., & Çetinkaya-Rundel, M. (2012). OpenIntro statistics (4th ed.). OpenIntro. https://www.openintro.org/book/os/