Skip to content
Submodule
causalis.scenarios.did.refutation.post_inference_plots

post_inference_plots

Submodule causalis.scenarios.did.refutation.post_inference_plots with no child pages and 3 documented members.

Functions

Jump directly into the documented functions for this page.

2 items

Data

Jump directly into the documented data for this page.

1 items
function
causalis.scenarios.did.refutation.post_inference_plots.plot_did_post_inference_event_study

plot_did_post_inference_event_study

Plot the fitted CS event-study estimates with confidence intervals.

This function visualizes the dynamic effects of treatment over time relative to the start of treatment (event time). It displays the event-study aggregation of the group-time average treatment effects ATT(g,t)ATT(g,t).

Parameters

data_or_estimatePanelDataDID or CallawaySantAnnaDIDEstimate

Either the validated panel data or the fitted estimate object. If data is passed, the estimate parameter must also be provided.

estimateCallawaySantAnnaDIDEstimate, optional

The fitted model results. Required if data_or_estimate is a PanelDataDID.

show_simultaneousbool, default True

Whether to show the simultaneous confidence bands if available in the estimate.

figsizetuple of float, default (9.0, 5.2)

The size of the figure in inches (width, height).

dpiint, default 220

The resolution of the figure.

font_scalefloat, default 1.05

Scale factor for font sizes in the plot.

Returns

matplotlib.figure.Figure

The resulting event-study plot.

Examples

Fit the model

Notes

The event-study aggregation at event time ee is defined as:

ATTevent(e)=gw(g,e)ATT(g,g+e)ATT_{event}(e) = \sum_{g} w(g, e) ATT(g, g+e)

where w(g,e)w(g, e) are weights based on the sample size of each group at that event time. Pointwise confidence intervals are shown by default. If the model was estimated using the multiplier bootstrap, simultaneous confidence bands can also be displayed to account for multiple testing across event times.

Canonical target

causalis.scenarios.did.refutation.post_inference_plots.plot_did_post_inference_event_study

Sections

ParametersReturnsNotesExamples
Link to this symbol
function
causalis.scenarios.did.refutation.post_inference_plots.plot_did_influence_concentration

plot_did_influence_concentration

Plot top unit-level influence shares for the simple overall ATT.

This plot helps identify outlier units that disproportionately affect the overall average treatment effect estimate. Large influence shares may indicate lack of overlap or extreme outcomes.

Parameters

data_or_estimatePanelDataDID or CallawaySantAnnaDIDEstimate

Either the validated panel data or the fitted estimate object.

estimateCallawaySantAnnaDIDEstimate, optional

The fitted model results. Required if data_or_estimate is a PanelDataDID.

top_nint, default 15

The number of top influential units to display.

figsizetuple of float, default (9.5, 5.2)

The size of the figure in inches (width, height).

dpiint, default 220

The resolution of the figure.

font_scalefloat, default 1.05

Scale factor for font sizes in the plot.

Returns

matplotlib.figure.Figure

The resulting influence concentration bar plot.

Examples

Fit the model

Notes

The influence share for unit ii is calculated based on its contribution to the simple aggregated ATT influence function ψ\psi. The absolute influence share is defined as:

Sharei=ψij=1nψjShare_i = \frac{|\psi_i|}{\sum_{j=1}^n |\psi_j|}

where ψi\psi_i is the value of the influence function for unit ii on the overall ATT estimate θ^\hat{\theta}.

Canonical target

causalis.scenarios.did.refutation.post_inference_plots.plot_did_influence_concentration

Sections

ParametersReturnsNotesExamples
Link to this symbol
data
causalis.scenarios.did.refutation.post_inference_plots.__all__

__all__

Value: ['plot_did_post_inference_event_study', 'plot_did_influence_concentration']

[‘plot_did_post_inference_event_study’, ‘plot_did_influence_concentration’]

Canonical target

causalis.scenarios.did.refutation.post_inference_plots.__all__

Link to this symbol