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 244thing is left to estimate, namely the value p=p 1 =P 2 . Once we specify a value of p, then,by the assumptions in the null hypothesis, all the p i are decided.We get the p-value in our example as follows:> y = c(35,40,25)> phat = c(75/200,75/200,25/100)> n = sum(y)> sum( (y−n*phat)^2/(n*phat))[1] 0.3333> pchisq(.3333, df =1 , lower.tail=FALSE)[1] 0.5637The difference is not statistically significant.In general, the χ 2 statistic can be used in significance tests where the null specifiessome relationship among the multinomial probabilities. The asymptotic distribution ofthe test statistic under the null hypothesis will be chi-squared. The degrees of freedomwill depend on the number of values that we are free to specify.9.1.3 Problems9.1 A die is rolled 100 times and yields the frequencies in Table 9.1. Is this a fair die?Answer using a significance test with H 0 :p i =1/6 <strong>for</strong> each i andTable 9.1 100 rolls of a dievalue1 2 3 4 5 6count 13 17 9 17 18 26H A :P i ≠1/6 <strong>for</strong> at least one i.9.2 Table 9.2 contains the results of a poll of 787 registered voters and the actual raceresults (in percentages of total votes) in the 2003 gubernatorial recall election inCali<strong>for</strong>nia.Table 9.2 Cali<strong>for</strong>nia gubernatorial recall electionCandidate party poll amount actualSchwarzenegger Republican 315 48.6Bustamante Democrat 197 31.5McClintock Republican 141 12.5Camejo Green 39 2.8Huffington Independent 16 0.6other – 79 4.0a Source http://www.cnn.com/Is the sample data consistent with the actual results? Answer this using a test ofsignificance.

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

Saved successfully!

Ooh no, something went wrong!