moderndid.MPResult#

class moderndid.MPResult(groups: ndarray, times: ndarray, att_gt: ndarray, vcov_analytical: ndarray, se_gt: ndarray, critical_value: float, influence_func: ndarray, n_units: int | None = None, wald_stat: float | None = None, wald_pvalue: float | None = None, aggregate_effects: object | None = None, alpha: float = 0.05, estimation_params: dict = {}, G: ndarray | None = None, weights_ind: ndarray | None = None)[source]#

Bases: NamedTuple

Container for group-time average treatment effect results.

This class implements the maketables plug-in interface for publication-quality tables. See Publication Tables with maketables.

Attributes:
groupsnumpy.ndarray

Which group (defined by period first treated) each group-time ATT is for.

timesnumpy.ndarray

Which time period each group-time ATT is for.

att_gtnumpy.ndarray

The group-time average treatment effects for each group-time combination.

vcov_analyticalnumpy.ndarray

Analytical estimator for the asymptotic variance-covariance matrix.

se_gtnumpy.ndarray

Standard errors for group-time ATTs. If bootstrap used, provides bootstrap-based SE.

critical_valuefloat

Critical value - simultaneous if obtaining simultaneous confidence bands, otherwise based on pointwise normal approximation.

influence_funcnumpy.ndarray

The influence function for estimating group-time average treatment effects.

n_unitsint, optional

The number of unique cross-sectional units.

wald_statfloat, optional

The Wald statistic for pre-testing the common trends assumption.

wald_pvaluefloat, optional

The p-value of the Wald statistic for pre-testing common trends.

aggregate_effectsobject, optional

An aggregate treatment effects object.

alphafloat

The significance level (default 0.05).

estimation_paramsdict

Dictionary containing DID estimation parameters including:

  • call_info: original function call information

  • control_group: ‘nevertreated’ or ‘notyettreated’

  • anticipation_periods: number of anticipation periods

  • estimation_method: estimation method used

  • bootstrap: whether bootstrap was used

  • uniform_bands: whether simultaneous confidence bands were computed

  • G: unit-level group assignments

  • weights_ind: unit-level sampling weights

Methods

count(value, /)

Return number of occurrences of value.

index(value[, start, stop])

Return first index of value.

Attributes

G

Unit-level group assignments.

aggregate_effects

Aggregate treatment effects object.

alpha

Significance level.

att_gt

Group-time average treatment effects.

critical_value

Critical value for confidence intervals.

estimation_params

DID estimation parameters.

groups

Which group (defined by period first treated) each group-time ATT is for.

influence_func

Influence function for estimating group-time average treatment effects.

n_units

Number of unique cross-sectional units.

se_gt

Standard errors for group-time ATTs.

times

Which time period each group-time ATT is for.

vcov_analytical

Analytical estimator for the asymptotic variance-covariance matrix.

wald_pvalue

P-value of the Wald statistic for pre-testing common trends.

wald_stat

Wald statistic for pre-testing common trends.

weights_ind

Unit-level sampling weights.