10.07.2015 Views

Using R for Introductory Statistics : John Verzani

Using R for Introductory Statistics : John Verzani

Using R for Introductory Statistics : John Verzani

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Using</strong> R <strong>for</strong> introductory statistics 742. Make a barplot of the years. Is there a trend?3. Try to fill in Table 3.4. (Use cut (), but look at ?cut and its arguments.)Table 3.4 Fill in this table using coinsYear 1920–1929 1930–1939 1940–1949 1950–1959 1960–1969Amount 3 2Year 1970–1979 1980–1989 1990–1999 2000–2009Amount 883.4 The data set dvdsales (<strong>Using</strong>R) contains monthly sales of DVD players from theirinitial time on the market through May 2004. Make side-by-side barplots of monthlysales by year. (The data needs to be transposed using t(); otherwise the barplots will bebroken up by month.)3.5 The f lorida (<strong>Using</strong>R) data set contains county-by-county tallies of the votes cast inthe 2000 United States presidential election <strong>for</strong> the state of Florida. The main candidateswere George Bush and Al Gore. Make a segmented barplot of the proportion of Bushvotes versus the proportion of Gore votes by county. Are these proportions always closeto the 50% proportion <strong>for</strong> the state?3.6 In 1996, changes in the United States welfare laws resulted in more monies beingspent on noncash assistance (child care, training, etc.) than on cash assistance. A table ofthe percentages of cash assistance is given in Table 3.5. Make a segmented barplotillustrating the percentages <strong>for</strong> both. The total spending is approximately $25 billion peryear.Table 3.5 Shift in what welfare provides’97 ’98 ’99 ’00 ’01 ’02Cash assistance 76% 70% 68% 52% 48% 46%source: New York Times October 13, 20033.7 The data set UScereal (MASS) contains in<strong>for</strong>mation about cereals on a shelf of aUnited States grocery store. Make a table showing the relationship betweenmanufacturer, mfr, and shelf placement, shelf. Are there any obvious differences betweenmanufacturers?3.2 Comparing independent samplesIn many situations we have two samples that may or may not come from the samepopulation. For example, a medical trial may have a treatment group and a control group.Are any measured effects the same <strong>for</strong> each? A consumer may be comparing two carcompanies. From samples, can he tell if the ownership costs will be about the same?When two samples are drawn from populations in such a manner that knowing theoutcomes of one sample doesn’t affect the knowledge of the distribution of the othersample, we say that they are independent samples. For independent samples, we may be

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!