QUIZ 9 (questions are in italics) The data set presidents_dat.txt on the course website contains the heights of all american presidents, *so far.* In other words, we can imagine a population of presidents from which our sample has come. Now, according to Google, the average height of the white american male is 177.8 cm (5' 10"). Assuming that american presidents are a random sample taken from the population ofall presidents (past, present, and future), is there evidence from all of this data that the true average height of american presidents is larger than the average height of the white american male? a) State the appropriate H0/H1 in terms of a *thorough and well-defined parameter.* Before you start answering, make sure you understand what's the sample and what's the population. Without a clear understanding of those concepts, you can't just apply a t.test and interpret the results. So, again, define your parameters VERY completely and carefully. H0: mu < 177.8 (= is OK too) H1: mu > 177.8 where mu = true mean height of *population of all presidents.* b) Write code to compute (and report) the p-value corresponding to the H0/H1 in part a). dat = read.table("http://sites.stat.washington.edu/people/marzban/390/spring21/presidents_dat.txt", header=F) x = dat[,2] mu0 = 177.8 # average height of white american male (5' 10") t.test(x,mu=mu0, alternative="greater") # p-value = 0.02 c) At alpha = 0.05, state your conclusion "In English." # Since p-value < alpha, there is evidence that the mean height of the population of all presidents is larger than the mean height of the white american male. Now, let's say we want to see if presidents have become taller over the years. Later (in ch11) we may learn how to answer questions like that with regression. But, here, let's do it this way: Consider the early presidents 1 - 22, and the later presidents 23-44, separately. d) Write code to make a comparative boxplot of the heights for the early and later presidents. boxplot(x[1:22], x[23:44]) e) Is there evidence that the true mean height of the later presidents is larger than that of the early presidents? To that end, - Write the appropriate H0/H1, in terms of well-defined parameters, - Compute and report the p-value, (Hint: check out the help pages for t.test()), - State your conclusion in terms of H0/H1, AND "in English", at alpha = 0.05 mu1 = true/population mean height of the early presidents mu2 = true/population mean height of the later presidents H0: mu2 < mu1 (or mu2 - mu1 < 0) H1: mu2 > mu1 (or mu2 - mu1 > 0) t.test(x[23:44],x[1:22], alternative="greater") # According to the help pages for t.test(x,y,...), alternative="greater", # corresponds to the alternative hypothesis mu_x > mu_y. # p-value = 0.01101 # p-value < alpha, therefore reject H0(mu2mu1), # In English: There is evidence that later presidents have come from a # taller population of presidents. f) Is there evidence that the true mean height of the later presidents exceeds that of the early presidents by 2cm? This time, - write the appropriate t.test(), - report the p-value, and - State your conclusion in terms of H0/H1, AND "in English", at alpha = 0.05 t.test(x[23:44],x[1:22], mu=2, alternative="greater") # p-value = 0.08512 # p-value > alpha, i.e., cannot reject H0 in favor of H1, # In English: There is no evidence from data that the true mean height of # the later presidents exceeds that of the early presidents by 2cm. Moral: The qualitative comparisons that we did with boxplots can be quantified with the t-test.