group_duplicates: Identify duplicated rows and group them keeping track of...

Description Usage Arguments Value Examples

View source: R/duplicates.R

Description

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.

Usage

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)

Arguments

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).

Value

A nested list with the following elements:

If Treat is passed, then it will return a list of length 3 with nested lists as described above.

Examples

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)

gvegayon/blopmatch documentation built on Dec. 2, 2019, 6:27 a.m.