| Type: | Package |
| Title: | The Chained Difference-in-Differences |
| Version: | 1.3.0.1 |
| Maintainer: | David Benatia <david.benatia@hec.ca> |
| Description: | Estimates group-time average treatment effects in panels with missing outcomes by the chained difference-in-differences method of Bellégo, Benatia and Dortet-Bernadet (2025) <doi:10.1016/j.jeconom.2024.105783>. The package extends 'did' and retains the att_gt() and aggte() interfaces. Chained estimation combines observed changes within units by the generalized method of moments. It supports inverse probability weighting, outcome regression and doubly robust estimation. Missing outcomes can be handled by observation weighting, imputation of outcome changes, or an augmented combination of both. Users can choose comparison groups and parallel trends assumptions, fit linear cohort-by-date fixed effects, test trends before treatment, and inspect fitted regression models. A separate analysis estimates the effects of starting and stopping a binary treatment under no carryover. Ordinary mode uses the estimators of Callaway and Sant'Anna (2021) <doi:10.1016/j.jeconom.2020.12.001>. |
| License: | GPL-3 |
| URL: | https://github.com/dvbn/cdid |
| BugReports: | https://github.com/dvbn/cdid/issues |
| Depends: | R (≥ 4.1.0) |
| Imports: | did (≥ 2.5.1), DRDID (≥ 1.4.0), parallel, rlang (≥ 1.1.0) |
| Suggests: | testthat (≥ 3.0.0), codetools, digest, ggplot2, knitr, rmarkdown, generics, jsonlite, waldo, withr |
| VignetteBuilder: | knitr |
| Config/testthat/edition: | 3 |
| Encoding: | UTF-8 |
| NeedsCompilation: | yes |
| Author: | David Benatia [cre, aut], Christophe Bellégo [aut], Joel Cuerrier [aut], Vincent Dortet-Bernadet [aut] |
| Packaged: | 2026-11-17 01:36:21 UTC; runner |
| Repository: | CRAN |
| Date/Publication: | 2026-11-17 08:30:36 UTC |
cdid: The Chained Difference-in-Differences
Description
Estimate difference-in-differences effects with panels in which some outcomes
are missing. Chained estimation combines changes measured within units
across the dates when they are observed. Use mode = "ordinary" for
did's estimator or for repeated cross sections.
Details
Use gname to estimate effects by first-treatment cohort and date
when treatment is absorbing. Use dname for effects at entry and exit
when a binary treatment can change and past treatment has no carryover.
Choose the treatment adjustment with est_method. If the units
observed at both dates represent their cohort with respect to mean changes
only after conditioning on covariates, use
selection = "conditional_mtar". Choose observation weighting,
imputation of actual changes or their augmented combination with
selection_est_method.
-
att_gt()fits the model from a long data frame and, for cohort models, an optional study-unit table. -
aggte()summarizes cohort effects. A switching fit already contains the switcher-weighted estimate infit$aggregate. -
chain_report()shows which comparisons identify cohort effects and how they are weighted. -
nuisance_models()displays fitted equations and coefficient tables when requested during estimation. -
conditional_did_pretest()tests pre-treatment trends conditional on the model covariates. -
tidy(),glance()andggdid()return tables, summaries and plots.
Open vignette("cdid", package = "cdid") for a hands-on introduction.
The user guide
covers preparing data, choosing a model and inspecting results.
Use citation("cdid") for references.
References
Bellego, C., Benatia, D. and Dortet-Bernadet, V. (2025). The Chained Difference-in-Differences. Journal of Econometrics 248, 105783. doi:10.1016/j.jeconom.2024.105783
Callaway, B. and Sant'Anna, P. H. C. (2021). Difference-in-Differences with Multiple Time Periods. Journal of Econometrics 225(2), 200–230. doi:10.1016/j.jeconom.2020.12.001
de Chaisemartin, C., D'Haultfoeuille, X., Pasquier, F., Sow, D. and
Vazquez-Bare, G. (2026). Difference-in-Differences Estimators for Treatments
Continuously Distributed at Every Period. Working paper, arXiv:2201.06898v7
(revised 2026-07-22). Static binary specialization, used on the dname
route.
See Also
att_gt, aggte, chain_report, conditional_did_pretest, nuisance_models, reexports, vignette("cdid", package = "cdid")
Aggregate group-time average treatment effects
Description
Summarize fitted cohort-date effects into an overall effect, cohort averages,
an event study or calendar-date averages. With a switching model, use the
switcher-weighted estimate already stored in fit$aggregate.
Usage
aggte(
MP,
type = "group",
balance_e = NULL,
min_e = -Inf,
max_e = Inf,
na.rm = FALSE,
bstrap = NULL,
biters = NULL,
cband = NULL,
alp = NULL,
clustervars = NULL
)
Arguments
MP |
An |
type |
Use |
balance_e, min_e, max_e |
Event-time selectors with did's meaning.
Simple and group aggregation use only |
na.rm |
|
bstrap, biters, cband, alp, clustervars |
Inference settings. For
chained results, |
Details
For chained results, aggregation reuses the influence functions and cohort
shares stored by att_gt(). Cohorts are weighted by their population
shares in the study population. For fits with reference-date covariates or
weights that change within a unit, cohorts are weighted by their masses at
the first stored date, and the uncertainty of those shares enters the
standard errors. With fix_weights = "base_period" each cell keeps the
weights of its own cohort's comparisons, so an aggregate is a declared mixture
of cohort effects rather than the effect in one weighted population. See
att_gt for the reference-date rules.
Multiplier draws use your session's random number stream. Calling
set.seed() before aggte() reproduces them. There is no built-in
seed. Draws reuse the worker count requested by the fit's pl and
cores request and give the same results as a serial run.
A result fitted with compute_inffunc = FALSE has no influence
functions. Refit with compute_inffunc = TRUE to obtain summaries.
Value
For ordinary results, the AGGTEobj returned by did::aggte().
Its call element records the delegated call.
For chained results, a cdid_AGGTEobj (inheriting AGGTEobj)
with the overall estimate and its standard error (overall.att,
overall.se), the bin estimates, full-frame influence functions that
include the cohort-share uncertainty, the requested interval type, and the
record of intended, used and excluded cells. Inspect it with
summary(), tidy() (columns label,
available, restricted, n.intended, n.used,
excluded.ids, reason), glance() and
ggdid(). Plots exist for "group", "dynamic" and
"calendar" aggregates. "simple" has no plot.
See Also
att_gt, conditional_did_pretest, tidy, glance, ggdid, vignette("cdid", package = "cdid")
Examples
set.seed(1)
out <- cdid::att_gt(yname = "lemp", tname = "year", idname = "countyreal",
gname = "first.treat", data = did::mpdta,
mode = "ordinary", bstrap = FALSE, cband = FALSE)
cdid::aggte(out, type = "simple")
cdid::aggte(out, type = "group")
Difference-in-differences estimates for panel data
Description
Estimate average treatment effects by cohort and date or, for a binary treatment that can turn on and off, by switching date and direction. For panels, the default method combines changes measured within units across the dates at which they are observed. Ordinary mode uses did.
Usage
att_gt(
yname,
tname,
idname = NULL,
gname,
xformla = NULL,
data,
panel = TRUE,
allow_unbalanced_panel = NULL,
control_group = c("nevertreated", "notyettreated"),
anticipation = 0,
weightsname = NULL,
fix_weights = NULL,
alp = 0.05,
bstrap = TRUE,
cband = TRUE,
biters = 1000,
clustervars = NULL,
est_method = "dr",
base_period = "varying",
faster_mode = TRUE,
print_details = FALSE,
pl = FALSE,
cores = 1,
compute_inffunc = TRUE,
...,
mode = NULL,
frame = NULL,
selection = "none",
selection_model = "pair_logit",
selection_pooling = "separate",
selection_xformla = NULL,
selection_universe = "F",
selection_rho = NULL,
selection_justification = NULL,
selection_est_method = "ipw",
imputation_pooling = "separate",
gmm_weighting = c("optimal", "identity", "within"),
gmm_covariance = "tikhonov",
pt_assumption = c("post", "all", "ctrl"),
pt_start = NULL,
cross_pair = FALSE,
control = NULL,
outcome_pooling = "separate",
dname = NULL,
imputation_scale = "per_period",
switchers = "both",
switch_times = NULL,
missing_reference = "exclude"
)
Arguments
yname |
Name of the numeric outcome column. Use |
tname |
Name of the numeric date column, on the same scale as the treatment dates. |
idname |
Name of the unit identifier column. Required in chained mode. |
gname |
Name of the first-treatment-date column. Use zero for never-treated units. Supply either |
xformla |
One-sided covariate formula, such as |
data |
A data frame in long format. A panel may have at most one row per unit and date. |
panel |
Whether the data follow the same units over time.
Use |
allow_unbalanced_panel |
In ordinary mode, |
control_group |
For cohort models, use never-treated units ( |
anticipation |
Number of periods before adoption in which treatment may affect outcomes. The reference date is the last date before that window. |
weightsname |
Name of a column of positive sampling weights for cohort effects. |
fix_weights |
For weights that vary over time, use |
alp |
Significance level for confidence intervals and bands. |
bstrap |
Whether to use the multiplier bootstrap for inference. |
cband |
Whether to report simultaneous confidence bands when |
biters |
Number of bootstrap draws. |
clustervars |
Names of cluster variables. Chained mode accepts at most one cluster variable in addition to the unit identifier. Clustering affects inference. |
est_method |
Treatment adjustment. Use |
base_period |
Use |
faster_mode |
Passed to did in ordinary mode. |
print_details |
Whether to print information about the progress of the fit. |
pl, cores |
Use |
compute_inffunc |
Set to |
... |
Additional arguments to a custom estimation function. |
mode |
Use |
frame |
For cohort models, an optional study-unit table with one row per unit, matched to
|
selection |
Use |
selection_model |
Observation-probability model. |
selection_pooling |
How observation models share slopes. For cohort
models use |
selection_xformla |
One-sided formula for observation probabilities.
The default uses |
selection_universe |
Sample for the observation model. |
selection_rho |
For |
selection_justification |
Required explanation when fitting on |
selection_est_method |
With |
imputation_pooling |
How regressions of actual changes share slopes.
Uses the same choices as |
gmm_weighting |
How comparisons are combined. |
gmm_covariance |
Use |
pt_assumption |
Parallel trends assumption for cohorts. |
pt_start |
Common calendar date from which to apply the extra restrictions.
Required for |
cross_pair |
With a built-in cohort method, set to |
control |
Named list of advanced settings. Use
|
outcome_pooling |
Use |
dname |
Name of the period-specific treatment indicator, coded 0 or 1. With this argument, effects are estimated at entry or exit under a static treatment model with no carryover. Supply a known treatment status for every unit and study date, including dates with missing outcomes. |
imputation_scale |
For change imputation in a switching model,
|
switchers |
In a switching model, use |
switch_times |
In a switching model, dates at which to estimate effects. The default uses dates with switchers in the requested directions. A requested date and direction with no switchers is reported as unavailable. |
missing_reference |
For chained cohort models with time-varying
covariates, how to handle a missing value required at the reference date.
|
Details
Each observed change uses two outcomes from the same unit. Units with fewer
than two outcomes can still belong to the study population. Keep them in
data or supply their information in frame. Cohort and population
weights then describe the study units you specified. Chaining can connect
different sets of units that supply changes over overlapping dates, subject
to the comparison-group support and parallel trends assumptions.
For time-varying covariates, post-treatment cohort comparisons use covariates
at the cohort's reference date. Comparisons reported before treatment use
covariates from the earlier comparison date. Keep the rows providing these
values even if their outcomes are missing. When sampling weights vary, supply
the required weights at the chosen reference date. For aggte(),
cohort shares use first-date sampling weights.
When a required reference covariate is missing, the default restricts the
affected cohort's comparisons to units with the required covariates at its
reference date. A unit can still contribute to another cohort whose reference
covariates it has. Supply independently known values on the appropriate
unit-date row, using NA for a missing outcome. Covariates that are
constant within a unit are read as usual. If treated units are excluded, the
cohort effect describes the remaining treated units, and aggte()
uses those units to calculate the cohort's first-date weight. Influence
functions retain a row for every original unit. Effects without sufficient
support and pretrend comparisons with missing required inputs are reported as
unavailable. See fit$chained$reference_eligibility for the affected
cohorts, dates and counts. Missing sampling weights at a required reference
date still cause an error. If the observation model is fitted on a subset,
its transport assumptions and any supplied density ratios apply within each
cohort's eligible sample.
The treatment method and the choice of missing-outcome adjustment are separate.
Outcome regression for treatment predicts the untreated change. Change
imputation predicts the actual change within its group. With augmentation,
the package also uses observation probabilities to reweight the residuals of
that imputation. With treatment "dr" and observation "dr", either
model in each pair can be misspecified if the other is correct and the
remaining identifying conditions hold. Extreme probability weights are
bounded. Check overlap and clipping before interpreting a fit with large
weights, since clipping can affect the target and its robustness properties.
A switching model compares entrants with units staying untreated and exiters
with units staying treated. It assumes that past treatment has no effect
beyond current treatment status. Exit effects are reported in the
treated-minus-untreated direction. This route supports all three built-in
treatment methods and missing-outcome adjustments. The cohort-specific trend
and cross-pair options apply to gname models.
The linear fixed-effects specification uses
control = list(preset = "cohort_time_fe"), consecutive positive integer
dates, unit weights, zero anticipation, base_period = "universal" and a
never-treated cohort. Use pt_assumption = "post" for never-treated
controls, or pt_assumption = "all" with pt_start at the first
date for not-yet-treated controls. Any covariates must be time-invariant and
available for all study units. Regression uses within-unit least squares.
IPW and DR use the common conditional untreated path evaluated in each cohort.
Leave outcome_pooling and cross_pair at their defaults.
A custom chained cohort estimator follows the panel IPW interface
f(y1, y0, D, covariates, i.weights, inffunc = TRUE, ...). Return a list
with a scalar ATT and att.inf.func in the supplied row order.
For fitted observation weights, also return log_weight_gradient, the
derivative of the estimate with respect to each log weight, including refits
inside the function. See the
treatment adjustment guide
for the callback requirements.
Value
Ordinary mode returns the MP object from did. Chained
cohort estimation returns a cdid_MP object with cohort-date estimates,
uncertainty and comparison support. The joint pretrend test is reported when
the full set of requested comparisons and its covariance are usable.
Switching models return a cdid_static_att_gt object with effects by date
and direction and a switcher-weighted estimate in $aggregate.
Use summary(), tidy() or ggdid() to inspect
either type of result. Use aggte() to aggregate cohort effects.
References
Bellego, C., Benatia, D. and Dortet-Bernadet, V. (2025). The Chained Difference-in-Differences. Journal of Econometrics 248, 105783. doi:10.1016/j.jeconom.2024.105783
Callaway, B. and Sant'Anna, P. H. C. (2021). Difference-in-Differences with Multiple Time Periods. Journal of Econometrics 225(2), 200–230. doi:10.1016/j.jeconom.2020.12.001
de Chaisemartin, C., D'Haultfoeuille, X., Pasquier, F., Sow, D. and Vazquez-Bare, G. (2026). Difference-in-Differences Estimators for Treatments Continuously Distributed at Every Period. Working paper, arXiv:2201.06898v7 for the static binary treatment model.
See Also
aggte(), chain_report(),
nuisance_models(), conditional_did_pretest(),
vignette("cdid", package = "cdid"),
User guide
Examples
data("mpdta", package = "did")
fit <- att_gt(
yname = "lemp", tname = "year", idname = "countyreal",
gname = "first.treat", data = mpdta, bstrap = FALSE, cband = FALSE
)
summary(fit)
aggte(fit, type = "dynamic")
Inspect the comparisons used in a chained fit
Description
See the date pairs and control groups that identify a cohort-date effect and
the weights used to combine those comparisons. Supply a chained cohort fit
from att_gt().
Usage
chain_report(
object,
cohort = NULL,
time = NULL,
include_pre = FALSE,
tol = 1e-10,
group = NULL,
t = NULL
)
## S3 method for class 'cdid_chain_report'
print(
x,
digits = 4,
show_gmm_weights = FALSE,
max_cells = 30L,
...
)
## S3 method for class 'cdid_chain_report'
as.data.frame(
x,
row.names = NULL,
optional = FALSE,
what = c("summary", "witness", "gmm_weights"),
...
)
Arguments
object |
A |
cohort, group |
Optional numeric vector of treatment cohorts to keep.
Supply at most one of |
time, t |
Optional numeric vector of calendar periods to keep. Supply
at most one of |
include_pre |
Logical scalar ( |
tol |
Nonnegative numeric threshold ( |
x |
A |
digits |
Number of decimal places for printed estimates and weights. |
show_gmm_weights |
Logical. If |
max_cells |
Maximum number of cells printed before truncating. |
row.names, optional |
As in |
what |
Which table to extract: |
... |
Additional arguments (unused). |
Details
A cell identified in one step compares the cohort's reference period with
the target date directly. A cell that needs chaining passes through
intermediate dates, each step using the units observed at both dates of
that step. The "witness" table shows one such path. The
"gmm_weights" table shows how the fit actually combined all retained
moments, which generally involves more comparisons than the single path.
Weights reflect the gmm_weighting choice recorded in the fit.
Value
chain_report() returns an object of class "cdid_chain_report"
with elements summary (one row per cell), chains (a named list
holding the witness and gmm_weights data frames of each cell)
and meta. as.data.frame() returns the requested table as a
data.frame.
See Also
Examples
set.seed(1)
rows <- list()
uid <- 0L
for (g in 2005:2008) {
for (i in 1:20) {
uid <- uid + 1L
a_i <- rnorm(1)
for (tv in max(2002L, g - 3L):2008L) {
rows[[length(rows) + 1L]] <- data.frame(
id = uid, period = tv, G = g, y = a_i + (tv >= g) * 2 + rnorm(1, sd = 0.2)
)
}
}
}
fit <- att_gt(
yname = "y", tname = "period", idname = "id", gname = "G",
data = do.call(rbind, rows),
control_group = "notyettreated", base_period = "universal",
cross_pair = TRUE, pt_assumption = "ctrl", gmm_weighting = "within",
bstrap = FALSE, cband = FALSE
)
cr <- chain_report(fit, cohort = 2005, time = 2007)
print(cr, show_gmm_weights = TRUE)
as.data.frame(cr, what = "gmm_weights")
Test for parallel trends before treatment
Description
Test whether pre-treatment differences in trends have zero mean conditional
on the supplied covariates. Panels use the chained test by default.
Use mode = "ordinary" or repeated cross sections to use the test
from did. The default treatment adjustment is "ipw".
Usage
conditional_did_pretest(
yname,
tname,
idname = NULL,
gname,
xformla = NULL,
data,
panel = TRUE,
allow_unbalanced_panel = NULL,
control_group = c("nevertreated", "notyettreated"),
weightsname = NULL,
alp = 0.05,
bstrap = TRUE,
cband = TRUE,
biters = 1000,
clustervars = NULL,
est_method = "ipw",
print_details = FALSE,
pl = FALSE,
cores = 1,
anticipation = 0,
base_period = "varying",
fix_weights = NULL,
mode = NULL,
frame = NULL,
selection = "none",
selection_model = "pair_logit",
selection_pooling = "separate",
selection_xformla = NULL,
selection_universe = "F",
selection_rho = NULL,
selection_justification = NULL,
selection_est_method = "ipw",
imputation_pooling = "separate",
control = NULL,
outcome_pooling = "separate"
)
## S3 method for class 'cdid_MP.TEST'
print(x, ...)
## S3 method for class 'cdid_MP.TEST'
summary(object, ...)
Arguments
yname, tname, idname, gname, xformla, data, panel, control_group, weightsname, clustervars, print_details |
As in
|
allow_unbalanced_panel |
|
alp |
Significance level of the reported critical value. |
bstrap, cband |
Validated only. As in did, the conditional test always uses multiplier draws and reports no standard errors. |
biters |
Number of multiplier draws. |
est_method |
Treatment adjustment of the tested comparisons:
|
pl, cores |
Multiplier draws may use |
anticipation, base_period, fix_weights, mode, frame, selection, selection_model, selection_pooling, selection_xformla, selection_universe, selection_rho, selection_justification, selection_est_method, imputation_pooling, outcome_pooling, control |
The
chained settings of |
x, object |
A |
... |
Unused. |
Details
The null is that every requested pre-treatment comparison has zero mean
conditional on the covariate design from xformla. The comparison
dates follow base_period. Reference zeros are excluded. The test uses
outcome changes for IPW and outcome residuals for regression or doubly
robust adjustment. When a missing-outcome adjustment is requested, the
comparison uses the corresponding adjusted changes.
The test evaluates the comparisons over the covariate values of all supplied study units, including units with one or no observed outcomes. Changing covariates are read at the reference date of the comparison. If a required covariate is missing or a prediction is unsupported, the test reports why it is unavailable.
The Cramer-von Mises statistic combines these comparisons. Its p-value
and critical value come from multiplier draws over units or the requested
clusters. Use set.seed() to reproduce the draws. Clustered testing
requires many independent clusters. The unconditional Wald test is
reported separately by att_gt().
Value
In chained mode, an object of class c("cdid_MP.TEST", "MP.TEST")
with the did fields CvM, CvMb, CvMcval, CvMpval,
clustervars and xformla. The Kolmogorov-Smirnov fields are
NULL. The chained element records the null, status and reason,
base period, tested cells with their scalar values, route, grid rule and
columns, statistic and multiplier conventions, clusters, random-number
record, execution and resource accounting. Unavailable tests have status
"unavailable" (or "not_applicable" for custom functions) and
NA statistics. In ordinary mode, did's MP.TEST object.
See Also
att_gt, aggte, reexports, vignette("cdid", package = "cdid")
Examples
## Not run:
pre <- cdid::conditional_did_pretest(yname = "y", tname = "period", idname = "id",
gname = "G", xformla = ~x, data = panel_data, control_group = "notyettreated",
biters = 199)
summary(pre)
pre$chained$cells
## End(Not run)
Inspect fitted treatment and missing-outcome models
Description
Show the fitted equations, coefficient estimates and standard errors for the
models used by att_gt(). Set
control = list(keep_nuisance = TRUE) when fitting to retain the model
information. The report uses the fitted models and does not fit them again.
Usage
nuisance_models(fit, component = NULL, block = NULL)
Arguments
fit |
A result of |
component |
|
block |
|
Details
Call nuisance_models(fit) to see which models are available.
Select a component, then a block when several equations were fitted.
For example, a model with separate slopes can have one block for each
date pair and cohort.
"selection"Logit for observing a date or both outcomes in a date pair. With date-specific observation probabilities, the pair probability is the product of the two fitted date probabilities.
"imputation"Regression of observed actual changes. The estimates are used to predict missing changes within the relevant cohort or switching group.
"treatment"Logit for treatment status within the units eligible for the comparison.
"outcome"Regression for the counterfactual outcome change. In the linear cohort-by-date model, the report gives coefficients relative to the stated reference levels.
The estimation settings determine which models are fitted. A doubly robust treatment fit with augmented observation correction can report all four models. Some specifications, including custom estimation functions and some models with changing covariates or weights, give a reason when a report is unavailable.
Coefficient standard errors use unit contributions from the fitted model, combined within clusters when clustering was requested. The table can have missing standard errors for a point-only fit, insufficient cluster support, or insufficient numerical workspace. See the reported reason.
Value
With component = NULL, an index with model availability and fitted
blocks. With a component, an object with fitted-block and coefficient tables.
The coefficient table includes term, estimate,
std_error, z_value and p_value. Selecting a block returns
its equation, fitting sample, weights and coefficient table. Use
print() to display the result. A component without a report includes
its status and reason.
See Also
Examples
## Not run:
fit <- att_gt(yname = "y", tname = "t", idname = "id", gname = "g",
xformla = ~ x + region, data = panel, weightsname = "w",
est_method = "dr", selection = "conditional_mtar",
selection_model = "independent_period_logit",
selection_pooling = "within_cohort",
control = list(keep_nuisance = TRUE))
nuisance_models(fit) # index and template equation
nuisance_models(fit, "selection") # every block's table
nuisance_models(fit, block = "S1") # one block
nuisance_models(fit, "outcome") # status for this specification
# Augmented correction with treatment DR: every fitted role.
fit_aug <- att_gt(yname = "y", tname = "t", idname = "id", gname = "g",
xformla = ~ x + region, data = panel, weightsname = "w",
est_method = "dr", selection = "conditional_mtar",
selection_est_method = "dr", outcome_pooling = "pooled",
control = list(keep_nuisance = TRUE))
nuisance_models(fit_aug, "selection", block = "S1")
nuisance_models(fit_aug, "outcome") # pooled fit O1
nuisance_models(fit_aug, "treatment", block = "T1")
nuisance_models(fit_aug, "imputation")
## End(Not run)
Functions re-exported from did
Description
Display results from att_gt() and aggte().
These functions use the same interface as in did.
Usage
ggdid(object, ...)
tidy(x, ...)
glance(x, ...)
Arguments
object, x |
|
... |
Arguments passed to the method for the supplied result. |
Details
tidy(x)Returns a table of effects. Columns include
estimate,std.error,conf.lowandconf.high. For chained fits,availableand the support or aggregation columns explain which effects the data support.glance(x)Returns a one-row summary of the fit, with information such as the estimation method, the available effects and the type of inference.
ggdid(object, ...)Plots the effects from a cohort or switching fit or a cohort, event-time or calendar-time summary. Use
tidy(x)to view a simple aggregate as a table.
Use summary(x) for a printed table and a description of the fit.
See Also
att_gt, aggte, conditional_did_pretest, vignette("cdid", package = "cdid")