9Testing

One of the most popular (as in frequently performed) tasks in statistics is to draw conclusions about a population when we only have data for a subset or a sample of that population. In this chapter, we will consider two such tasks:

  • Calculating a confidence interval (CI) for a population statistic such as the mean or the variance;
  • Comparing population statistics to each other or to specific values or distributions, using statistical tests.

The calculations in images in both cases are extremely straightforward and, where appropriate, carried out simultaneously. However, selecting and defining an appropriate CI or test, and then interpreting the results are fraught with pitfalls and generally performed badly, frequently in published papers.

The framework for tests (CIs use a subset) is the following:

  1. Define the question under consideration in terms of statistical hypotheses. This will determine the general sort of test to be carried out;
  2. Check the assumptions that lay behind the tests. This will help pin down the specific test (and possibly the specific hypotheses) that is appropriate;
  3. Carry out the test;
  4. Interpret the results of the test in terms of the hypotheses;
  5. Translate those results into a conclusion for ...

Get The R Book, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.