1 of 10

Randomness & Sample Size

@BootstrapWorld

#BootstrapCS

2 of 10

Flip the Script: Inference v. Probability

One of the most useful tasks in Data Science is using sample data to infer (guess) what’s true about the larger population from which the sample was taken.

This process, called statistical inference, is used to gain information in practically every field of study you can imagine: medicine, business, politics, history; even art!

Early on, statisticians discovered that random samples almost always work best.

@BootstrapWorld

#BootstrapCS

3 of 10

Flip the Script: Inference v. Probability

Suppose we want to estimate what percentage of all Americans plan to vote for a certain candidate.

We can’t ask everyone who they’re voting for, so pollsters instead take a sample of Americans, and generalize the opinion of the sample to estimate how Americans as a whole feel.

But choosing a sample can be tricky…​

@BootstrapWorld

#BootstrapCS

4 of 10

Flip the Script: Inference v. Probability

  • Would it be problematic to only call voters who are registered Democrats? To only call voters under 25? To only call regular churchgoers? Why or why not?
  • How could we choose a representative subset, or sample of American voters?
  • Would it be problematic to only sample a handful of voters? What do we gain by taking a larger sample?

@BootstrapWorld

#BootstrapCS

5 of 10

Flip the Script: Inference v. Probability

Before we infer something unknown about a population from a sample, we need to know what makes a "good" sample!

Sampling is a complicated issue!

@BootstrapWorld

#BootstrapCS

6 of 10

Flip the Script: Inference v. Probability

The main reason for doing inference is to guess about something that’s unknown for the whole population.

But a useful step along the way is to practice with situations where we happen to know what’s true for the whole population. As an exercise, we can keep taking random samples from that population and see how close they tend to get us to the truth.

@BootstrapWorld

#BootstrapCS

7 of 10

Flip the Script: Inference v. Probability

Another discovery (besides the value of randomness) that statisticians made early on was something that’s perfectly consistent with common sense: Larger samples are better than smaller ones, because they tend to get us closer to the truth about the larger population.

@BootstrapWorld

#BootstrapCS

8 of 10

Flip the Script: Inference v. Probability

Save a copy of the Random Samples Starter File and Click Run.

Complete Sampling and Inference (Page 40) with your group.

@BootstrapWorld

#BootstrapCS

9 of 10

Flip the Script: Inference v. Probability

How did your results for the small sample compare with your results for the large?

@BootstrapWorld

#BootstrapCS

10 of 10

Additional Exercises

@BootstrapWorld

#BootstrapCS