Description Usage Arguments Details Value Examples
pickMarble
simulates the drawing (with replacement) of a marble from
a collection of marbles characterized by a tag indicating to which bag each
marble belonged to originally, its size and color. The marbles are either
poured together in a box, or gathered by similar features in pouches of
different textures. Six approaches to the gathering of marbles are
available, one for each ordering of the features.
1 2 | pickMarble(iter = 10, gather.by = NULL, do.bag = NULL, do.size = NULL,
do.color = NULL)
|
iter |
integer, the number of independent iterations (defaults to 10). |
gather.by |
either NULL for no gathering (default value) or a character, one among "bsc", "bcs", "sbc", "scb", "cbs", "csb", to specify how the marbles were gathered. The ordering of the first letters of the words bag, size and color determines in which order the marbles are gathered. |
do.bag |
either NULL for no intervention on bag (default value) or a character to specify the nature of the intervention, either "one" or "two". |
do.size |
either NULL for no intervention on size (default value) or a character to specify the nature of the intervention, either "large" or "small". |
do.color |
either NULL for no intervention on color (default value) or a character to specify the nature of the intervention, either "red" or "blue". |
pickMarble
simulates the drawing (with replacement) of a
marble from a collection of marbles characterized a tag indicating to
which bag they originate from (bag one or bag two), their
size (large or small) and color (red or
blue). The marbles are either poured together in a box, or
gathered by similar features in pouches of different textures. Six
approaches to the gathering are available, one for each ordering of the
features of a marble. For a generic approach to gathering described by
"xyz" with distinct "x", "y", "z" taken in \{"b", "s", "c"\},
the gathering consists in
gathering by bag if x=b, size if x=s, color if x=c,
gathering by bag if y=b, size if y=s, color if y=c.
Introduced by J. G. Bennett to discuss Simpson's paradox, the distribution of marbles is the following:
bag | one | bag | two | the | box | |||
red | blue | red | blue | red | blue | |||
large | 12 | 18 | 8 | 2 | 20 | 20 | ||
small | 3 | 7 | 21 | 9 | 24 | 16 |
where the box contains all the marbles when they are poured together. When the marbles are not poured together, the probabilities to sample the outer pouches on the one hand and conditional probabilities to sample the inner pouches within an outer pouch on the other hand reflect the overall distribution of marbles and are thus possibly unequal. This may represent an unconscious ordering of textures by preference.
A data.frame with iter rows and 3 columns describing the results of the iter independent samplings.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## draw independently 10 marbles from the box where all marbles have been
## poured together
pickMarble(10)
## draw independently 10 marbles when the approach to
## gathering is given by (1) bag, (2) size, (3) color
pickMarble(10, gather.by = "bsc")
## draw independently 10 marbles from bag one when the
## approach to gathering is given by (1) bag, (2) size,
## (3) color
pickMarble(10, gather.by = "bsc", do.bag = "one")
## draw independently 10 large marbles when the approach
## to gathering is given by (1) bag, (2) size, (3) color
pickMarble(10, gather.by = "bsc", do.size = "large")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.