# `causalis.data_contracts.panel_did_estimate`

## Module Contents

### Classes

`PanelDIDDiagnosticData` | Diagnostic payload for scalar panel DID estimators.
`PanelDIDEstimate` | Result contract for scalar panel difference-in-differences estimates.
`CallawaySantAnnaDIDEstimate` | Result contract for Callaway-Sant’Anna staggered-adoption DID estimates.

### API

class causalis.data_contracts.panel_did_estimate.PanelDIDDiagnosticData(/, **data: Any)

  Bases: `pydantic.BaseModel`

  Diagnostic payload for scalar panel DID estimators.

  Initialization

  Create a new model by parsing and validating input data from keyword arguments.

  Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

  `self` is explicitly positional-only to allow `self` as a field name.

  model_config

    ‘ConfigDict(…)’

  unit_ids: List[Hashable]

    None

  d: numpy.ndarray

    None

  delta_y: numpy.ndarray

    None

  x: Optional[numpy.ndarray]

    None

  covariate_names: List[str]

    ‘Field(…)’

  propensity_score: numpy.ndarray

    None

  control_outcome_evolution: numpy.ndarray

    None

  treated_weights: numpy.ndarray

    None

  control_weights: numpy.ndarray

    None

  influence_scores: numpy.ndarray

    None

  gamma_hat: numpy.ndarray

    None

  beta_hat: numpy.ndarray

    None

  overlap: Dict[str, Any]

    ‘Field(…)’

  balance: pandas.DataFrame

    ‘Field(…)’

  cluster_scores: Optional[pandas.Series]

    None

class causalis.data_contracts.panel_did_estimate.PanelDIDEstimate(/, **data: Any)

  Bases: `pydantic.BaseModel`

  Result contract for scalar panel difference-in-differences estimates.

  Initialization

  Create a new model by parsing and validating input data from keyword arguments.

  Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

  `self` is explicitly positional-only to allow `self` as a field name.

  model_config

    ‘ConfigDict(…)’

  estimand: Literal[ATT]

    ‘ATT’

  model: str

    None

  treatment_start: causalis.data_contracts.panel_data_did.TimeLike

    None

  pre_time: causalis.data_contracts.panel_data_did.TimeLike

    None

  post_time: causalis.data_contracts.panel_data_did.TimeLike

    None

  att: float

    None

  se: float

    None

  ci_lower: float

    None

  ci_upper: float

    None

  p_value: float

    None

  is_significant: bool

    None

  alpha: float

    None

  n_units: int

    None

  n_treated: int

    None

  n_control: int

    None

  treatment_mean_delta: float

    None

  control_mean_delta: float

    None

  outcome: str

    None

  treatment: str

    None

  covariates: List[str]

    ‘Field(…)’

  cluster_col: Optional[str]

    None

  inference: Literal[influence, clustered_influence]

    ‘influence’

  diagnostic_data: Optional[causalis.data_contracts.panel_did_estimate.PanelDIDDiagnosticData]

    None

  created_at: datetime.datetime

    ‘Field(…)’

  property value: float

    CausalEstimate-style alias for the ATT.

  property std_error: float

    Readable alias for the influence-function standard error.

  summary() → pandas.DataFrame

    Return a compact scalar panel-DID summary table.

class causalis.data_contracts.panel_did_estimate.CallawaySantAnnaDIDEstimate(/, **data: Any)

  Bases: `pydantic.BaseModel`

  Result contract for Callaway-Sant’Anna staggered-adoption DID estimates.

  Initialization

  Create a new model by parsing and validating input data from keyword arguments.

  Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

  `self` is explicitly positional-only to allow `self` as a field name.

  model_config

    ‘ConfigDict(…)’

  estimand: Literal[average_post_effect]

    ‘average_post_effect’

  model: str

    None

  estimator: str

    None

  control_group: str

    None

  anticipation: int

    None

  base_period: Literal[universal, varying]

    None

  include_pre_periods: bool

    None

  alpha: float

    None

  att_gt: pandas.DataFrame

    None

  aggregates: Dict[str, pandas.DataFrame]

    None

  support: pandas.DataFrame

    None

  skipped_cells: pandas.DataFrame

    None

  outcome: str

    None

  treatment: str

    None

  unit_col: str

    None

  time_col: str

    None

  covariates: List[str]

    ‘Field(…)’

  cluster_col: Optional[str]

    None

  inference: str

    None

  diagnostics: Dict[str, Any]

    ‘Field(…)’

  created_at: datetime.datetime

    ‘Field(…)’

  property att: float

    Simple overall post-treatment effect, weighted by treated cohort-time observations.

  property value: float

    Alias for the simple overall post-treatment effect.

  property se: float

    Standard error for the simple overall post-treatment effect.

  property std_error: float

    Alias for the simple overall post-treatment effect standard error.

  property ci_lower: float
  property ci_upper: float
  property p_value: float
  property diagnostic_data: Optional[Dict[str, Any]]

    Compatibility alias for callers moving from older DID result objects.

  aggregate(kind: Literal[simple, cohort, calendar, event]) → pandas.DataFrame

    Return an aggregate table: `simple`, `cohort`, `calendar`, or `event`.

  event_study() → pandas.DataFrame

    Return dynamic effects by event time.

  summary() → pandas.DataFrame

    Return a compact summary of the average post-treatment effect.