(Collecting Measures)

go back to the Expected Value Page

Now an even more powerful idea:

Every time we resample, we can tell how much we made. But we'd like to record those amounts so that we can do this, say, 100 times, and see the distribution of people's performances at the wheel. (That is, imagine 100 people each going to the wheel and playing ten times, betting on red every time. What's the distribution of amounts that the people make?)

To do this, we need to

- Calculate the amount that we make in the sample collection.
- Store that in a measure in the sample collection (more about this soon)
- Collect these measures in a new (measures) collection

Make sure you can see the inspector of your sample collection. (If not, double-click it.)

Click the
**Measures** tab to bring up the measures panel.

Click where it
says **<new>** and type the name **netWinnings**.

This creates a new measure. Think of a measure as an attribute that applies to the entire collection rather than to each case. Now we need to give this measure a value; to do that we'll define a formula.

Double-click the cell in the Formula column in the same row as your new attribute. The formula editor appears.

Enter the
formula **sum(winning)** (assuming that your "winning" attribute
has that name). Click **OK** to close the formula editor. The
value should appear -- and if you resample, that number should
change. It should equal your net winnnings -- how much you made in
your ten trips to the wheel.

You can resample by switching over to the

Samplepanel. Or you can select the collection and chooseSample Casesfrom theAnalyzemenu. Or you can open the collection and press theSample More Casesbutton.

Add another new
attribute, this one called **PlaysPerSession**, whose formula is
**count( )**. This will record how many times we went to the
wheel, for future reference.

Now (finally) we're ready to collect these measures, automating how the sampling repeats, collecting the measures we created as attributes for the whole collection, and stuffing them into regular cases in a third collection:

Select the
sample collection and choose **Collect Measures** from the
**Analyze** menu.

Fathom creates a new collection,

Measures from Sample of wheel. While the sample collection has regular attributes ofcolorandwinning, this one has regular attributes ofnetWinningsandplaysPerSession-- the same as themeasuresin its "source" collection.This is a good time to clean up your screen by closing inspectors or making tables, etc., smaller.

By default, Fathom collects five measures. We want more. As with sampling, the controls for collecting measures are in the inspector. And as with a sample collection, a measures collection knows that it collects measures, and from whom.

Double-click
the new measures collection, and make sure its inspector is showing
the **Collect Measures** panel. Change the panel to look like this
(100 measures, no animation):

Click the
**Collect More Measures** button. Now you'll have 100 measures --
the results from 100 sets of 10 spins of the wheel.

Graph
**netWinnings **to see the distribution, It should look something
like this:

So this graphs shows 100 trips to the wheel. While people generally lost money, some people won.

go back to the Expected Value Page