Data Matters with Fathom! Dynamic Statistics software
Activity 3.3
In this project, we are going to perform a Monte Carlo test of the difference between two proportions. The difference that we saw in the data was 4.7%. To do the Monte Carlo test, we will take pairs of 1,000-observation samples. Every sample will come from a probability of 40.25%. We will calculate the difference in each pair and save those differences. The p-value is the proportion of the differences we find that is at least as far from zero as 4.7%.
Here is how to run the Monte Carlo simulations.
- Create a Collection with two attributes, Honor1 and Honor2.
- Set each attribute to be filled with 1s and 0s. The probability of a 1 will be .4025. (A 1 indicates making the honor roll.)
- Set the measurements, Proportion1 and Proportion2, that are the proportions in each attribute that is a 1.
- Create a Measurement Collection that collects measures from samples of your Collection.
- Create a new attribute in the Measurement Collection that is the difference between the proportions.
- Get a histogram of the differences.
Step 1: Create a Collection with two attributes, Honor1 and Honor2.
Drag a case table onto the workspace. Click on <new> and type Honor1 . Click on <new> again and type Honor2 .
Right-click on Honor1 and select New Cases
. Type 1000 and click OK.
Step 2: Set each attribute to be filled with 1s and 0s. The probability of a 1 will be .4025. (A 1 indicates making the honor roll.)
Right-click on Honor1 and select Edit Formula. Type randomBinomial(1,.4025) . This formula fills the attribute with 1s and 0s. The chance of a 1 is .4025.
Right-click on Honor2 and enter the same formula: randomBinomial(1,.4025) .
Step 3: Set the measurements, Proportion1 and Proportion2, that are the proportions in each attribute that is a 1.
Hold down Ctrl and press I. Click on the Measures tab and <new>. Type Proportion1 . Right-click on Proportion1 and select Edit Formula. Enter the formula proportion(honor1=1) .
Repeat to create Proportion2, entering the formula proportion(honor2=1) .
Step 4: Create a Measurement Collection that collects measures from samples of your Collection.
Select Analyze, Collect Measures.
Step 5: Create a new attribute in the Measurement Collection that is the difference between the proportions.
Drag a case table onto the workspace. Click on <new> and name a new attribute Difference. Right-click on Difference and select Edit Formula. Enter Proportion1 Proportion2 .
Step 6: Get a histogram of the differences.
Drag a Graph onto the workspace. Drag Difference onto Drop an attribute name here. Click on Dot Plot and select Histogram.
Click on the Measures Collection, hold down Ctrl, and press I. Set Measures to something like 100. Click on Collect More Measures. Watch the sampling distribution of differences grow. Set Measures to 1,000, turn off Animation, and collect more measures.
Now you can see how differences between pairs of proportions would be distributed if both proportions in each pair were drawn from a system with a constant probability of 40.25%. What can you say about the p-value? Is a difference of 4.7% or larger a reasonably likely event, if the null hypothesis is true? What do you conclude about the null hypothesis that the probability of making the honor roll was 40.25% in both years?
Save Your Work
You can save yourself time in later projects by calling up workspaces from your earlier projects and modifying them.
| ©2008 Key College Publishing. All rights reserved. |
|