First release of sdid, which builds on synthdid 0.0.9 by Arkhangelsky, Athey, Hirshberg, Imbens, and Wager. BSD 3-Clause License.
sdid() estimates the ATT, following the Stata command sdid. It takes a long format panel, detects staggered adoption, and fits SDiD, SC, or DiD via method ("sdid", "sc", "did").vce: "bootstrap", "jackknife", "placebo", or "noinference". reps defaults to 50. seed makes replications reproducible without changing the session's RNG state.sdid() prints a header, replication progress, and the ATT with its z statistic, p-value, and confidence interval at level. graph = FALSE skips the plot; quietly = TRUE prints nothing.alternative sets a two-sided (default) or one-sided ("greater", "less") test. One-sided tests give one-sided p-values and intervals, labeled P>z or P<z.print, summary, coef, vcov, confint, nobs, weights, and plot methods, documented in ?sdid and ?sdid-methods.tidy() and glance() methods work with modelsummary and broom. tidy(cohorts = TRUE) adds a row per adoption period, and labels names the rows.sdid().cohorts.covariates takes time-varying covariates. covariate.method is "optimized" (default; coefficients estimated jointly with the weights) or "projected" (two-way fixed effects regression on untreated observations; Kranz 2022).projection.sample sets the projected regression's sample: never-treated units (default, as in Stata) or all untreated observations.standardize = TRUE), warns on reaching max.iter (class sdid_max_iter_warning), and errors if coefficients diverge.beta is named by covariate. With the optimized method and staggered adoption, it is a covariate × cohort matrix.sdid_plot(), sdid_units_plot(), sdid_placebo(), and sdid_placebo_plot() replace their synthdid_* versions and take sdid() results. Staggered designs get one panel per cohort.sdid_plot() styles: "minimal" (default) and "effects", which adds a simplified DiD diagram.x.breaks and y.breaks set ticks manually.sdid_plot() and sdid_units_plot() accept a named list of single-cohort results, one panel each. facet and facet.vertical are removed; lambda.comparable defaults to FALSE.sdid_units_plot() is redesigned: type = "scatter" (default) plots each control's weight against its own estimate; type = "bars" shows weighted controls ordered by weight. New arguments: label.units, cohort, weighted.only. Uses ggrepel when installed. negligible.threshold, negligible.alpha, and units are removed.sdid_placebo() and sdid_placebo_plot() gain placebo.time to choose when the in-time placebo starts. Single-adoption designs only.sdid.num.threads or num.threads.sdid.solver and sdid.gram.max.mb.NaN weights.omega.intercept argument.sparsify settings, not the defaults.synthdid_estimate(), sc_estimate(), did_estimate(), panel.matrices(), synthdid_se(), synthdid_effect_curve(), and timesteps() are no longer exported.synthdid_rmse_plot(), synthdid_controls(), simulate_dgp(), estimate_dgp(), and lindsey_density_estimate() are removed.estimates and from sdid_placebo()) have class sdid_estimate and print on one line without computing an SE. Their summary() and format() methods are removed, and the methods dependency is dropped.sdid. prefix. The verbosity option is removed; use quietly.