Skip to contents

Thin wrapper around Matching::GenMatch + Matching::Match that returns a morie_match_result. Uses a genetic algorithm to find covariate weights for Mahalanobis distance matching that maximise covariate balance.

Usage

morie_matching_genetic(
  data,
  treatment,
  covariates,
  n_neighbors = 1L,
  pop_size = 50L,
  n_generations = 20L,
  seed = 42L
)

Arguments

data

Data frame.

treatment

Binary treatment column name.

covariates

Character vector of covariates.

n_neighbors

Number of matches per treated unit (M in Matching).

pop_size

Genetic-algorithm population size (default 50).

n_generations

Number of GA generations.

seed

Random seed.

Value

A list of class morie_match_result.

References

Diamond, A., & Sekhon, J. S. (2013). Genetic matching for estimating causal effects. Review of Economics and Statistics, 95(3), 932–945.

Examples

if (FALSE) { # \dontrun{
morie_matching_genetic(df, "d", c("x1", "x2"),
                       pop_size = 50, n_generations = 20)
} # }