Endometrial cancer (EC) - screening

The built-in process EC_screening simulates screening for endometrial cancer. Any Universe with this process should also include an instance of the EC process. The code in the EC screening process is meant for illustration purposes only and should not be used to inform decision analyses.

21ec_screening = processes.EC_screening(
22    strategy=processes.ec_screening.data.example.strategy,
23    sensitivity=processes.ec_screening.data.example.sensitivity,
24    p_hysterectomy=processes.ec_screening.data.example.p_hysterectomy,
25    name="ec_screening"
26)

Strategy

The strategy parameter lists the screening interventions. It requires a sequence of dictionaries with the ages of screening and participation rate for each screening age. The following keys should be listed:

  • age: age of the screening test;

  • participation_first: probability to attend screening at the first screening invitation;

  • participation_participator: probability to attend screening if someone participated in screening in the previous round;

  • participation_non_participator: probability to attend screening if someone did not participate in screening in the previous round.

strategy = [
    {
        "age": age,
        "participation_first": 1.0,
        "participation_participator": 1.0,
        "participation_non_participator": 1.0,
    }
    for age in range(30, 36, 1)
]

Sensitivity

The sensitivity parameter lists the sensitivity of a test to the different types of lesions. It should list the sensitivity to:

  • Hyperplasia with atypia;

  • Hyperplasia without atypia;

  • Preclinical cancers.

sensitivity = {
    "hyperplasia_with_atypia": 0.56,
    "hyperplasia_without_atypia": 0.56,
    "preclinical": 1.0,
}

Probability of hysterectomy

The parameter p_hysterectomy specifies the probability that the woman will undergo hysterectomy once a certain lesion has been detected. Probabilities should be specified for hyperplasia with and without atypia, and for individuals with a negative test. Note that the probability for a negative test can be considered the specificity of the test.

p_hysterectomy = {
    "negative": 0.1,
    "hyperplasia_with_atypia": 0.5,
    "hyperplasia_without_atypia": 0.5,
}
ec_screening.py
 1from miscore import Model, processes, Universe
 2
 3# Birth process
 4birth = processes.Birth(
 5    name="birth",
 6    year=1938
 7)
 8
 9# OC process
10oc = processes.OC(
11    name="oc",
12    life_table=processes.oc.data.us_2017.life_table_female
13)
14
15# EC process
16ec = processes.EC.from_data(
17    processes.ec.data.us,
18    onset_method="before_oc"
19)
20
21ec_screening = processes.EC_screening(
22    strategy=processes.ec_screening.data.example.strategy,
23    sensitivity=processes.ec_screening.data.example.sensitivity,
24    p_hysterectomy=processes.ec_screening.data.example.p_hysterectomy,
25    name="ec_screening"
26)
27
28# Universes
29no_screening = Universe(
30    name="no_screening",
31    processes=[
32        birth,
33        oc,
34        ec
35    ]
36)
37screening = Universe(
38    name="screening",
39    processes=[
40        birth,
41        oc,
42        ec,
43        ec_screening
44    ]
45)
46
47# Model
48model = Model(
49    universes=[
50        no_screening,
51        screening
52    ]
53)
54
55# Run model
56result = model.run(
57    n=1e5,
58    seeds_properties={
59        "birth": 1646,
60        "oc": 9321,
61        "ec": 4841
62    },
63    seeds_properties_tmp={
64        "ec": 8010
65    },
66    event_ages=range(0, 101, 1),
67    duration_ages=range(0, 101, 1),
68    verbose=True
69)
70
71# Export
72result.events.to_csv("events.csv")
73result.durations.to_csv("durations.csv")
74
75pivot_events = result.events.pivot_table(
76    values="number", index="age", columns=["universe", "tag"]
77)
78pivot_durations = result.durations.pivot_table(
79    values="number", index="age", columns=["universe", "tag"]
80)
81pivot_events.to_csv('pivot_events.csv')
82pivot_durations.to_csv('pivot_durations.csv')