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.

Bivariate data 95[1] 13 50> florida$County[c(13,50)][1] DADE PALM BEACH67 Levels: ALACHUA BAKER BAY BRADFORD BREVARD …WASHINGTON(We use both with() and the dollar-sign notation instead of attaching the data frame.)Figure 3.13 Scatterplot of Bush andBuchanan votes by county in FloridaThere is a strong linear relationship with two outliers. If the relationship were exactlylinear without intercept, this would say that Buchanan always had the same percentage ofconservative votes.Palm Beach County’s infamous “butterfly ballot” design was believed to have causedmany people to cast votes incorrectly. Suppose this were true. How many votes mightthis have cost Al Gore, the Democrat? Say that the extra Buchanan votes were to go toGore. How many extra Buchanan votes were there? One way to estimate the amount is touse the regression line to make a prediction based on the number of Bush votes <strong>for</strong> thatcounty.The predicted amount and residual <strong>for</strong> Palm Beach are found as follows:> with(florida, predict(res, data.frame(BUSH =BUSH[50])))[1] 796.8> residuals(res)[50]502610This simple analysis indicates that Buchanan received 2,610 of Gore’s votes—manymore than the 567 that decided the state and the presidency. (The Palm Beach Post, usingdifferent data, concluded that Gore lost 6,607 votes when voters marked more than onename on the butterfly ballot.)

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

Saved successfully!

Ooh no, something went wrong!