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 max_rounds=len(processes.ec_screening.data.example.strategy),
26 name="ec_screening"
27)
Note
The parameter max_rounds is used in the properties() method of EC_screening.
Therefore, this parameter may not be different across Universes.
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": 0.96,
}
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.00001,
"hyperplasia_with_atypia": 0.05,
"hyperplasia_without_atypia": 0.05,
}
Maximum number of screening rounds¶
For all individuals, the EC_screening Process draws random numbers for each screening round in the
properties() to handle test sensitivity, participation and the probability of hysterectomy.
Therefore, the Process needs to know how many screening tests are scheduled at most over all Universes.
This should be specified in the max_rounds parameter.
For example, if strategies is a list containing all strategies that are evaluated in the simulation, max_rounds
could be specified as follows:
max_rounds = max([len(strategy) for strategy in strategies])
If only one screening strategy is evaluated or all strategies have an equal number of screening rounds, this parameter can be left unspecified.
Example code¶
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 max_rounds=len(processes.ec_screening.data.example.strategy),
26 name="ec_screening"
27)
28
29# Universes
30no_screening = Universe(
31 name="no_screening",
32 processes=[
33 birth,
34 oc,
35 ec
36 ]
37)
38screening = Universe(
39 name="screening",
40 processes=[
41 birth,
42 oc,
43 ec,
44 ec_screening
45 ]
46)
47
48# Model
49model = Model(
50 universes=[
51 no_screening,
52 screening
53 ]
54)
55
56# Run model
57result = model.run(
58 n=1e5,
59 seeds_properties={
60 "birth": 1646,
61 "oc": 9321,
62 "ec": 4841
63 },
64 seeds_properties_tmp={
65 "ec": 8010
66 },
67 event_ages=range(0, 101, 1),
68 duration_ages=range(0, 101, 1),
69 verbose=True
70)
71
72# Export
73result.events.to_csv("events.csv")
74result.durations.to_csv("durations.csv")
75
76pivot_events = result.events.pivot_table(
77 values="number", index="age", columns=["universe", "tag"]
78)
79pivot_durations = result.durations.pivot_table(
80 values="number", index="age", columns=["universe", "tag"]
81)
82pivot_events.to_csv('pivot_events.csv')
83pivot_durations.to_csv('pivot_durations.csv')