How many girls should we expect in a 3-child family?
A DataDesk Simulation Experiment
Step 1: Choosing a Model
We'll use a box with a "1" ticket to represent a girl, and a "0" for a boy.
New > Blank Variable
Name the new variable "box"
Enter a 1 and a 0
Close the variable, and then select the "box" icon as your "Y" variable.
Step 2 and 4: Defining a Trial and Choosing the Number of Repetitions
A trial consists of pulling out 3 tickets, with replacement, from the box. 3 tickets is 150% of the total number of tickets in the box. Let's say we want to repeat this 25 times.
Manip > Sample
A dialogue box appears. Select "Random". Under "Percent of cases to be sampled" type 150. Click on the box that says "Sample with replacement". Then, type in 25 for "Draw (blank) samples". Hit the OK button.
Twenty-five variables have been created and named box.1, box.2, etc. You can see the icons at the bottom of the screen.
Step 3: Define the Statistic of Interest
We want to know the number of girls, and this means we need to sum each sample (because the number of 1's in a sample is equal to the total sum of the tickets -- this is why we defined girls as a "1" and boys as a "0".) To do this:
Calc > Summary Options Check "sum"
Select all of the variables by dragging the mouse around all twenty-five of them.
Calc > Summaries > As Variables
A new variable is created called Sum(Summary1). It is automatically selected as the "Y" variable, but if its not, then click on it once to do so.
Step 5: Calculate the mean of the observed statistics
You can now make a histogram of the sums, or do whatever you want. But to find the mean, we need to reset the summary options:
Calc > Summary Options Check "mean"
Calc > Summaries > Reports
The mean is our estimate of the expected number of girls in a 3-person family.
FIVESTEP JAVA SOFTWARE
If you are working in the iMac lab, then you have another simulation tool you can use. This program, called "Five Step", was written by the textbook publishers, but is a little "buggy". It is written in Java, and so you have to have a Java compiler running on your machine if you use this on your Mac at home. (You probably already do. If not you can download the MRJ program for free. We can send it to you from our site.)
Here is the key for using this package: BE PATIENT. It runs rather slowly.
To start the program, find the "Five Step" icon in the student folder. After a few moments, a window will appear.
1. Click on "Choose Box Model"
This is where you tell the computer what tickets are in your box.
Type in a 0 in one box and a 1 in the other. For future simulations, you can also change the frequency, as well as the value, of each ticket.
2. Hit "OK" and wait.
3. Where it says "Define a Trial" choose "Draw n with replacement"
When you do this, a new blank will appear that says "n = (blank)" This part of the program is buggy. When I do it, the cursor doesn't not appear in the window. Never-the-less, type the number "3". You won't see anything happen, but it's there. (We're drawing out three tickets, each representing a child in the family of 3-children.)
4. Define a Statistic: Choose Sum
5. Probability of interest: leave this blank
6. # of Trials: Choose whichever you like. Try 25 to start.
The program will start performing trials. Each trial consists of pulling three tickets, summing them, and reporting the sum. The results are shown in the histogram. The average of all trials is shown where it says "average". Ignore the "standard error" for now. We'll talk about that later. (It represents the fluctuation in the average. It is the standard deviation of the average.)
7. You can click on "# of Trials" again and select any number. It will continue where it left off. Note that the average will mostly increase and eventually "hover" around 1.5 -- sometimes lower, sometimes higher.