Skip to contents

Greedy 1:k nearest-neighbour matching on the logit propensity score with the Austin (2011) caliper (0.2 SD of the logit-PS by default), mirroring the python implementation. Returns the ATT from matched-set mean differences with the matched-pairs variance.

Usage

morie_otis_psm(
  df,
  treatment,
  outcome,
  covariates,
  k = 1L,
  caliper = 0.2,
  seed = 123L
)

Arguments

df

Data frame.

treatment, outcome, covariates

Column names.

k

Controls matched per treated unit. Default 1.

caliper

Caliper in SD units of the logit-PS. Default 0.2.

seed

RNG seed (tie-breaking order). Default 123.

Value

An OTIS causal-estimate list (ATT).

Examples

set.seed(1)
n <- 300
x <- rnorm(n)
d <- rbinom(n, 1, plogis(0.8 * x))
y <- 1.2 * d + x + rnorm(n)
morie_otis_psm(data.frame(y, d, x), treatment = "d",
               outcome = "y", covariates = "x")
#> $estimator
#> [1] "PSM-ATT"
#> 
#> $ate
#> [1] 1.341601
#> 
#> $ate_se
#> [1] 0.1624992
#> 
#> $ate_pval
#> [1] 1.505768e-16
#> 
#> $ate_ci95
#> [1] 1.023103 1.660100
#> 
#> $n
#> [1] 300
#> 
#> $n_treated
#> [1] 149
#> 
#> $p_treat
#> [1] 0.4966667
#> 
#> $notes
#> $notes[[1]]
#> [1] "1:1 NN, caliper=0.20 SD(logit-PS)"
#> 
#> $notes[[2]]
#> [1] "105/149 treated matched"
#> 
#> 
#> attr(,"class")
#> [1] "morie_causal_estimate" "list"