Framingham Simulation Graph
This file provides a Python module for using the Framingham model to predict the risk of cardiovascular disease. It includes functionality to input individual’s data and predict the risk based on different control scenarios.
1"""
2This file provides a Python module for using the Framingham model to predict the risk of cardiovascular disease. It includes functionality to input individual's data and predict the risk based on different control scenarios.
3"""
4from biomodel.models import Framingham
5from biomodel.biomodel import OMOPId
6
7
8if __name__ == '__main__':
9
10 model = Framingham()
11
12 sex = OMOPId("sex")
13 age = OMOPId("age")
14 coltot = OMOPId(4224820)
15 hdl = OMOPId(4011133)
16 tas = OMOPId(4152194)
17 tad = OMOPId(4154790)
18 smoke = OMOPId(1585856)
19 diab = OMOPId(35817874)
20
21 current = {
22 sex: 1,
23 age: 50,
24 coltot: 250,
25 hdl: 23,
26 tas: 200,
27 tad: 100,
28 smoke: 1,
29 diab: 1,
30 }
31
32 prediction = model.predict_person(
33 current,
34 {
35 "No smoke": {smoke: 0},
36 "No smoke & CH control": {smoke: 0, coltot: 180, hdl: 50},
37 "Full control": {
38 coltot: 180,
39 hdl: 50,
40 tas: 125,
41 tad: 80,
42 smoke: 0,
43 },
44 },
45 )
46
47 prediction.show_change()
