STA 111 Lab: Sampling Distributions
The Goal
We’ve been talking about ways that we take samples from a population. We are now going to transition in our course into talking about ways we can use samples to make conclusions about populations. This is important because we are often in a situation where we cannot get information on the entire population but we can get information on a sample. The process of working to make conclusions about a population using the data we have in a sample is called inference.
The first step to learning how to conduct inference is to talk about sampling distributions. That’s what we’re going to work on in our lab today.
The Set Up
Reese’s pieces are a type of chocolate-coated peanut butter candy. They come in 3 colors - red, orange, and yellow.
According to the manufacturer, about 50% of Reese’s Pieces are orange. 50% is a population proportion. This means that if we (1) opened every Reese’s Pieces package in the world, (2) counted the number of orange Reese’s Pieces, and (3) divide that count by the total number of Reese’s Pieces, we should get .50, or 50%.
We often want to know about population parameters. What proportion of people in the world suffer from hunger? What proportion of people in your school believe we need a week long Fall Break rather than just two days off? What proportion of people in the United States believe we need to devote more resources to combating global warming?
These values are important, but they are also very difficult to obtain. We can’t ask every person in the world, a country, or even a school these questions. This also means that if we are given a population parameter ( 50% of Reese’s Pieces are orange) it is also very difficult to verify whether the values we are told are correct.
Typically, this means that instead of a population parameter, we are stuck using a sample statistic that we obtain from a sample from our population of interest. This leaves us with some questions:
- Can we use a sample statistic to estimate a population parameter?
- If we choose to do so, can we figure out how accurate our estimate is likely to be?
Data Driven Question
For our example today, the manufacturer claims 50% of Reese’s Pieces are orange. A child comes up to us with an unopened bag of Reese’s piece. They open it and shows us that in their bag of 36 Reese’s Pieces, only 12 of their candies were orange.
Question 1
What is the value of the parameter in this set up?
Question 2
What is the value of the statistic in this set up?
The child wants to write to the manufacturer, claiming that their bag of candy is evidence that less than 50% of Reese’s pieces are orange.
Question 3
On its own, does this single bag of Reese’s pieces provide convincing evidence that less than 50% of Reeses’s pieces are orange? Explain your answer to the child (who is 6).
Rather than relying on this one bag, we are going to use a simulation study to try and see if the child has convincing evidence that less than 50% of Reeses’s pieces are orange
Simulation Study: Creating the Population
A simulation study is an experiment we run using the computer. For today, we are going to use an applet at the following link. As always, make sure to open this link in a new tab: https://www.rossmanchance.com/applets/2021/oneprop/OneProp.htm?candy=1
When you open the site in a new tab, you should see something that looks like this:
To set up our simulation, we need to make sure the computer knows all the information about our data. We know that
- 36 Reese’s Pieces are in each standard package and
- the manufacturer claims that 50% of Reese’s Pieces are orange, so we set \(p = .5\).
To make sure the computer knows this, look at the upper left side of the screen. You should see the following:
We can see from this that in the population of Reese’s pieces being created by the computer, there is a 50% chance of getting orange. This is what we need, so we don’t need to change that!!
However, the number of Reese’s Pieces in a standard package is 36, and this does not match what is in the “Number of Candies” box on the Applet, so let’s change it to 36.
And now, we are ready to start!
Drawing a SRS sample
Great! We have our population. Now what? Well, if the manufacturer is right and the proportion of orange is 50%, and we draw a random sample of 36 candies, what proportion of them are orange??
There are many different ways to create samples, and today we will use simple random sampling.
Question 4
What must be true for a sample to be a simple random sample (SRS)?
Let’s start off with a simple random sample of 36 Reese’s Pieces. This means we want to randomly select 1 bag (36 Reese’s Pieces) from our population. To draw a simple random sample of size 36, make sure your upper right hand panel looks like this, and then click Draw Samples:
You will see animation start where 36 candies are pulled from the population. They are sorted into orange vs other colors, and the proportion of orange candies are counted.
In my sample (YOURS IS LIKELY DIFFERENT!!! It’s random!!!!), 38.9% of the candies are orange.
Question 5
What proportion of Reese’s Pieces in your sample are orange? This is our sample statistic for this sample.
Question 6
The child we are helping had 12 orange in their bag. Does your sample statistic help or hurt the child’s claim that \(p < .5\)?
Question 7
Suppose we use your sample statistic in Question 5 as an estimate of our population parameter. Do we over estimate or underestimate the parameter, and by how much?
Question 8
Do we expect our sample statistic and our population parameter to be the same? Explain why or why not.
Let’s see what happens if we try a different simple random sample.
A second sample
Okay, so this is what happens when we take one sample of size 36 from the population. What if we had a different sample? Let’s find out.
Grab a second random sample of 36 candies. We use the same process as before, by clicking Draw Samples.
Question 9
What proportion of Reese’s Pieces in this 2nd sample are orange? Is this sample proportion the same as what you got Question 5? Is it the same as the child’s statistic of .33?
All of this means that is not a good idea to use just one sample statistic to estimate our population parameter. However, we have also discussed that most of the time, a sample is all we have - we can’t get a population or even a second sample. So, what do we do??
Sampling Distributions
Instead of just using our value of the sample statistic to draw conclusions about the population parameter, we use something called a sampling distribution. We will learn two different ways to build a sampling distribution in this course: using simulation and using probability distributions. For today, we will use our simulation.
A sampling distribution is just a special dot plot where each dot represents a sample statistic created from a sample of the same size taken from the same population. It turns out that the sampling distribution is already something your applet has been building as we drew our 2 samples.
Remember, your dots may be in different spots since our samples are different, but there should be 2 dots! Each one represents one of the two sample proportions you have obtained so far: one from Sample 1 and one from Sample 2.
Right now we only have two samples, and that’s not really enough to tell us much. What we want to do is take many, many samples from the population and keep building this graph. This will give us a better idea of the different sample statistics we might expect to get with different samples from the population.
Taking many different samples of the same sample size from the same population, getting a sample proportion from each one, and then looking at all of the different sample proportions we get is called building a sampling distribution.
Building a Sampling Distribution
Right now, we only have two samples. Let’s generate 10 simple random samples from our population. For each of these samples, we will compute the sample proportion of the candies in the sample that are orange.
To do this, adapt your applet to use 10 samples. I also turned off my candy machine at this point, though you are welcome to leave it on!
When you hit Draw Samples, 10 more dots appear on your graph! These are 10 more sample statistics, each from a different sample of candies!
We want many, many samples, not 10, so let’s go ahead and add 100 samples…and then 1000.
Question 10
After your sampling distribution has 1112 dots, describe the distribution. In other words, is the distribution of the sample proportion of orange candies unimodal or multimodal, and is it symmetric, skewed right, or skewed left?
Question 11
Click the button for Summary Statistics right above your sampling distribution. Based on what appears, what is the mean of all the sample statistics? In other words, what is the mean of your sampling distribution?
Question 12
Is the value you get in Question 11 bigger than, smaller than, or roughly equal to the claimed population parameter of .5?
So, we have a whole bunch of sample proportions - one from each of 1112 samples. Some of these sample proportions are much bigger than .50, and some are much smaller than .50. However, the mean of all of these sample proportions is very similar to .50!! Here we have discovered a very powerful fact - the mean of the sampling distribution (the distribution of sample proportions) is very similar to the population proportion!!
This is a key fact in statistics: On average, if we take enough simple random samples, the average of the sample proportions will approximately equal the population proportion.
Spread
Okay, so the mean of all of the sample proportions is basically the population proportion. However, we started this process with the goal of understanding how far sample statistics tend to be different from the true value of .50. To do this, we need to describe the spread of the sampling distribution.
Recall that we already know a term that describes how different individual data points tend to be from the mean of a sample. This is the standard deviation. So, we need to know the standard deviation of the sampling distribution - how far do individual sample statistics tend to different from the population proportion (the mean of all the sample statistics)? We call the standard deviation of the sampling distribution the standard error (SE).
Question 13
What is the standard error of our sample statistics? In other words, what is the standard deviation of all the sample statistics?
Hint: The value should be printed on your sampling distribution by this point in the lab
This is the key to our ability to use samples to make conclusions about our population!!! We know that is it not a good idea to just report our sample statistic - it is likely larger or smaller than the actual population proportion. However, sampling distributions allow us to build a range of plausible values for our population proportion when all we have is the information from samples.
The Formula
Using simulation is great, and very powerful. However, what if we are not in a situation where we can use simulation? We will learn soon in our books that if take enough samples, and if certain conditions are met, the standard error (SE) of the sampling proportion is:
\[SE = \sqrt{\frac{p(1-p)}{n}},\]
where \(p\) is the true population parameter and \(n\) is the size of each SRS.
Question 14
Based on the formula above, what should the standard error of the sample proportion be? Is this value similar to what you got in Question 13?
Back to the Question of Interest
Question 15
Based on your sampling distribution, explain to the 6 year old whether you think you have enough evidence to say that the manufacturer’s claim of \(p = .5\) is wrong.
Changing the Sample Size
At this point, we have been able to help our 6-year old friend! This process we just went through will be formalized in hypothesis testing in our next class.
However, let’s try exploring one more thing. We have run our simulation using a sample size of 36. What if we increase that to 100? Would that change our sampling distribution at all? Let’s see.
Question 16
Refresh your Applet screen. Change your sample size to 100, and generate 1000 sample statistics. What is the mean of this sampling distribution?
Question 17
What is the standard error of this sampling distribution? Is this larger or smaller than the standard error you got in Question 13?
Question 18
Why do you think that this happens?
Wrapping it up
In this lab, we have seen that sampling distributions can help us to build a range of plausible values for a population proportion when all we have is a sample proportion. In the next class, we will formalize this with the construction of confidence intervals.
This lab uses the Rossman Chance Applet found at https://www.rossmanchance.com/applets/2021/oneprop/OneProp.htm?candy=1. The activity was written by Nicole Dalzell. Last updated 206 October 13.