Skip to content

API reference / Switchback

tsdive.SwitchbackEstimate dataclass

SwitchbackEstimate(
    covariates: tuple[str, ...],
    kept_per_block: tuple[int, ...],
    *,
    estimate: float | None = None,
    p_value: float | None = None,
    lo: float | None = None,
    hi: float | None = None,
    reason: str | None = None,
    detail: str | None = None,
)

One analysis of the target: direct (no covariates) or adjusted.

estimate is B minus A in the target's unit. lo and hi bound the 95% interval and are -inf or +inf on a side it does not close on. On a refusal reason is one of too_few, no_spread, too_many_covariates, empty_block or collinear, detail says what the data showed, and the numbers are None.

Attributes:

Name Type Description
covariates tuple[str, ...]
kept_per_block tuple[int, ...]
estimate float | None
p_value float | None
lo float | None
hi float | None
reason str | None
detail str | None
n_kept int
refused bool
lo_unbounded bool
hi_unbounded bool

covariates instance-attribute

covariates: tuple[str, ...]

kept_per_block instance-attribute

kept_per_block: tuple[int, ...]

_ instance-attribute

_: KW_ONLY

estimate class-attribute instance-attribute

estimate: float | None = None

p_value class-attribute instance-attribute

p_value: float | None = None

lo class-attribute instance-attribute

lo: float | None = None

hi class-attribute instance-attribute

hi: float | None = None

reason class-attribute instance-attribute

reason: str | None = None

detail class-attribute instance-attribute

detail: str | None = None

n_kept property

n_kept: int

refused property

refused: bool

lo_unbounded property

lo_unbounded: bool

hi_unbounded property

hi_unbounded: bool