propensity_match: Performs propensity score matching.

Description Usage Arguments Value Examples

View source: R/propensity.R

Description

Performs propensity score matching.

Usage

1
2
3
4
5
6
7
8
propensity_match(
  data,
  w,
  p,
  max_distance = 1,
  replacement = TRUE,
  type = "default"
)

Arguments

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.

Value

a dataframe with two columns, the first corresponding to indices for treated observations, and the second corresponding to indices for matched control observations.

Examples

1
2
3
4
data(lalonde)

p <- propensity_score(lalonde, y = "re78", w = "treat")
propensity_match(lalonde, w = "treat", p = p, max_distance = 1)

jackcollison/causality documentation built on Dec. 20, 2021, 8:05 p.m.