Skip to content

Commit

Permalink
Update the text description for the slice feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
howardabrams committed Apr 11, 2013
1 parent 68ca857 commit 9bca85a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 8 deletions.
43 changes: 39 additions & 4 deletions README.md
Expand Up @@ -122,13 +122,13 @@ if you run more than one test, some user accounts will be in mutiple test groups
For example, the following experiment has assigns 25% of the users into "Group A" and 25% into "Group B".
This leaves 50% of the users outside of this test in a control group:

![Distribution for Test 1](multigroup/graph-1.png)
![Distribution for Test 1](visuals/graph-1.png)

Using the same users but with a *second experiment* of exactly the same size, some of the user accounts
from the first "Group A" will be in this second "Group A" as well as some in "Group B", as shown in this
image. The colors are based on the assignments in the first experiment above:

![Distribution for Test 2](multigroup/graph-2.png)
![Distribution for Test 2](visuals/graph-2.png)

If the second experiment should only use accounts from the first experiments *control group*, then this
plugin is not what you should use, but instead, you'll need to create a distribution based on your
Expand Down Expand Up @@ -215,9 +215,11 @@ Or as a collection of named parameters:
$.labrats.group( { key: userID, name: "Large Logo Test",
numGroups: 2 } );

**Note:** This last approach allows you to specify the number of
This last approach allows you to specify the number of
groups (instead of calling the `configure()` function).

#### Limit Test Pool with `subset`

You can limit the size of available pool (effectively creating a
a pool of people in test groups and another *control group*). For
instance:
Expand All @@ -229,6 +231,38 @@ Will return `-1` if the user is part of the 90% control group,
otherwise, it returns either `0` or `1` if it is in one of the
5% sized test groups.

#### Slicing Test Pool

With multiple tests, a random distribution algorithm means that some
users will end up in more than one test group. The `slices` option
divides the test pool into discreet subgroups, and the `slice` option
specifies which slice to use for a particular test.

For instance, suppose you have some experiments that are quite invasive,
(perhaps even conflicting if a person ended up as a lab rat in more than one),
we could define the first experiment to use the first slice:

$.labrats.group( { key: userId, name: "serious tests",
slices: 3, slice: 0, numGroups: 2 });

The second experiment would use the next *slice*:

$.labrats.group( { key: userId, name: "serious tests",
slices: 3, slice: 1, numGroups: 2 });

Notice the test name for the group of slices must be the same.

This slicing feature can be combined with the `subset` feature to
keep a control group out. Also, when using the subset and the slicing
features, the `numGroups` option can be unspecified in order to default
to `1` (a single test group).

With five experiments where each experiment is in a slice with
two test groups, we might have a distribution illustrated in
this diagram:

![Distribution for Test 1](visuals/slice_graph.png)


### `$.labrats.inGroup()`

Expand All @@ -246,7 +280,8 @@ second argument is an object similar to what is passed to the

- `key` is the identification of the user
- `name` is the test's name
- `subset` is the size of the pool, where `100 - subset` is the size of the control group
- `subset` is the size of the pool, where `100 - subset` is the
size of the control group

This function can also be called as a series of parameters:

Expand Down
14 changes: 10 additions & 4 deletions jquery.labrats.js
Expand Up @@ -156,14 +156,14 @@
* divides the test pool into discreet subgroups, and the `slice` option
* specifies which slice to use for a particular test.
*
* For instance, suppose you have three tests that are quite invasive,
* and perhaps even conflicting if a person ended up in the "Group A"
* for more than one. We could define the first test as:
* For instance, suppose you have some experiments that are quite invasive,
* (perhaps even conflicting if a person ended up as a lab rat in more than one),
* we could define the first experiment to use the first slice:
*
* $.labrats.group( { key: userId, name: "serious tests",
* slices: 3, slice: 0, numGroups: 2 });
*
* The second test would be:
* The second experiment would use the next *slice*:
*
* $.labrats.group( { key: userId, name: "serious tests",
* slices: 3, slice: 1, numGroups: 2 });
Expand All @@ -174,6 +174,12 @@
* keep a control group out. Also, when using the subset and the slicing
* features, the `numGroups` option can be unspecified in order to default
* to `1` (a single test group).
*
* With five experiments where each experiment is in a slice with
* two test groups, we might have a distribution illustrated in
* this diagram:
*
* ![Distribution for Test 1](visuals/slice_graph.png)
*/

$.labrats.group = function(params) {
Expand Down
Binary file added visuals/slice_graph.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9bca85a

Please sign in to comment.