The provided code splits the body temperature data into two groups by sex. Use this data to do the following.
Compute a 90% confidence interval for the mean female body temperature and interpret the interval in context in the style introduced in class.
Compute a 90% confidence interval for the mean male body temperature and interpret the interval in context in the style introduced in class.
Based on your intervals, is it plausible that there is no difference in mean temperature by sex? Why or why not?
Solution
load('data/temps2.RData')# split observations into two groups by sextemps.split <-split(temps$body.temp, temps$sex)# store male and female temperaturestemps.m <- temps.split$maletemps.f <- temps.split$female# part a: confidence interval for mean body temps for femaletemps.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 maletemps.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
With 90% confidence, the mean female body temperature is estimated to be between 98.24 and 98.55 degrees Farenheit.
With 90% confidence, the mean male body temperature is estimated to be between 97.96 and 98.24 degrees Farenheit.
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.