9 Statistical inference
Descriptive statistics summarize the data we have. Statistical inference asks what that data can tell us about the larger population it came from. This chapter introduces the central idea, which is comparing an observed result against what chance alone would produce, and then applies that idea to three kinds of question: whether a single observed proportion is surprising, whether two groups really differ, and what range of values for a population quantity the data leaves plausible.
Everything in this chapter is built by simulation rather than by formula. Each technique comes down to repeating an experiment many thousands of times and asking how often chance alone produces a result as extreme as the one we actually observed, so the loops and functions from Chapter 8 are the only machinery we need.