Description Usage Arguments Value Examples
A lot of times observations may have duplicates within a same group. For example, binary covariates have a high probability to be repeated. Internally, blop controls for this and when performing the matching takes into account duplicates so that the weights are equally distributed accross duplicates.
1 2 3 4 5 6 7 | group_duplicates(x, Treat = NULL, ids = NULL)
## S3 method for class 'data.frame'
group_duplicates(x, Treat = NULL, ids = NULL)
## S3 method for class 'matrix'
group_duplicates(x, Treat = NULL, ids = NULL)
|
x |
Either a Numeric matrix or a data-frame. |
Treat |
Integer vector of size n. Group indicator. Can be either -1 (no group), 0 (control) or 1 (treatment). |
ids |
Integer vector with ids to be mapped to the set (internal use). |
A nested list with the following elements:
groups
Lists of integers indicating the ids (row position) of
the group members.
selected
Integer vector of length length(groups)
with a proposed
set of ids to be used for the matching.
If Treat
is passed, then it will return a list of length 3 with nested
lists as described above.
1 2 3 | data(nsw)
group_duplicates(nsw[1:10, c("black", "hispanic", "nodegree", "re75")])
group_duplicates(nsw[1:10, c("black", "hispanic", "nodegree", "re75")], Treat = nsw$treat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.