causalis.data_contracts.multicausal_estimate¶
Module Contents¶
Classes¶
Result container for causal effect estimates. |
API¶
- class causalis.data_contracts.multicausal_estimate.MultiCausalEstimate(/, **data: Any)¶
Bases:
pydantic.BaseModelResult container for causal effect estimates.
Parameters
estimand : str The estimand being estimated (e.g., ‘ATE’, ‘ATTE’, ‘CATE’). model : str The name of the model used for estimation. model_options : dict Options passed to the model. value : float The estimated absolute effect. ci_upper_absolute : float Upper bound of the absolute confidence interval. ci_lower_absolute : float Lower bound of the absolute confidence interval. value_relative : float, optional The estimated relative effect. ci_upper_relative : float, optional Upper bound of the relative confidence interval. ci_lower_relative : float, optional Lower bound of the relative confidence interval. alpha : float The significance level (e.g., 0.05). p_value : float, optional The p-value from the test. is_significant : bool Whether the result is statistically significant at alpha. n_treated : int Number of units in the treatment group. n_control : int Number of units in the control group. outcome : str The name of the outcome variable. treatment : str The name of the treatment variable. confounders : list of str, optional The names of the confounders used in the model. time : str The date when the estimate was created (YYYY-MM-DD). diagnostic_data : DiagnosticData, optional Additional diagnostic data_contracts.
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.selfis explicitly positional-only to allowselfas a field name.- model_config¶
‘ConfigDict(…)’
- estimand: str¶
None
- model: str¶
None
- model_options: Dict[str, Any]¶
‘Field(…)’
- value: numpy.ndarray¶
None
- ci_upper_absolute: numpy.ndarray¶
None
- ci_lower_absolute: numpy.ndarray¶
None
- value_relative: Optional[numpy.ndarray]¶
None
- ci_upper_relative: Optional[numpy.ndarray]¶
None
- ci_lower_relative: Optional[numpy.ndarray]¶
None
- alpha: float¶
None
- p_value: Optional[numpy.ndarray]¶
None
- is_significant: List[bool]¶
None
- n_treated: int¶
None
- n_control: int¶
None
- outcome: str¶
None
- treatment: List[str]¶
None
- n_treated_by_arm: Optional[numpy.ndarray]¶
None
- treatment_mean: Optional[numpy.ndarray]¶
None
- control_mean: Optional[float]¶
None
- contrast_labels: List[str]¶
‘Field(…)’
- confounders: List[str]¶
‘Field(…)’
- time: str¶
‘Field(…)’
- diagnostic_data: Optional[causalis.data_contracts.causal_diagnostic_data.DiagnosticData]¶
None
- summary() pandas.DataFrame¶
Return a CausalEstimate-like summary for all baseline contrasts.
Returns
pd.DataFrame Summary indexed by
fieldand with one column per contrast (d_k vs d_0).