Create a distribution of the test-statistic over the possible
random samples of treatment units from the possible units.
There are two methods for generating the distribution. The
first method is enumerating all possible randomizations and
performing the test statistic on each. This gives the exact
distribution, but is only feasible for small problems.
The second method uses a combination-distribution to sample
for the space of possible treatment assignments and applies
the test statistic the sampled randomizations. While the
resulting distribution is not exact, it is tractable for
larger problems.
The algorithm automatically chooses between the two methods
by computing the number of possible randomizations and
comparing it to *test-statistic-iterations*. If the exact
distribution requires fewer than *test-statistic-iterations*
the enumeration method is used. Otherwise, it draws
*test-statistic-iterations* total samples for the simulated
method.
By default, the algorithm uses parallel computation. This is
controlled by the function *test-statistic-map*, which is
bound to pmap by default. Bind it to map to use a single
thread for computation.
Arguments:
test-statistic A function that takes two vectors and summarizes
the difference between them
n The number of total units in the pool
k The number of treatment units per sample
See also:
combination-distribution, pdf, cdf, draw, support
References:
http://en.wikipedia.org/wiki/Sampling_distribution http://en.wikipedia.org/wiki/Exact_test http://en.wikipedia.org/wiki/Randomization_test http://en.wikipedia.org/wiki/Lady_tasting_tea Examples:
Comments top
No comments for test-statistic-distribution. Log in to add a comment.