Homework 3

Course

STAT218

Due

April 15, 2025

Solutions given for problem 1 only.

  1. The provided code splits the body temperature data into two groups by sex. Use this data to do the following.

    1. Compute a 90% confidence interval for the mean female body temperature and interpret the interval in context in the style introduced in class.
    2. Compute a 90% confidence interval for the mean male body temperature and interpret the interval in context in the style introduced in class.
    3. Based on your intervals, is it plausible that there is no difference in mean temperature by sex? Why or why not?
load('data/temps2.RData')

# split observations into two groups by sex
temps.split <- split(temps$body.temp, temps$sex)

# store male and female temperatures
temps.m <- temps.split$male
temps.f <- temps.split$female

# part a: confidence interval for mean body temps for female
temps.f.mean <- mean(temps.f)
temps.f.se <- sd(temps.f)/sqrt(65)
cval.f <- qt(0.95, df = 64)
temps.f.mean + cval.f*c(-1, 1)*temps.f.se
[1] 98.23993 98.54776
# part b: confidence interval for mean body temps for male
temps.m.mean <- mean(temps.m)
temps.m.se <- sd(temps.m)/sqrt(65)
cval.m <- qt(0.95, df = 64)
temps.m.mean + cval.m*c(-1, 1)*temps.m.se
[1] 97.95996 98.24927
  1. With 90% confidence, the mean female body temperature is estimated to be between 98.24 and 98.55 degrees Farenheit.
  2. With 90% confidence, the mean male body temperature is estimated to be between 97.96 and 98.24 degrees Farenheit.
  3. The intervals overlap, so there is a common plausible value for both means; it is therefore plausible that there is no difference is mean temperature by sex.