cleverly.datasets.contact_schedules_truth#
- cleverly.datasets.contact_schedules_truth(tilts: Mapping[str, Mapping[str, float]] | None = None, reference: str | None = None) dict[str, float][source]#
Return the exact mean score under each schedule and each odds tilt, and each contrast.
- Parameters:
- tilts
mappingorNone Each tilt’s name mapped to its odds factors, a mapping from a level of
SCHEDULE_LEVELSto a positive factor. A level a tilt leaves out keeps the factor 1, so an empty mapping is current practice.Noneasks for no tilt.- reference
strorNone The tilt each tilt contrast is taken against.
Nonetakes the first tilt.
- tilts
- Returns:
dictofstrtofloatey[<level>], the mean transition score if every patient got that schedule;ey_ipsi[<name>], the mean under each tilt; andate_ipsi[<name> vs <reference>]for each other tilt. The keys are the names that anATEor anIncrementalEffectfit reports.
See also
cleverly.datasets.make_contact_schedulesDraws data from this law.
Notes
The module docstring gives the law. The covariates enter through a smooth integrand, so a 40-node Gauss-Hermite rule in each of the three covariates is exact to about
1e-12.Examples
>>> from cleverly.datasets import contact_schedules_truth >>> truth = contact_schedules_truth({"now": {}, "more": {"medium": 1.5, "high": 2.0}}) >>> round(truth["ate_ipsi[more vs now]"], 4) 0.0174