cb.align.kway_match {causalBatch} | R Documentation |
K-Way matching
Description
A function for performing k-way matching using the matchIt package. Looks for samples which have corresponding matches across all other treatment levels.
Usage
cb.align.kway_match(
Ts,
Xs,
match.form,
reference = NULL,
match.args = list(method = "nearest", exact = NULL, replace = FALSE, caliper = 0.1),
retain.ratio = 0.05
)
Arguments
Ts |
|
Xs |
|
match.form |
A formula of columns from |
reference |
the name of the reference/control batch, against which to match. Defaults to |
match.args |
A named list arguments for the |
retain.ratio |
If the number of samples retained is less than |
Value
an [m]
vector consisting of the sample ids of the n
original samples that were retained after matching.
Details
For more details see the help vignette:
vignette("causal_balancing", package = "causalBatch")
Author(s)
Eric W. Bridgeford
References
Eric W. Bridgeford, et al. "A Causal Perspective for Batch Effects: When is no answer better than a wrong answer?" Biorxiv (2024).
Daniel E. Ho, et al. "MatchIt: Nonparametric Preprocessing for Parametric Causal Inference" JSS (2011).
Examples
library(causalBatch)
sim <- cb.sims.sim_linear(a=-1, n=100, err=1/8, unbalancedness=1.5)
cb.align.kway_match(sim$Ts, data.frame(Covar=sim$Xs), "Covar")