/
EXPMORT.json
75 lines (75 loc) · 1.7 KB
/
EXPMORT.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{"title": {
"text": "Diabetes Expenditure Against Mortality",
"fontSize": 15,
"subtitle":"Country Level, Data Source: https://diabetesatlas.org/data/",
"subtitleFontStyle":"italic",
"subtitleFontSize":12,
"anchor": "start",
"color": "black"
},
"data": {
"url": "https://raw.githubusercontent.com/HenryWRobinson/HenryWRobinson.github.io/main/Project/Data/FinalCrossDeathsVExp2.csv",
"format": {"type": "csv"}
},
"width": 400,
"layer": [
{
"mark": {
"type": "point",
"filled": true
},
"encoding": {
"x": {
"field": "DeathsAttributable",
"type": "quantitative"
},
"y": {
"field": "DiabetesRelatedExpPP",
"type": "quantitative"
}
}
},
{
"mark": {
"type": "line",
"color": "firebrick"
},
"transform": [
{
"regression": "DeathsAttributable",
"on": "DiabetesRelatedExpPP"
}
],
"encoding": {
"x": {
"field": "DeathsAttributable",
"type": "quantitative"
},
"y": {
"field": "DiabetesRelatedExpPP",
"type": "quantitative"
}
}
},
{
"transform": [
{
"regression": "DeathsAttributable",
"on": "DiabetesRelatedExpPP",
"params": true
},
{"calculate": "'R²: '+format(datum.rSquared, '.2f')", "as": "R2"}
],
"mark": {
"type": "text",
"color": "firebrick",
"x": "width",
"align": "right",
"y": -5
},
"encoding": {
"text": {"type": "nominal", "field": "R2"}
}
}
]
}