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.

Significance tests 223parameters. A plot of the data shows that a normal population assumption is not correct;rather, the population appears to be lognormal.Per<strong>for</strong>m a significance test ofH 0 : median=.005, H A : median>.005.After taking logs, we can see that the data is symmetric, so the signed-rank test can applyto the log-trans<strong>for</strong>med data. The significance test of this data isH 0 : median=log(.005), H A : median>log(.005).>wilcox.test(log(salmon.rate),mu=log(.005),alt="greater”)Wilcoxon signed rank test with continuitycorrectiondata: log(salmon.rate)V = 2077, p-value = 0.065alternative hypothesis: true mu is greater than −5.298A small p-value is found.To contrast, the p-value <strong>for</strong> the sign test is found with these commands:> T = sum(salmon.rate > .005); n = length(salmon.rate)> 1 − pbinom(T − 1, n, 1/2)[1] 0.13618.4.3 Problems8.17 The exec. pay (<strong>Using</strong>R) data set contains data on the salaries of CEOs at 199 topcompanies in the United States. The amounts are in $ 10,000s. The data is not symmetric.Do a sign test to determine whether the median pay is more than $220,000.8.18 Repeat the previous exercise, using the signed-rank test on the log-trans<strong>for</strong>meddata. Do you reach the same conclusion?8.19 The babies (<strong>Using</strong>R) data set contains data covering many births. In<strong>for</strong>mationincluded is the gestation period, and a factor indicating whether the mother was a smoker.Extracting the gestation times <strong>for</strong> mothers who smoked during pregnancy can be donewith these commands:> attach(babies)> smokers=gestation[smoke == 1 & gestation != 999]> detach(babies)Per<strong>for</strong>m a significance test of the null hypothesis that the average gestation period is 40weeks against a two-sided alternative. Explain what test you used, and why you chosethat one.8.20 If the sign test has fewer assumptions on the population, why wouldn’t we alwaysuse that instead of a t-test? The answer lies in the power of the sign test to detect whenthe null hypothesis is false. The sign test will not reject a false null as often as the t-test.

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

Saved successfully!

Ooh no, something went wrong!