MatchBalance: Calculates balance statistics for matching.

View source: R/MatchBalance.R

MatchBalanceR Documentation

Calculates balance statistics for matching.

Description

Calculates balance statistics for matching.

Usage

MatchBalance(
  df,
  formu,
  formu.Y,
  exact.covs,
  index.treated,
  index.control,
  tolerance = 0.25,
  n.levels = 2,
  ...
)

Arguments

df

data frame with data to match.

formu

the formula used to estimate propensity scores using logistic regression.

formu.Y

(optional) the formula used to estimate a multiple regression model with covariates. Used to estimate covariate importance.

exact.covs

character vector of covariates to match exactly on. For quantitative variables with more than two unique values, matches will be made within quintiles.

index.treated

a vector of integers corresponding to the rows in df for the matched treated units. That is, index.treated[i] is matched to index.control[i].

index.control

a vector of integers corresponding to the rows in df for the matched control units. That is, index.treated[i] is matched to index.control[i].

tolerance

the maximum standard deviation the difference between matches on a quantitative covariate can be to be considered matched.

n.levels

maximum number of unique values in a covariate to attempt to match exactly. If the number of unique values is greater than n.levels, then the covariate will be cut using quantiles and exact matches will be estimated within each quantile.

...

other parameters passed to Match.

Value

An object of class MatchBalance with the following elements:

ps.out

Results from the logistic regression model for treatment.

Y.out

Results from the multiple regression model for Y.

covariate.matched

a named numeric vector containing the percent of observations with "perfect" match for each covariate.

covariate.balance

a named numeric vector containing the percent of covariates with "perfect" match for each observation.

covariate.importance

a data frame with covariate importance. Covariate importance is estimated using the sum of the absolute t-statistic from both glm calls for treatment and outcome.

index.treated

vector containing observation row number from original data frame for treated observations.

index.control

vector containing observatino row number from original data frame for control observations.


jbryer/psa documentation built on Nov. 17, 2023, 8:21 a.m.