The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
run_es(estimator = "cs"): Callaway-Sant’Anna (2021)
estimator. Computes group-time ATT(g,t) via the unconditional DiD
estimand (eq. 2.8) with never-treated or not-yet-treated control groups.
Supports control_group = "nevertreated" (default) or
"notyettreated". The full ATT(g,t) matrix is stored as the
att_gt attribute of the result.run_es(estimator = "sa"): Sun-Abraham (2021)
interaction-weighted estimator. Aggregates cohort x relative-time
interactions by cohort share weights. Numerically identical to
fixest::sunab() to machine precision.run_es(estimator = "bjs"): Borusyak, Jaravel &
Spiess (2024) imputation estimator. Fits TWFE on untreated observations
only, imputes counterfactuals for treated observations, and averages
treatment effects by horizon. Handles singleton unit fixed effects via
closed-form recovery.run_es(bootstrap = TRUE): Multiplier bootstrap for
simultaneous confidence bands (Algorithm 1, Callaway & Sant’Anna
2021). Adds conf_low_sim / conf_high_sim
columns to the result and stores the (g,t)-level bootstrap object as
attr(result, "bootstrap"). Controlled by B
(draws, default 999) and boot_seed arguments. Available
only when estimator = "cs".plot_att_gt(): Visualize the full ATT(g,t) matrix from
CS results as a heatmap (type = "heatmap") or
cohort-faceted time series (type = "facet"). Requires
estimator = "cs" result as input. When
bootstrap = TRUE was used, the heatmap adds a subtitle with
the simultaneous critical value and open-diamond markers for
simultaneously significant cells; the facet adds a lighter simultaneous
CI ribbon.plot_es(show_simultaneous = TRUE): Overlays the
simultaneous bootstrap CI (lighter band, alpha 0.15) alongside the
pointwise CI (alpha 0.3) with a two-entry legend. Errors informatively
if bootstrap was not run.plot_es_interactive(show_simultaneous = TRUE): Adds a
second lighter ribbon trace for the simultaneous CI and extends the
hover tooltip with simultaneous CI bounds.run_es() bootstrap path: base::merge()
silently dropped all custom attributes (e.g. att_gt,
N_units, lead_range) from the
es_result object. Attributes are now saved and restored
around the merge, so plot_att_gt() works correctly after a
bootstrap = TRUE run.did and didimputation to Suggests
for numerical agreement tests against reference implementations.cluster in
run_es() did not produce clustered standard errorsvcov = "HC1" was being applied after model
estimation, overriding the clustered SE from feols()cluster is specified and vcov is
left at its default ("HC1"), the model’s clustered standard
errors are usedcluster is set,
pass vcov = "HC1" together with
cluster = NULLclassic and sunab
methodsrun_es() results
and equivalent direct fixest::feols() callslead_range and lag_range
parameters were ignored, causing all estimated coefficients to be
returned regardless of specified ranges[-lead_range, lag_range]classic and sunab
methods'sunab' is not an exported object from 'namespace:fixest'
error when using method = "sunab"sunab function from fixest packagebaseline parameter (default: -1) now applies to
both classic and sunab methodsestimate = 0,
std.error = 0, and is_baseline = TRUEbaseline is used
for both methods"-9", "0", "3")"year::-9") for better readability%>%) with base R pipe
(|>) throughout the package|>)relative_time was NA for all
coefficients except baseline when using non-staggered treatment
timingfixest::i() now correctly
corresponds to the baseline parametertiming = 5 and
baseline = -1, period 4 (not period 5) is now used as the
referenceplot_es_interactive() for creating
interactive event study plotses_result objects from
run_es()sapply()
approach for significant performance gainsplotly package (optional,
suggested dependency)run_es() and plot_es() now support returning
and visualizing multiple confidence levels (e.g., 90%, 95%, 99%) in a
single analysis.plot_es() adds ci_level selection, more theme
options (theme_style), and improved ribbon/error bar
display.NA in
timing):
timing are now retained as
never-treated controls (staggered only).weights input:
~ popwt), bare names
(popwt), or character strings ("popwt").cluster input handling:
unit is supplied without
time_transform = TRUE.staggered = TRUE option allows timing
to vary by unit (e.g., treatment year column).NA in timing are safely
retained as untreated.weights argument (e.g., ~ popwt)
to run weighted regressions.lead_range or lag_range is
NULL, the function computes the maximum feasible range from
the data.unit is specified without
time_transform = TRUE.plot_es():
ggplot2::scale_x_continuous() with
integer breaks spaced by 1, aligned to the relative_time
range.Date:
time_transform = TRUE to automatically
convert the time variable into a unit-level sequential
index (1, 2, 3, …) for event study estimation.unit argument to specify the panel unit
identifier required when time_transform = TRUE.Date class in the time
variable and converts it automatically to numeric if
time_transform = FALSE.unit is missing or time is of unsupported
type.@examples in the function documentation to
include Date-based examples.time_transform
usage.README.md to describe irregular time handling
and demonstrate new use cases.time_transform,
unit handling, and Date conversion edge
cases.lead1, lag0) already exist in the dataset to
prevent accidental overwriting.lead_range, lag_range, and
interval) has fewer than 10 rows, helping users identify
overly narrow estimation windows.treatment variable: it is now
coerced to logical using as.logical() to support both
binary numeric (0/1) and logical (TRUE/FALSE)
formats.fe argument
(e.g., ~ id + year) were combined using
model_formula | fe_text, which caused evaluation errors
during tests.as.formula() to ensure compatibility with
fixest::feols().run_es():
~ x1 + x2).fe and cluster arguments must now be
specified using a one-sided formula (e.g.,
~ id + year).cluster is still
accepted.fe_var argument now supports additive notation
(firm_id + year) instead of character vectors.plot_es() efficiency and documentation.fe notation.This version introduced several enhancements and refinements to improve usability and maintainability.
outcome_var, treated_var, and
time_var are now processed using
rlang::ensym() for better robustness.fe_var and cluster_var handling improved
for more reliable column referencing.plot_es() function:
relative_time, estimate, etc.) are
present.baseline handling could lead
to incorrect sorting of lead/lag terms.This is the first release of the fixes package,
providing tools for estimating and visualizing event study models with
fixed effects.
run_es(): A function to estimate event
study models using fixest::feols(), generating lead and lag
variables automatically.
fe_var as
character vector).cluster_var.interval argument.plot_es(): A function to visualize
event study results with ggplot2.
type = "ribbon", default).type = "errorbar").fixest::feols().interval
argument).c("firm_id", "year"))."state_id").fe_var.These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.