| Title: | What the Package Does (One Line, Title Case) |
|---|---|
| Description: | What the package does (one paragraph). |
| Authors: | First Last [aut, cre] |
| Maintainer: | First Last <[email protected]> |
| License: | `use_mit_license()`, `use_gpl3_license()` or friends to pick a license |
| Version: | 0.0.0.9000 |
| Built: | 2026-10-22 10:09:29 UTC |
| Source: | https://github.com/avkazakovgit/flexmatch |
Assess Matching Quality (Academic Standard)
assess_match_quality( match_res, stack_candidates, dt, match_vars, id_col, time_col )assess_match_quality( match_res, stack_candidates, dt, match_vars, id_col, time_col )
Expand Matched Cross-Section to Full Stacks
expand_matched_stacks( dt, matched_data, id_col, time_col, k_pre, k_post, match_by = -1 )expand_matched_stacks( dt, matched_data, id_col, time_col, k_pre, k_post, match_by = -1 )
Orchestrates the entire Stacked DiD pipeline: Scans candidates, Matches them, Expands to stacks, Assesses Quality, and Visualizes Events.
flexmatch( dt, id_col, time_col, event_col, k_pre, k_post, k_freeze, match_vars, match_by = -1, assess_quality = TRUE, plot_events = TRUE, verbose = TRUE, ... )flexmatch( dt, id_col, time_col, event_col, k_pre, k_post, k_freeze, match_vars, match_by = -1, assess_quality = TRUE, plot_events = TRUE, verbose = TRUE, ... )
dt |
The original panel data (data.table). |
id_col |
Character. Name of ID column. |
time_col |
Character. Name of time column (integer/numeric). |
event_col |
Character. Name of event dummy (1 = start of treatment). |
k_pre |
Integer. Required pre-periods. |
k_post |
Integer. Required post-periods. |
k_freeze |
Integer. Freeze/Cool-down periods after k_post. |
match_vars |
Character vector. Covariates to match on. |
match_by |
Integer. Relative period for matching (default -1). |
assess_quality |
Logical. If TRUE, runs balance checks. Default TRUE. |
plot_events |
Logical. If TRUE, runs the event dynamics plot. Default TRUE. |
verbose |
Logical. If TRUE, prints progress. Default TRUE. |
... |
Additional arguments passed directly to |
A list containing:
final_expanded_data: The analysis-ready stacked dataset.
matched_cross_section: The matched pairs at time t.
stack_candidates: The full pool of eligible units.
quality_stats: List with Balance Table and Density Plots.
event_plot: The Lasagna plot object.
match_object: The raw MatchIt model.
Identifies valid stack candidates by enforcing strict data continuity and clean history/future constraints.
label_candidates( dt, id_col, time_col, event_col, k_pre, k_post, k_freeze, match_by = -1 )label_candidates( dt, id_col, time_col, event_col, k_pre, k_post, k_freeze, match_by = -1 )
Performs exact cohort matching + 1-to-K matching using MatchIt.
match_candidates(dt, stack_candidates, id_col, time_col, match_vars, ...)match_candidates(dt, stack_candidates, id_col, time_col, match_vars, ...)
Plot Event Dynamics (Lasagna Plot with Overlay)
plot_event_dynamics( dt, dt_matched = NULL, id_col, time_col, event_col, n_bins = 4L, sort_by_intensity = FALSE )plot_event_dynamics( dt, dt_matched = NULL, id_col, time_col, event_col, n_bins = 4L, sort_by_intensity = FALSE )