Description Usage Arguments Value Examples
Performs propensity score matching.
1 2 3 4 5 6 7 8 | propensity_match(
data,
w,
p,
max_distance = 1,
replacement = TRUE,
type = "default"
)
|
data |
a dataframe object containing the variables and values. |
w |
a character vector describing the treatment variable. |
p |
a numeric vector of propensity scores. |
max_distance |
the maximum distance between propensity scores to form a match. Default is 1. |
replacement |
logical; if FALSE then treated and control units are matched without replacement of control units (a control unit can only be matched once). |
type |
a string specifying which type of propensity score matching to perform. Choices are 'default', and 'linear'. Linear takes the logit of the propensity score before taking differences. If not specified as linear, the default score matching will be used, which subtracts the scores as they are. |
a dataframe with two columns, the first corresponding to indices for treated observations, and the second corresponding to indices for matched control observations.
1 2 3 4 | data(lalonde)
p <- propensity_score(lalonde, y = "re78", w = "treat")
propensity_match(lalonde, w = "treat", p = p, max_distance = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.