-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.qmd
193 lines (136 loc) · 7.62 KB
/
index.qmd
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
---
pagetitle: "Statistical Performance Indicators (SPI) Country Pages"
description: |
A snapshot of statistical performance for each country.
sidebar: false
section-divs: false
image: images/SPI_logo.png
site-url: https://stacybri.github.io/SPI_country_pages/
listing:
- id: country_reports
contents:
- /country_reports
- "!index.qmd"
sort: "date desc"
type: grid
categories: true
sort-ui: false
filter-ui: true
page-size: 9
feed: true
toc: false
execute:
echo: false
warning: false
---
```{r}
library(tidyverse)
library(here)
library(downloadthis)
library(highcharter)
```
::: {.column-screen}
::: {.content-container}
::: {.top-story .callout}
<a href="/country_reports/index.qmd">
::: grid
::: {.g-col-12 .g-col-lg-4 .top-story-text}
## The SPI framework assesses the maturity and performance of national statistical systems
:::
::: {.g-col-12 .g-col-lg-8 .top-story-img}
```{r}
df_overall<- read_csv(here('data','SPI_index.csv')) %>%
select(iso3c, country, region, income, date, starts_with('SPI'), population) %>%
filter(date==2023) ## Need to adjust each update
load(here('data','WB_geojson.Rdata'))
map_df <- df_overall %>%
filter(!(country %in% c('Greenland'))) %>% #drop a few countries for which we do not collect data.
#summarise(across(!! indicator,last)) %>%
select(SPI.INDEX, everything()) %>%
mutate(data_available= .[[1]]) %>%
mutate(data_available=if_else(is.na(data_available) | data_available==-99, as.numeric(NA), round(as.numeric(data_available),1))) %>%
rename_with(~gsub(".","_",.x, fixed=TRUE))
spi_groups_quantiles <- quantile(map_df$data_available, probs=c(1,2,3,4)/5,na.rm=T)
SPI_map <- map_df %>%
mutate(spi_groups=case_when(
between(data_available, spi_groups_quantiles[4],100) ~ "Top 20%",
between(data_available, spi_groups_quantiles[3],spi_groups_quantiles[4]) ~ "4th Quintile",
between(data_available, spi_groups_quantiles[2],spi_groups_quantiles[3]) ~ "3rd Quintile",
between(data_available, spi_groups_quantiles[1],spi_groups_quantiles[2]) ~ "2nd Quintile",
between(data_available, 0,spi_groups_quantiles[1]) ~ "Bottom 20%"
)) %>%
mutate(spi_groups=factor(spi_groups,
levels=c("Top 20%","4th Quintile","3rd Quintile","2nd Quintile","Bottom 20%" )),
value = as.numeric(spi_groups))
#set color pallete
col_pal <- c("#2ec4b6","#acece7","#f1dc76","#ffbf69","#ff9f1c")
names(col_pal) <- c("Top 20%","4th Quintile","3rd Quintile","2nd Quintile","Bottom 20%" )
SPI_highchart_map <- highchart(type = "map") %>%
hc_add_series(mapData = countries,
data=SPI_map,
joinBy=c('ISO_A3','iso3c'),
name='SPI_INDEX',
value='value',
borderColor='white',
tooltip = list(
pointFormat = "
<b>SPI Overall Score:</b> {point.SPI_INDEX:,.1f} <br>
<b>Data User Score: </b> {point.SPI_INDEX_PIL1:,.1f} <br>
<b>Data Services Score: </b> {point.SPI_INDEX_PIL2:,.1f} <br>
<b>Data Products Score: </b> {point.SPI_INDEX_PIL3:,.1f} <br>
<b>Data Sources Score: </b> {point.SPI_INDEX_PIL4:,.1f} <br>
<b>Data Infrastructure Score: </b> {point.SPI_INDEX_PIL5:,.1f}"
)
) %>%
hc_colorAxis(dataClassColor="category",
dataClasses = list(list(from=1, to=1, color="#2ec4b6", name="Top 20%"),
list(from=2, to=2, color="#acece7", name="4th Quintile"),
list(from=3, to=3, color="#f1dc76", name="3rd Quintile"),
list(from=4, to=4, color="#ffbf69", name="2nd Quintile"),
list(from=5, to=5, color="#ff9f1c", name="Bottom 20%"))) %>%
hc_mapNavigation(
enabled = FALSE,
enableMouseWheelZoom = TRUE,
enableDoubleClickZoom = TRUE
) %>%
hc_legend(
verticalAlign = "top"
) %>%
hc_title(
text = "The SPI overall score combines 50+ indicators into single measure",
style = list(fontFamily = "Andes"))
SPI_highchart_map
```
:::
:::
</a>
:::
:::
:::
::: {.header-text}
::: {.content-container}
::: {.header-block}
Welcome to the **Statistical Performance Indicators (SPI)** country pages. The [SPI](https://www.worldbank.org/en/programs/statistical-performance-indicators) framework assesses the maturity and performance of national statistical systems.
Reliable, usable, high-quality statistics are vital for global prosperity and progress. The Statistical Performance Indicators (SPI) provide an open-source framework for assessing the performance of statistical systems and the efforts to improve them. This page provides detailed country reports for the SPI. [Click to visit](./country_reports/index.qmd).
{{< downloadthis country_reports/reports/files/SPI_data.xlsx dname=SPI_Index label="Download the SPI data" icon=database-fill-down type=info class=data-button id=spi >}}
:::
:::
:::
<a href="/country_reports/index.qmd">
## Click Here to View Country Pages
</a>
::: {#country_reports}
:::
::: {.header-text}
::: {.content-container}
::: {.header-block}
The [SPI](https://www.worldbank.org/en/programs/statistical-performance-indicators) framework assesses the maturity and performance of national statistical systems in five key areas, called pillars. The five pillars are:
**Data Use**: Statistics have value only if they are used. So the first pillar is data use. A successful statistical system produces data that are used widely and frequently.
**Data Services**: A range of services connects data users to producers and facilitate dialogues between them, thus building trust and a sense of value.
**Data Products**: The dialogues between users and producers drive the design and range of statistical products and their accuracy, timeliness, frequency, comparability, and levels of disaggregation. The products signal whether countries are able to produce indicators related to the 17 Sustainable Development Goals.
**Data Sources**: To create useful products, the statistical system needs to draw on sources inside and outside the government. Data collection thus goes beyond the typical censuses and surveys to include administrative and geospatial data as well as data generated by private firms and citizens.
**Data Infrastructure**: A mature statistical system has well-developed hard infrastructure (legislation, governance, standards) and soft infrastructure (skills, partnerships) as well as the financial resources to deliver useful—and widely used—data products and services.
Each of these pillars is supported by four or five dimensions and uses defined methods and indicators, all available as open data and open code. You can [explore the data](https://www.worldbank.org/en/programs/statistical-performance-indicators/explore-data) or [learn more about the framework](https://www.worldbank.org/en/programs/statistical-performance-indicators/Framework).
:::
:::
:::