Learn R Programming

PanelMatch (version 3.1.5)

compare_treated_observations: Compare pre-treatment covariate trajectories of matched and unmatched treated observations

Description

For a fitted PanelMatch object, identifies treated unit-times that did and did not receive at least one matched control unit, and compares their average pre-treatment covariate values over the matching lag window. This serves as a diagnostic for whether treated observations that successfully matched are systematically different from those that did not, which has implications for the generalizability of the estimated treatment effect to the full set of treated observations.

Usage

compare_treated_observations(pm.object, panel.data, covariates)

Value

A plain list (no class) with the following components:

n_has_match

Number of treated unit-times with at least one matched control.

n_no_match

Number of treated unit-times with no matched control.

pct_no_match

Percentage of all treated unit-times that had no matched control (n_no_match divided by the total number of treated unit-times).

n_no_viable

Number of unmatched treated unit-times whose treatment cohort contains no matched treated units at all, i.e. no viable basis for comparison.

pct_no_viable

Percentage of unmatched treated unit-times (n_no_match) that had no viable comparison cohort (n_no_viable divided by n_no_match).

covariate_diffs

A data.frame with one row per covariate, giving the unweighted average difference (matched minus unmatched) in pre-treatment covariate values across treatment cohorts (mean_diff), and the same difference weighted by cohort size (weighted_mean_diff). NULL if no cohort contained both matched and unmatched treated units.

Arguments

pm.object

A PanelMatch object, as returned by PanelMatch.

panel.data

A PanelData object corresponding to pm.object, containing the unit identifier, time identifier, and all variables named in covariates. This should be the same PanelData object passed to PanelMatch().

covariates

A character vector of covariate names (columns in panel.data) to compare between matched and unmatched treated observations.

Details

For each covariate, the comparison is computed within each treatment cohort (i.e., treated unit-times sharing the same treatment time) that contains both matched and unmatched treated units. Within a cohort, the covariate is averaged over the full lag window for matched units and, separately, for unmatched units; the difference between these two averages is computed; and the resulting per-cohort differences are then aggregated across all valid cohorts two ways: an unweighted average that gives equal weight to each cohort regardless of size, and a weighted average that weights each cohort by its number of treated units.

This function returns a plain list (no class) -- see diagnostic_summary for a formatted report built on top of it.

Examples

Run this code
if (FALSE) {
PM.results <- PanelMatch(panel.data = dem.sub.panel, lag = 4,
                          refinement.method = "ps.match",
                          match.missing = TRUE,
                          covs.formula = ~ tradewb,
                          size.match = 5, qoi = "att",
                          lead = 0:4,
                          forbid.treatment.reversal = FALSE)

result <- compare_treated_observations(PM.results, dem.sub.panel,
                           covariates = c("tradewb", "y"))
str(result)
}

Run the code above in your browser using DataLab