cleverly.ControlledDirectEffect#

class cleverly.ControlledDirectEffect(intermediate: float, contrast: ~cleverly.study.ATE | ~cleverly.study.ATT | ~cleverly.study.ATC | ~cleverly.study.RiskRatio | ~cleverly.study.OddsRatio = <factory>)[source]#

Compare treatments while fixing a binary intermediate variable.

Parameters:
intermediatefloat

Fixed intermediate level. The evidenced implementation accepts zero or one.

contrastATE, ATT, ATC, RiskRatio, or OddsRatio

Arm contrast evaluated at the fixed intermediate level.

See also

ATE

The same contrast with nothing held fixed.

cleverly.PointTreatment

Where the intermediate column is declared.

cleverly.datasets.make_cde

A process with a known controlled direct effect.

Examples

>>> from cleverly import ATE, ControlledDirectEffect
>>> estimand = ControlledDirectEffect(intermediate=0.0, contrast=ATE())
>>> estimand.intermediate
0.0

Methods#

Attributes#

ControlledDirectEffect.definition#

Return the controlled-direct-effect definition.

ControlledDirectEffect.name: str = 'controlled_direct_effect'#
ControlledDirectEffect.intermediate: float#
ControlledDirectEffect.contrast: ATE | ATT | ATC | RiskRatio | OddsRatio#