22 1. Summarizing Data a) Make a table showing the frequency with which each number was selected using table(). b) Make a histogram of these values with bins centered at the integers from 1 to 30. c) What numbers were most frequently chosen? Can you get R to find them for you? d) What numbers were least frequently chosen? Can you get R to find them for you? e) Make a table showing how many students selected odd versus even numbers. 1.5. The distribution of a quantitative variable is symmetric about m if whenever there are k observations with value m + d, there are also k observations with value m d. Equivalently, if the values are x1 x2 · · · xn, then xi + xn+1−i = 2m for all i. a) Show that if a distribution is symmetric about m, then m is the median. (You may need to handle separately the cases where the number of values is odd and even.) b) Show that if a distribution is symmetric about m, then m is the mean. c) Create a small distribution such that the mean and median are equal to m but the distribution is not symmetric about m. 1.6. Describe some situations where the mean or median is clearly a better measure of central tendency than the other. 1.7. Below are histograms and boxplots from six distributions. Match each his- togram (A–F) with its corresponding boxplot (U–Z). A B C 0 2 4 6 8 10 D 0 2 4 6 8 10 E 0 2 4 6 8 10 F Z Y X W V U 0 2 4 6 8 10 1.8. The function bwplot() does not use the quantile() function to compute its five-number summary. Instead it uses fivenum(). Technically, fivenum() com- putes the hinges of the data rather than quantiles. Sometimes fivenum() and quantile() agree: fivenum-a fivenum(1:11) [1] 1.0 3.5 6.0 8.5 11.0 quantile(1:11) 0% 25% 50% 75% 100% 1.0 3.5 6.0 8.5 11.0 Percent of Total
Previous Page Next Page