statspai.principal_strat¶
principal_strat ¶
Principal Stratification (Frangakis & Rubin 2002).
Principal strata classify units by the joint potential values of a post-treatment variable (e.g. compliance type or survival status). Methods provided:
principal_strat(..., method='monotonicity')— sharp bounds on complier/always-taker/never-taker ATEs under monotonicity (Angrist, Imbens & Rubin 1996; Abadie 2002) + point-identified LATE.principal_strat(..., method='principal_score')— covariate- based weighting estimator (Jo & Stuart 2009; Ding & Lu 2017) that point-identifies stratum-specific effects when principal ignorability holds.
Also ships :func:survivor_average_causal_effect (SACE bounds —
Zhang & Rubin 2003) as a specialized entry point for the classical
truncation-by-death problem.
PrincipalStratResult
dataclass
¶
Principal stratification result.
Attributes:
| Name | Type | Description |
|---|---|---|
method |
str
|
'monotonicity' or 'principal_score'. |
strata_proportions |
dict
|
Estimated proportion in each stratum. |
effects |
DataFrame
|
Point estimate / SE / CI for each stratum-specific causal effect. |
bounds |
DataFrame or None
|
For 'monotonicity' method, sharp Zhang-Rubin bounds on SACE. |
n_obs |
int
|
|
alpha |
float
|
|
model_info |
dict
|
|
survivor_average_causal_effect ¶
survivor_average_causal_effect(data: DataFrame, y: str, treat: str, survival: str, alpha: float = 0.05, n_boot: int = 500, seed: Optional[int] = None) -> CausalResult
Zhang-Rubin (2003) sharp bounds on the Survivor Average Causal Effect.
Returns a :class:CausalResult with estimate set to the midpoint
of the SACE bounds and the endpoints stored in model_info.