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.

Confidence intervals 183In R this becomes one of> zstar = −qnorm(alpha/2) # left tail> zstar = qnorm(1−alpha/2) # right tailThe inverse relationship would be found by> alpha = 2*pnorm(−zstar)Figure 7.3 The relationship betweenz* or z a/2 , and α■ Example 7.2: Presidential job per<strong>for</strong>mance A Zogby America poll involved 1,013likely voters selected randomly from throughout the 48 contiguous United States usinglisted residential telephone numbers.The surveyers found that 466 voters rated thepresident’s job per<strong>for</strong>mance as “good” or “excellent.” Find a 95% confidence interval <strong>for</strong>the true proportion.This type of polling is about as close to a random sample as can be gotten with limitedresources, though there are several sources of possible bias to consider. For example, noteveryone in the United States has a listed residential telephone number, so the sample isonly from households that do. Additionally, nonresponse can be very high in suchsurveys, introducing another potential bias. For simplicity, we’ll assume the sample is arandom sample from the population of likely voters and that n=1013 is large enough sothat the normal approximation applies.As a 95% confidence interval <strong>for</strong> p would be To find thiswe have> n = 1013> phat = 466/n> SE = sqrt(phat*(1−phat) /n)> alpha = .05> zstar = −qnorm(alpha/2)> zstar # nearly 2 if doing byhand

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

Saved successfully!

Ooh no, something went wrong!