propensityscore_multimatch: Propensity Score Matching for Multiple Control Groups

View source: R/propensityscore_multimatch.R

propensityscore_multimatchR Documentation

Propensity Score Matching for Multiple Control Groups

Description

This function performs propensity score matching for multiple control groups against a single treatment group using the MatchIt package.

Usage

propensityscore_multimatch(df, treatmentID, controlID, treatmentvar, match_var)

Arguments

df

A data frame containing the necessary variables for propensity score matching.

treatmentID

A character indicating the ID for the treatment group.

controlID

A vector of characters indicating the IDs for the control groups.

treatmentvar

A character string specifying the column name in df which identifies the treatment or control IDs.

match_var

A character vector specifying the column names in df used for matching in the propensity score model.

Value

A data frame containing the matched data.

Examples

## Not run: 
matched_data <- propensityscore_multimatch(
  df = your_data_frame,
  treatmentID = "treatID",
  controlID = c("controlID1", "controlID2"),
  treatmentvar = "treatment_column",
  group_var = "group_column",
  match_var = c("var1", "var2")
)

## End(Not run)


chris-hsiung/bears01 documentation built on April 9, 2024, 2:01 a.m.