PanelMatch3.0.0 package

Matching Methods for Causal Inference with Time-Series Cross-Sectional Data

build_maha_mats

build_maha_mats Builds the matrices that we will then use to calculate...

build_ps_data

build_ps_data

calculate_estimates

calculate_estimates

calculate_placebo_estimates

calculate_placebo_estimates

calculate_point_estimates

calculate_point_estimates Helper function that calculates the point es...

check_time_data

check_time_data

clean_leads

clean_leads Function to check the lead windows in treated and control ...

DisplayTreatment

Visualize the treatment distribution across units and time in a panel ...

distances.matched.set

Extract the distances of matched control units

distances

Get distances See distances.matched.set method

enforce_lead_restrictions

enforce_lead_restrictions check treatment and control units for treatm...

equality_four_placebo

equality_four_placebo

equality_four

equality_four Small helper function implementing estimation function f...

expand_treated_ts

expand_treated_ts Builds a list that contains all times in a lag windo...

extract_differences

extract_differences This function calculates the differences from t-1 ...

extract.PanelMatch

Extract matched.set objects from PanelMatch results

extract

Extract matched.set objects from PanelMatch results

find_ps

find_ps

findBinaryTreated

findBinaryTreated

get_covariate_balance

Calculate covariate balance measures for refined and unrefined matched...

get_set_treatment_effects

Calculate matched set level treatment effects

get_unrefined_balance.PanelBalance

Extract unrefined covariate balance results, if they exist

get_unrefined_balance

Extract just the unrefined covariate balance results, if they exist

get.matchedsets

get.matchedsets

getDits

getDits returns a vector of Dit values, as defined in the paper. They ...

getWits

getWits returns a vector of Wits, as defined in the paper (equation 25...

handle_bootstrap_parallel

handle_bootstrap_parallel

handle_bootstrap_placebo_parallel

handle_bootstrap_placebo_parallel

handle_bootstrap_placebo

handle_bootstrap_placebo

handle_bootstrap

handle_bootstrap

handle_conditional_se

handle_conditional_se Calculates conditional standard errors analytica...

handle_mahalanobis_calculations

handle_mahalanobis_calculations Returns a matched.set object with weig...

handle_missing_data

handle_missing_data

handle_moderating_variable

handle_moderating_variable

handle_ps_match

handle_ps_match Returns a matched.set object with weights for control ...

handle_ps_weighted

handle_ps_weighted

handle_unconditional_se

handle_conditional_se Calculates conditional standard errors analytica...

identifyDirectionalChanges

identifyDirectionalChanges Identifies changes in treatment variable fo...

lwd_refinement

lwd_refinement master function that performs refinement with listwise ...

lwd_units

lwd_units helper function that actually subsets sets down to contain u...

matched_set

A constructor for the matched.set class.

merge_formula

merge_formula

PanelData

Pre-process and balance panel data

PanelEstimate

Estimate a causal quantity of interest

PanelMatch-package

Matching Methods for Causal Inference with Time-Series Cross-Sectional...

PanelMatch

Create and refine sets of matched treated and control observations

parse_and_prep

parse_and_prep

pcs

Prepare Control Units pcs and pts create data frames with the time/id ...

perform_refinement

perform_refinement Performs refinement of matched sets, ultimately ret...

perunitSum_Dit

perunitSum_Dit Similar to perunitSum, this is a low level helper funct...

perunitSum

perunitSum This is a low level function that is used to calculate a va...

placebo_test

Conduct a placebo test

plot_matched_set

Helper function for plotting the distribution of matched set sizes

plot.matched.set

Plot the distribution of control unit weights

plot.PanelBalance

Plot covariate balance results Create figures displaying covariate bal...

plot.PanelData

Create basic plots of PanelData objects

plot.PanelEstimate

Plot point estimates and standard errors from a PanelEstimate calculat...

plot.PanelMatch

Plot the distribution of the sizes of matched sets.

prepare_data

prepare_data The calculation of point estimates and standard errors fi...

print.matched.set

Print matched.set objects.

print.PanelBalance

Print basic information about PanelBalance objects

print.PanelData

Print PanelData objects and basic metadata

print.PanelEstimate

Print point estimates and standard errors

print.PanelMatch

Print PanelMatch objects.

set_lwd_refinement

set_lwd_refinement Performs the set-level operations for refinement wi...

sub-.matched.set

Subset matched.set object

sub-.PanelBalance

Subset PanelBalance objects

summary.matched.set

Summarize information about a matched.set object and the matched sets ...

summary.PanelBalance

Summarize covariate balance over time

summary.PanelData

Summarize the number of unique units and time periods in a PanelData o...

summary.PanelEstimate

Get summaries of PanelEstimate objects and calculations

summary.PanelMatch

Summarize information about a PanelMatch object and the matched sets c...

weights.matched.set

Extract the weights of matched control units

weights

Get weights of matched control units See weights.matched.set method

Implements a set of methodological tools that enable researchers to apply matching methods to time-series cross-sectional data. Imai, Kim, and Wang (2023) <http://web.mit.edu/insong/www/pdf/tscs.pdf> proposes a nonparametric generalization of the difference-in-differences estimator, which does not rely on the linearity assumption as often done in practice. Researchers first select a method of matching each treated observation for a given unit in a particular time period with control observations from other units in the same time period that have a similar treatment and covariate history. These methods include standard matching methods based on propensity score and Mahalanobis distance, as well as weighting methods. Once matching and refinement is done, treatment effects can be estimated with standard errors. The package also offers diagnostics for researchers to assess the quality of their results.

  • Maintainer: In Song Kim
  • License: GPL (>= 3)
  • Last published: 2025-03-03