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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Using</strong> R <strong>for</strong> introductory statistics 212Figure 8.3 Illustration of the threealternative hypotheses. In R, less isH A :Pp 0 ,two.sided is H A :p≠p 0 .The p-value varies based on the alternative hypothesis. This is because what is meant by“more extreme” <strong>for</strong> the value of the test statistic depends on H A . In this instance there arethree cases:(8.1)The first two cases are “one-sided” or “one-tailed,” the last “two-sided” or “twotailed.”The absolute values in the third case can be confusing but are there to say that largedifferences in either direction of p 0 are “more extreme.” Figure 8.3 illustrates the areas.Significance test <strong>for</strong> a population proportionA significance test <strong>for</strong> an unknown proportion betweenH 0 :p=p 0 , H A :pp 0 , or p≠p 0can be per<strong>for</strong>med with test statisticIf is based on a simple random sample and n is large enough, Z has a standardnormal distribution under the null hypothesis. The p-values can be computed from (8.1).In R the function prop.test() will per<strong>for</strong>m this significance test.■ Example 8.3: Poverty-rate increase In the United States, the poverty rate rose from11.3 percent in 2000 to 11.7 percent in 2001 to 12.1 percent in 2002, as reported by theUnited States Census Bureau. A national census takes place every decade. The year-2000number comes from a census. For the Census Bureau to decide the 2001 and 2002figures, a random sampling scheme is employed. Assume that the numbers come from a

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

Saved successfully!

Ooh no, something went wrong!