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 220close to 1 just by making n large enough. The confidence interval, on the other hand,would show much better that the value of the mean is likely close to 16. The language ofsignificance tests, however, is more flexibleFigure 8.4 If is in the two-sidedrejection region, then a confidenceinterval around does not contain µand allows us to consider more types of problems. Both approaches are useful to have.R is agnostic: it can return both the confidence interval and the p-value when asked,although the defaults <strong>for</strong> the functions usually return just the confidence interval.8.4 Significance tests <strong>for</strong> the medianThe significance test <strong>for</strong> the mean relies on a large sample, or on an assumption that theparent distribution is normally (or nearly normally) distributed. In the situation where thisisn’t the case, we can use test statistics similar to the ones used to find confidenceintervals <strong>for</strong> the median. Significance tests based on these test statistics are nonparametrictests, as they do not make assumptions about the population parameters to calculate thetest statistic (though there may be assumptions about the shape of the distribution).8.4.1 The sign testThe sign test is a simple test <strong>for</strong> the median of a distribution that has no assump¬ tions onthe parent distribution except that it is continuous with positive density. Let H 0 supposethat the median is m. If we count the number of data points higher than the median, weget a number that will have a Binomial(n, 1/2) distribution, as under H 0 , a data point isequally likely to be more or less than the median.This leads to the following test.

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

Saved successfully!

Ooh no, something went wrong!