Compare commits
12 Commits
lab3
..
2667c06e09
| Author | SHA1 | Date | |
|---|---|---|---|
| 2667c06e09 | |||
| fa9a358415 | |||
| 18a911f9d3 | |||
| 414a4ac5a3 | |||
| 4eff5a6378 | |||
| 5adb4119f5 | |||
| cd3ababd59 | |||
| 88f2975b86 | |||
| dc2ceac7de | |||
| 9abd1a6df6 | |||
| 555650ac3c | |||
| 8b274f6bd6 |
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"r.rpath.linux": "/usr/bin/R"
|
||||
"r.rpath.linux": "/usr/bin/R",
|
||||
"r.editor.tabSize": 4
|
||||
}
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
# bleh
|
||||
|
||||
suppressPackageStartupMessages({
|
||||
library(tidyverse)
|
||||
library(broom)
|
||||
library(caret)
|
||||
library(class)
|
||||
});
|
||||
|
||||
# helpers
|
||||
find_col <- function(df, patterns) {
|
||||
cols <- names(df)
|
||||
for (pat in patterns) {
|
||||
hit <- cols[str_detect(tolower(cols), regex(pat, ignore_case = TRUE))]
|
||||
if (length(hit) > 0) return(hit[[1]])
|
||||
}
|
||||
return(NULL)
|
||||
}
|
||||
|
||||
sanitize_filename <- function(x) {
|
||||
gsub("[^A-Za-z0-9_.-]+", "_", x)
|
||||
}
|
||||
|
||||
pick_regions <- function(df, region_col, a = NULL, b = NULL) {
|
||||
if (!is.null(a) && !is.null(b)) return(c(a, b))
|
||||
cnt <- df %>% filter(!is.na(.data[[region_col]])) %>%
|
||||
count(.data[[region_col]], sort = TRUE)
|
||||
|
||||
stopifnot(nrow(cnt) >= 2)
|
||||
c(cnt[[1,1]], cnt[[2,1]])
|
||||
}
|
||||
|
||||
save_txt <- function(path, txt) {
|
||||
dir.create(dirname(path), showWarnings = FALSE, recursive = TRUE)
|
||||
writeLines(txt, path)
|
||||
}
|
||||
|
||||
# args
|
||||
args <- commandArgs(trailingOnly = TRUE)
|
||||
opt <- list(
|
||||
data = NULL, region_col = NULL, region_a = NULL, region_b = NULL,
|
||||
response = NULL, predictors = NULL, knn1 = NULL, knn2 = NULL,
|
||||
k = 5L, render = "none" # "none" | "html" | "pdf"
|
||||
)
|
||||
|
||||
parse_flag <- function(flag) {
|
||||
key <- sub("^--", "", flag[[1]])
|
||||
val <- if (length(flag) > 1) flag[[2]] else TRUE
|
||||
opt[[key]] <<- val
|
||||
}
|
||||
|
||||
if (length(args)) {
|
||||
kv <- split(args, cumsum(grepl("^--", args)))
|
||||
lapply(kv, parse_flag)
|
||||
}
|
||||
|
||||
stopifnot(!is.null(opt$data))
|
||||
|
||||
# load data
|
||||
message("reading: ", opt$data)
|
||||
|
||||
df <- if (grepl("\\.csv(\\.gz)?$", opt$data, ignore.case = TRUE)) {
|
||||
suppressMessages(readr::read_csv(opt$data, show_col_types = FALSE))
|
||||
} else {
|
||||
suppressMessages(readxl::read_excel(opt$data))
|
||||
}
|
||||
|
||||
# auto-detect columns
|
||||
region_col <- opt$region_col %||%
|
||||
find_col(df, c("^region$", "regions?$", "world\\s*bank\\s*region"))
|
||||
|
||||
if (is.null(region_col)) stop("could not detect a 'region' column; use --region-col")
|
||||
|
||||
response_col <- opt$response %||%
|
||||
find_col(df, c("^epi$", "overall\\s*score$", "index$", "score$"))
|
||||
|
||||
if (is.null(response_col)) {
|
||||
nums <- df %>% select(where(is.numeric)) %>% names()
|
||||
if (length(nums) == 0) stop("no numeric columns found; set --response explicitly")
|
||||
response_col <- nums[[1]]
|
||||
}
|
||||
|
||||
gdp_col <- find_col(df, c("^gdp", "gdp.*per.*cap", "gdppc"))
|
||||
pop_col <- find_col(df, c("^pop", "^population$"))
|
||||
|
||||
# predictors set(s)
|
||||
pred_sets <- list()
|
||||
if (!is.null(opt$predictors)) {
|
||||
pred_sets <- list(strsplit(opt$predictors, ",", fixed = TRUE)[[1]] %>% trimws())
|
||||
} else {
|
||||
ps <- c(na.omit(gdp_col), na.omit(pop_col))
|
||||
if (length(ps) >= 1) pred_sets <- append(pred_sets, list(ps[1]))
|
||||
if (length(ps) >= 2) pred_sets <- append(pred_sets, list(ps[1:2]))
|
||||
}
|
||||
|
||||
# choose regions
|
||||
regions <- pick_regions(df, region_col, opt$region_a, opt$region_b)
|
||||
region_a <- regions[[1]]; region_b <- regions[[2]]
|
||||
|
||||
# dirs
|
||||
fig_dir <- "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures"; dir.create(fig_dir, showWarnings = FALSE)
|
||||
stats_dir <- "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/stats"; dir.create(stats_dir, showWarnings = FALSE)
|
||||
|
||||
# distributions and qq
|
||||
fa <- df %>% filter(.data[[region_col]] == region_a) %>% pull(all_of(response_col)) %>% as.numeric()
|
||||
fb <- df %>% filter(.data[[region_col]] == region_b) %>% pull(all_of(response_col)) %>% as.numeric()
|
||||
|
||||
# le plot de box
|
||||
p_box_a <- tibble(val = fa) %>%
|
||||
ggplot(aes(x = "", y = val)) +
|
||||
geom_boxplot() +
|
||||
labs(title = paste0("boxplot: ", response_col, " (", region_a, ")"),
|
||||
x = NULL, y = response_col)
|
||||
ggsave(file.path(fig_dir, sprintf("box_%s_%s.png",
|
||||
sanitize_filename(region_a), sanitize_filename(response_col))),
|
||||
p_box_a, width = 5, height = 4, dpi = 160)
|
||||
|
||||
p_box_b <- tibble(val = fb) %>%
|
||||
ggplot(aes(x = "", y = val)) +
|
||||
geom_boxplot() +
|
||||
labs(title = paste0("boxplot: ", response_col, " (", region_b, ")"),
|
||||
x = NULL, y = response_col)
|
||||
|
||||
ggsave(file.path(fig_dir, sprintf("box_%s_%s.png",
|
||||
sanitize_filename(region_b), sanitize_filename(response_col))),
|
||||
p_box_b, width = 5, height = 4, dpi = 160)
|
||||
|
||||
# hist and density
|
||||
p_hist_a <- tibble(val = fa) %>%
|
||||
ggplot(aes(x = val)) +
|
||||
geom_histogram(aes(y = after_stat(density)), bins = 30, alpha = 0.6) +
|
||||
geom_density() +
|
||||
labs(title = paste0("histogram + density: ", response_col, " (", region_a, ")"),
|
||||
x = response_col, y = "density")
|
||||
|
||||
ggsave(file.path(fig_dir, sprintf("hist_%s_%s.png",
|
||||
sanitize_filename(region_a), sanitize_filename(response_col))),
|
||||
p_hist_a, width = 6, height = 4, dpi = 160)
|
||||
|
||||
p_hist_b <- tibble(val = fb) %>%
|
||||
ggplot(aes(x = val)) +
|
||||
geom_histogram(aes(y = after_stat(density)), bins = 30, alpha = 0.6) +
|
||||
geom_density() +
|
||||
labs(title = paste0("histogram + density: ", response_col, " (", region_b, ")"),
|
||||
x = response_col, y = "density")
|
||||
|
||||
ggsave(file.path(fig_dir, sprintf("hist_%s_%s.png",
|
||||
sanitize_filename(region_b), sanitize_filename(response_col))),
|
||||
p_hist_b, width = 6, height = 4, dpi = 160)
|
||||
|
||||
# qq plot between the two regions (2 sample qq)
|
||||
png(file.path(fig_dir, sprintf("qq_%s_%s_vs_%s.png",
|
||||
sanitize_filename(response_col), sanitize_filename(region_a), sanitize_filename(region_b))),
|
||||
width = 700, height = 500, res = 160)
|
||||
|
||||
n <- min(sum(is.finite(fa)), sum(is.finite(fb)))
|
||||
q <- seq(0.01, 0.99, length.out = max(10, n))
|
||||
xq <- quantile(fa, q, na.rm = TRUE); yq <- quantile(fb, q, na.rm = TRUE)
|
||||
|
||||
plot(sort(xq), sort(yq), pch = 19, cex = 0.6,
|
||||
xlab = paste0("quantiles: ", region_a),
|
||||
ylab = paste0("quantiles: ", region_b),
|
||||
main = paste("qq plot:", region_a, "vs", region_b))
|
||||
|
||||
abline(0, 1)
|
||||
dev.off()
|
||||
@@ -0,0 +1,122 @@
|
||||
# TODO: organize this file better bc I just kinda dumped everything in here
|
||||
|
||||
|
||||
suppressPackageStartupMessages({
|
||||
pkgs <- c("tidyverse", "readr", "readxl", "broom", "jsonlite", "ggplot2", "class", "optparse", "markdown")
|
||||
to_install <- pkgs[!pkgs %in% rownames(installed.packages())]
|
||||
if (length(to_install)) install.packages(to_install, repos = "https://cloud.r-project.org")
|
||||
lapply(pkgs, library, character.only = TRUE)
|
||||
})
|
||||
|
||||
sanitize <- function(x) {
|
||||
gsub("[^A-Za-z0-9_.-]+", "_", x)
|
||||
}
|
||||
|
||||
save_plot <- function(p, path, w = 7, h = 5, dpi = 160) {
|
||||
dir.create(dirname(path), recursive = TRUE, showWarnings = FALSE)
|
||||
ggplot2::ggsave(path, p, width = w, height = h, dpi = dpi)
|
||||
}
|
||||
|
||||
hist_density_plot <- function(v, lbl) {
|
||||
tibble(x = v) |>
|
||||
ggplot(aes(x = x)) +
|
||||
geom_histogram(aes(y = after_stat(density)), bins = 30, alpha = 0.6) +
|
||||
geom_density() +
|
||||
labs(title = paste("histogram + density:", lbl), x = lbl, y = "density") +
|
||||
theme_minimal()
|
||||
}
|
||||
|
||||
box_plot <- function(v, lbl) {
|
||||
tibble(x = v) |>
|
||||
ggplot(aes(y = x)) +
|
||||
geom_boxplot(width = 0.3) +
|
||||
labs(title = paste("boxplot:", lbl), y = lbl, x = NULL) +
|
||||
theme_minimal()
|
||||
}
|
||||
|
||||
qq_two_sample <- function(a, b, title = "qq plot", n_q = NULL) {
|
||||
a <- a[is.finite(a)]
|
||||
b <- b[is.finite(b)]
|
||||
n <- min(length(a), length(b))
|
||||
|
||||
if (is.null(n_q)) n_q <- max(10, floor(n))
|
||||
if (n_q < 10) return(NULL)
|
||||
|
||||
probs <- seq(0.01, 0.99, length.out = n_q)
|
||||
qa <- quantile(a, probs, na.rm = TRUE, names = FALSE)
|
||||
qb <- quantile(b, probs, na.rm = TRUE, names = FALSE)
|
||||
d <- tibble(x = sort(qa), y = sort(qb))
|
||||
|
||||
ggplot(d, aes(x, y)) +
|
||||
geom_point(size = 1.6) +
|
||||
geom_abline(slope = 1, intercept = 0) +
|
||||
labs(title = title, x = "region a quantiles", y = "region b quantiles") +
|
||||
theme_minimal()
|
||||
}
|
||||
|
||||
tf_pos <- function(s) {
|
||||
s <- as.numeric(s)
|
||||
if (all(s[is.finite(s)] > 0)) log1p(s) else s
|
||||
}
|
||||
|
||||
strat_split <- function(d, label_col, test_prop = 0.25) {
|
||||
d <- d |> tidyr::drop_na({{label_col}})
|
||||
idx_tr <- integer(0)
|
||||
idx_te <- integer(0)
|
||||
|
||||
for (lev in unique(d[[label_col]])) {
|
||||
rows <- which(d[[label_col]] == lev)
|
||||
nte <- max(1, floor(length(rows) * test_prop))
|
||||
|
||||
te <- sample(rows, nte)
|
||||
tr <- setdiff(rows, te)
|
||||
|
||||
idx_tr <- c(idx_tr, tr)
|
||||
idx_te <- c(idx_te, te)
|
||||
}
|
||||
|
||||
list(train = d[idx_tr, , drop = FALSE], test = d[idx_te, , drop = FALSE])
|
||||
}
|
||||
|
||||
run_knn <- function(d, label_col, vars, k, tag, fig_dir) {
|
||||
use <- d |> dplyr::select(all_of(c(label_col, vars))) |> tidyr::drop_na()
|
||||
split <- strat_split(use, label_col, 0.25)
|
||||
tr <- split$train
|
||||
te <- split$test
|
||||
|
||||
mu <- sapply(tr[, vars, drop = FALSE], mean, na.rm = TRUE)
|
||||
sdv <- sapply(tr[, vars, drop = FALSE], sd, na.rm = TRUE)
|
||||
sdv[sdv == 0] <- 1
|
||||
|
||||
trX <- scale(as.matrix(tr[, vars, drop = FALSE]), center = mu, scale = sdv)
|
||||
teX <- scale(as.matrix(te[, vars, drop = FALSE]), center = mu, scale = sdv)
|
||||
|
||||
trY <- factor(tr[[label_col]])
|
||||
teY <- factor(te[[label_col]], levels = levels(trY))
|
||||
|
||||
pred <- class::knn(train = trX, test = teX, cl = trY, k = k)
|
||||
acc <- mean(pred == teY, na.rm = TRUE)
|
||||
|
||||
cm <- table(truth = teY, pred = pred)
|
||||
cm_df <- as.data.frame(cm)
|
||||
cm_fig <- file.path(fig_dir, paste0("knn_confusion_", sanitize(tag), ".png"))
|
||||
|
||||
p_cm <- ggplot(cm_df, aes(x = pred, y = truth, fill = Freq)) +
|
||||
geom_tile() + geom_text(aes(label = Freq)) +
|
||||
labs(
|
||||
title = paste0("confusion matrix (k=", k, ") – ", tag),
|
||||
x = "predicted", y = "true"
|
||||
) + theme_minimal() +
|
||||
theme(
|
||||
axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1)
|
||||
)
|
||||
|
||||
save_plot(p_cm, cm_fig, w = 6, h = 5)
|
||||
|
||||
list(tag = tag,
|
||||
k = k,
|
||||
vars = vars,
|
||||
accuracy = unname(acc),
|
||||
confusion_fig = cm_fig,
|
||||
n_test = nrow(te))
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
source("/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/R/00_utils.R")
|
||||
|
||||
# TODO: hard-code me
|
||||
|
||||
# NOTE: The options were generated by chatGPT from my horrendous hard-coded options
|
||||
option_list <- list(
|
||||
optparse::make_option("--data", type = "character", default = "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/epi_results_2024_pop_gdp_v2.csv"),
|
||||
optparse::make_option("--region-col", type = "character", default = NA),
|
||||
optparse::make_option("--region-a", type = "character", default = NA),
|
||||
optparse::make_option("--region-b", type = "character", default = NA),
|
||||
optparse::make_option("--response", type = "character", default = NA),
|
||||
optparse::make_option("--predictors", type = "character", default = NA),
|
||||
optparse::make_option("--knn1", type = "character", default = NA),
|
||||
optparse::make_option("--knn2", type = "character", default = NA),
|
||||
optparse::make_option("--k", type = "integer", default = 5)
|
||||
)
|
||||
opt <- optparse::parse_args(optparse::OptionParser(option_list = option_list))
|
||||
|
||||
if (is.na(opt$data)) stop("--data is required")
|
||||
|
||||
read_any <- function(p) {
|
||||
ext <- tolower(tools::file_ext(p))
|
||||
if (ext %in% c("csv", "txt")) {
|
||||
suppressMessages(readr::read_csv(p, show_col_types = FALSE))
|
||||
} else if (ext %in% c("xls", "xlsx")) {
|
||||
readxl::read_excel(p)
|
||||
} else {
|
||||
stop("unsupported extension: ", ext)
|
||||
}
|
||||
}
|
||||
df <- read_any(opt$data)
|
||||
|
||||
nms <- names(df)
|
||||
|
||||
find_col <- function(nms, pats) {
|
||||
for (pat in pats) {
|
||||
idx <- which(stringr::str_detect(tolower(nms), pat))
|
||||
if (length(idx)) return(nms[idx[1]])
|
||||
}
|
||||
|
||||
# I hate it here
|
||||
NA_character_
|
||||
}
|
||||
|
||||
region_col <- if (!is.na(opt$`region-col`)) opt$`region-col` else
|
||||
find_col(nms, c("^region$", "regions?$", "world\\s*bank\\s*region"))
|
||||
|
||||
if (is.na(region_col)) stop("could not detect a region column; pass --region-col")
|
||||
|
||||
response <- if (!is.na(opt$response)) opt$response else if ("EPI.new" %in% nms) {
|
||||
"EPI.new"
|
||||
} else {
|
||||
find_col(nms, c("^epi", "epi.*score", "index$", "score$"))
|
||||
}
|
||||
|
||||
if (is.na(response)) {
|
||||
num <- df |> dplyr::select(where(is.numeric)) |> names()
|
||||
if (!length(num)) stop("no numeric columns; pass --response")
|
||||
response <- num[1]
|
||||
}
|
||||
|
||||
gdp_col <- find_col(nms, c("^gdp", "gdp.*per.*cap", "gdppc"))
|
||||
pop_col <- find_col(nms, c("^pop", "^population$"))
|
||||
|
||||
counts <- sort(table(df[[region_col]]), decreasing = TRUE)
|
||||
region_a <- if (!is.na(opt$`region-a`)) opt$`region-a` else
|
||||
if ("Sub-Saharan Africa" %in% names(counts)) "Sub-Saharan Africa" else names(counts)[1]
|
||||
|
||||
region_b <- if (!is.na(opt$`region-b`)) opt$`region-b` else
|
||||
if ("Latin America & Caribbean" %in% names(counts)) "Latin America & Caribbean" else names(counts)[2]
|
||||
|
||||
pred_sets <- list()
|
||||
if (!is.na(opt$predictors)) {
|
||||
pred_sets <- list(strsplit(opt$predictors, ",", fixed = TRUE)[[1]] |> trimws())
|
||||
} else {
|
||||
plist <- c()
|
||||
if (!is.na(gdp_col)) plist <- c(plist, gdp_col)
|
||||
if (!is.na(pop_col)) plist <- c(plist, pop_col)
|
||||
if (length(plist) >= 1) pred_sets <- append(pred_sets, list(plist[1]))
|
||||
if (length(plist) >= 2) pred_sets <- append(pred_sets, list(plist[1:2]))
|
||||
}
|
||||
|
||||
pred_sets <- pred_sets[lengths(pred_sets) > 0]
|
||||
|
||||
choose_knn_vars <- function(df, exclude, k = 3) {
|
||||
cands <- names(df)[endsWith(names(df), ".new") & names(df) != exclude]
|
||||
cands <- cands[sapply(cands, function(c) is.numeric(df[[c]]))]
|
||||
miss <- sapply(cands, function(c) mean(is.na(df[[c]])))
|
||||
ord <- order(miss, cands)
|
||||
head(cands[ord], k)
|
||||
}
|
||||
|
||||
knn1 <- if (!is.na(opt$knn1)) {
|
||||
strsplit(opt$knn1, ",", fixed = TRUE)[[1]] |> trimws()
|
||||
} else {
|
||||
choose_knn_vars(df, response, 3)
|
||||
}
|
||||
|
||||
knn2 <- if (!is.na(opt$knn2)) {
|
||||
strsplit(opt$knn2, ",", fixed = TRUE)[[1]] |> trimws()
|
||||
} else {
|
||||
setdiff(choose_knn_vars(df, response, 6), knn1)[1:3]
|
||||
}
|
||||
|
||||
ctx <- list(
|
||||
data = normalizePath(opt$data),
|
||||
region_col = region_col,
|
||||
response = response,
|
||||
region_a = region_a,
|
||||
region_b = region_b,
|
||||
predictors = pred_sets,
|
||||
knn1 = knn1,
|
||||
knn2 = knn2,
|
||||
k = opt$k,
|
||||
fig_dir = "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures",
|
||||
stats_dir = "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/stats"
|
||||
)
|
||||
|
||||
|
||||
writeLines(jsonlite::toJSON(ctx, pretty = TRUE, auto_unbox = TRUE), "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/ctx.json")
|
||||
message("wrote ctx.json")
|
||||
@@ -0,0 +1,27 @@
|
||||
source("/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/R/00_utils.R")
|
||||
ctx <- jsonlite::fromJSON("/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/ctx.json")
|
||||
df <- suppressMessages(readr::read_csv(ctx$data, show_col_types = FALSE))
|
||||
|
||||
va <- df |> dplyr::filter(.data[[ctx$region_col]] == ctx$region_a) |> dplyr::pull(all_of(ctx$response)) |> as.numeric()
|
||||
vb <- df |> dplyr::filter(.data[[ctx$region_col]] == ctx$region_b) |> dplyr::pull(all_of(ctx$response)) |> as.numeric()
|
||||
|
||||
box_a_path <- file.path(ctx$fig_dir, paste0("box_", sanitize(ctx$region_a), "_", sanitize(ctx$response), ".png"))
|
||||
box_b_path <- file.path(ctx$fig_dir, paste0("box_", sanitize(ctx$region_b), "_", sanitize(ctx$response), ".png"))
|
||||
hist_a_path <- file.path(ctx$fig_dir, paste0("hist_", sanitize(ctx$region_a), "_", sanitize(ctx$response), ".png"))
|
||||
hist_b_path <- file.path(ctx$fig_dir, paste0("hist_", sanitize(ctx$region_b), "_", sanitize(ctx$response), ".png"))
|
||||
qq_path <- file.path(ctx$fig_dir, paste0("qq_", sanitize(ctx$response), "_", sanitize(ctx$region_a), "_vs_", sanitize(ctx$region_b), ".png"))
|
||||
|
||||
save_plot(box_plot(va, paste0(ctx$response, " (", ctx$region_a, ")")), box_a_path)
|
||||
save_plot(box_plot(vb, paste0(ctx$response, " (", ctx$region_b, ")")), box_b_path)
|
||||
save_plot(hist_density_plot(va, paste0(ctx$response, " (", ctx$region_a, ")")), hist_a_path)
|
||||
save_plot(hist_density_plot(vb, paste0(ctx$response, " (", ctx$region_b, ")")), hist_b_path)
|
||||
qp <- qq_two_sample(va, vb, paste0("qq plot: ", ctx$region_a, " vs ", ctx$region_b))
|
||||
if (!is.null(qp)) save_plot(qp, qq_path)
|
||||
|
||||
ctx$box_a <- box_a_path
|
||||
ctx$box_b <- box_b_path
|
||||
ctx$hist_a <- hist_a_path
|
||||
ctx$hist_b <- hist_b_path
|
||||
ctx$qq_fig <- qq_path
|
||||
writeLines(jsonlite::toJSON(ctx, pretty = TRUE, auto_unbox = TRUE), "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/ctx.json")
|
||||
message("plots done")
|
||||
@@ -0,0 +1,59 @@
|
||||
source("/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/R/00_utils.R")
|
||||
ctx <- jsonlite::fromJSON("/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/ctx.json")
|
||||
df <- suppressMessages(readr::read_csv(ctx$data, show_col_types = FALSE))
|
||||
|
||||
fit_ols <- function(data, y_col, x_cols, name_tag, fig_dir, stats_dir) {
|
||||
d <- data |> dplyr::select(all_of(c(y_col, x_cols))) |> tidyr::drop_na()
|
||||
for (xc in x_cols) d[[xc]] <- tf_pos(d[[xc]])
|
||||
f <- as.formula(paste(y_col, "~", paste(x_cols, collapse = " + ")))
|
||||
m <- lm(f, data = d)
|
||||
|
||||
# residuals vs fitted
|
||||
res_path <- file.path(fig_dir, paste0("residuals_", sanitize(name_tag), ".png"))
|
||||
p_res <- tibble(fitted = fitted(m), resid = resid(m)) |>
|
||||
ggplot(aes(fitted, resid)) +
|
||||
geom_point(size = 1.6) +
|
||||
geom_hline(yintercept = 0) +
|
||||
labs(title = paste("residuals vs fitted:", name_tag),
|
||||
x = "fitted", y = "residuals") +
|
||||
theme_minimal()
|
||||
save_plot(p_res, res_path)
|
||||
|
||||
# scatter first predictor vs response
|
||||
first <- x_cols[1]
|
||||
sc_path <- file.path(fig_dir, paste0("scatter_", sanitize(name_tag), "_", sanitize(first), ".png"))
|
||||
p_sc <- d |>
|
||||
ggplot(aes(.data[[first]], .data[[y_col]])) +
|
||||
geom_point(size = 1.6) +
|
||||
labs(title = paste(first, "vs", y_col), x = first, y = y_col) +
|
||||
theme_minimal()
|
||||
save_plot(p_sc, sc_path)
|
||||
|
||||
# summary to text
|
||||
summ_path <- file.path(stats_dir, paste0("ols_", sanitize(name_tag), ".txt"))
|
||||
capture.output(summary(m), file = summ_path)
|
||||
|
||||
gl <- broom::glance(m)
|
||||
list(
|
||||
name = name_tag,
|
||||
rsq = unname(gl$r.squared),
|
||||
aic = unname(gl$AIC),
|
||||
bic = unname(gl$BIC),
|
||||
nobs = stats::nobs(m),
|
||||
summary_file = summ_path,
|
||||
residuals_fig = res_path,
|
||||
scatter_fig = sc_path
|
||||
)
|
||||
}
|
||||
|
||||
ols <- list()
|
||||
if (length(ctx$predictors)) {
|
||||
for (p in ctx$predictors) {
|
||||
tag <- paste0("full: ", ctx$response, " ~ ", paste(p, collapse = " + "))
|
||||
ols <- append(ols, list(fit_ols(df, ctx$response, p, tag, ctx$fig_dir, ctx$stats_dir)))
|
||||
}
|
||||
}
|
||||
|
||||
ctx$ols <- ols
|
||||
writeLines(jsonlite::toJSON(ctx, pretty = TRUE, auto_unbox = TRUE), "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/ctx.json")
|
||||
message("ols (full) done")
|
||||
@@ -0,0 +1,72 @@
|
||||
source("/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/R/00_utils.R")
|
||||
ctx <- jsonlite::fromJSON("/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/ctx.json")
|
||||
df <- suppressMessages(readr::read_csv(ctx$data, show_col_types = FALSE))
|
||||
reg_df <- df |> dplyr::filter(.data[[ctx$region_col]] == ctx$region_a)
|
||||
|
||||
fit_ols <- function(data, y_col, x_cols, name_tag, fig_dir, stats_dir) {
|
||||
d <- data |> dplyr::select(all_of(c(y_col, x_cols))) |> tidyr::drop_na()
|
||||
for (xc in x_cols) d[[xc]] <- tf_pos(d[[xc]])
|
||||
f <- as.formula(paste(y_col, "~", paste(x_cols, collapse = " + ")))
|
||||
m <- lm(f, data = d)
|
||||
|
||||
res_path <- file.path(fig_dir, paste0("residuals_", sanitize(name_tag), ".png"))
|
||||
p_res <- tibble(fitted = fitted(m), resid = resid(m)) |>
|
||||
ggplot(aes(fitted, resid)) +
|
||||
geom_point(size = 1.6) +
|
||||
geom_hline(yintercept = 0) +
|
||||
labs(title = paste("residuals vs fitted:", name_tag),
|
||||
x = "fitted", y = "residuals") +
|
||||
theme_minimal()
|
||||
save_plot(p_res, res_path)
|
||||
|
||||
first <- x_cols[1]
|
||||
sc_path <- file.path(fig_dir, paste0("scatter_", sanitize(name_tag), "_", sanitize(first), ".png"))
|
||||
p_sc <- d |>
|
||||
ggplot(aes(.data[[first]], .data[[y_col]])) +
|
||||
geom_point(size = 1.6) +
|
||||
labs(title = paste(first, "vs", y_col), x = first, y = y_col) +
|
||||
theme_minimal()
|
||||
save_plot(p_sc, sc_path)
|
||||
|
||||
summ_path <- file.path(stats_dir, paste0("ols_", sanitize(name_tag), ".txt"))
|
||||
capture.output(summary(m), file = summ_path)
|
||||
|
||||
gl <- broom::glance(m)
|
||||
list(
|
||||
name = name_tag,
|
||||
rsq = unname(gl$r.squared),
|
||||
aic = unname(gl$AIC),
|
||||
bic = unname(gl$BIC),
|
||||
nobs = stats::nobs(m),
|
||||
summary_file = summ_path,
|
||||
residuals_fig = res_path,
|
||||
scatter_fig = sc_path
|
||||
)
|
||||
}
|
||||
|
||||
region_models <- list()
|
||||
if (length(ctx$predictors)) {
|
||||
for (p in ctx$predictors) {
|
||||
tag <- paste0("region ", ctx$region_a, ": ", ctx$response, " ~ ", paste(p, collapse = " + "))
|
||||
region_models <- append(region_models, list(fit_ols(reg_df, ctx$response, p, tag, ctx$fig_dir, ctx$stats_dir)))
|
||||
}
|
||||
}
|
||||
|
||||
best_note <- "no region-level comparison available."
|
||||
if (length(region_models) >= 1) {
|
||||
ord <- order(
|
||||
sapply(region_models, `[[`, "rsq"),
|
||||
-sapply(region_models, `[[`, "aic"),
|
||||
-sapply(region_models, `[[`, "bic"),
|
||||
decreasing = TRUE
|
||||
)
|
||||
best <- region_models[[ord[1]]]
|
||||
best_note <- sprintf(
|
||||
"on region `%s`, the better model is **%s** (r²=%.3f, aic=%.1f, bic=%.1f).",
|
||||
ctx$region_a, best$name, best$rsq, best$aic, best$bic
|
||||
)
|
||||
}
|
||||
|
||||
ctx$best_region_note <- best_note
|
||||
writeLines(jsonlite::toJSON(ctx, pretty = TRUE, auto_unbox = TRUE), "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/ctx.json")
|
||||
message("ols (region) done")
|
||||
@@ -0,0 +1,11 @@
|
||||
source("/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/R/00_utils.R")
|
||||
ctx <- jsonlite::fromJSON("/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/ctx.json")
|
||||
df <- suppressMessages(readr::read_csv(ctx$data, show_col_types = FALSE))
|
||||
|
||||
set.seed(42)
|
||||
knn1 <- run_knn(df, ctx$region_col, ctx$knn1, ctx$k, "model A", ctx$fig_dir)
|
||||
knn2 <- run_knn(df, ctx$region_col, ctx$knn2, ctx$k, "model B", ctx$fig_dir)
|
||||
|
||||
ctx$knn <- list(knn1, knn2)
|
||||
writeLines(jsonlite::toJSON(ctx, pretty = TRUE, auto_unbox = TRUE), "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/ctx.json")
|
||||
message("knn done")
|
||||
@@ -0,0 +1,89 @@
|
||||
library(markdown)
|
||||
|
||||
source("/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/R/00_utils.R")
|
||||
ctx <- jsonlite::fromJSON("/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/ctx.json")
|
||||
|
||||
md <- c(
|
||||
"# exploratory data analysis and models on the epi dataset",
|
||||
paste0("date: ", as.character(Sys.Date()), " "),
|
||||
"",
|
||||
"## dataset and choices",
|
||||
# I regret my life choices
|
||||
paste0("- **file**: `", basename(ctx$data), "`"),
|
||||
paste0("- **region column**: `", ctx$region_col, "`"),
|
||||
paste0("- **response var**: `", ctx$response, "`"),
|
||||
paste0("- **regions**: `", ctx$region_a, "` vs `", ctx$region_b, "`"),
|
||||
"",
|
||||
"## 1) variable distributions",
|
||||
"### 1.1 boxplots and histograms (with density!)",
|
||||
paste0(""),
|
||||
paste0(""),
|
||||
paste0(""),
|
||||
paste0(""),
|
||||
"",
|
||||
"### 1.2 qq plot (two-sample)",
|
||||
paste0(""),
|
||||
"",
|
||||
"## 2) linear models"
|
||||
)
|
||||
|
||||
# Normalize data.frame because NOTHING WORKS
|
||||
row_list <- function(x) {
|
||||
if (is.null(x)) return(list())
|
||||
if (is.data.frame(x)) {
|
||||
lapply(seq_len(nrow(x)), function(i) as.list(x[i, , drop = FALSE]))
|
||||
} else if (is.list(x)) {
|
||||
x
|
||||
} else {
|
||||
list()
|
||||
}
|
||||
}
|
||||
|
||||
if (!is.null(ctx$ols) && length(ctx$ols)) {
|
||||
for (m in row_list(ctx$ols)) {
|
||||
md <- c(md,
|
||||
paste0("### ", m$name),
|
||||
sprintf("- **r²**: %.4f | **aic**: %.2f | **bic**: %.2f", m$r2, m$aic, m$bic),
|
||||
""
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
md <- c(md,
|
||||
"### 2.2 same models on one region (comparison)",
|
||||
if (!is.null(ctx$best_region_note)) ctx$best_region_note else "no note available.",
|
||||
"",
|
||||
"## 3) classification (knn, label = region)"
|
||||
)
|
||||
|
||||
if (!is.null(ctx$knn) && length(ctx$knn)) {
|
||||
for (k in row_list(ctx$knn)) {
|
||||
md <- c(md,
|
||||
paste0("### ", k$tag),
|
||||
sprintf("- **k**: %d | **accuracy**: %.4f | **test n**: %d",
|
||||
k$k, k$accuracy, k$n_test),
|
||||
paste0("variables: `", paste(k$vars, collapse = ", "), "`"),
|
||||
paste0(""),
|
||||
""
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
# I hate markdown sometimes man
|
||||
md <- gsub("/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/", "", md)
|
||||
|
||||
# writeLines(md, "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/report.md")
|
||||
# writeLines(jsonlite::toJSON(ctx, pretty = TRUE, auto_unbox = TRUE),
|
||||
# file.path(ctx$stats_dir, "summary.json"))
|
||||
|
||||
md_file <- "output/report.md"
|
||||
html_file <- "output/report.html"
|
||||
pdf_file <- "output/report.pdf"
|
||||
|
||||
setwd("/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/")
|
||||
markdownToHTML(
|
||||
md_file,
|
||||
html_file
|
||||
)
|
||||
|
||||
message("done")
|
||||
@@ -0,0 +1,181 @@
|
||||
code,iso,country,region,population,gdp,EPI.old,EPI.new,ECO.old,ECO.new,BDH.old,BDH.new,MKP.old,MKP.new,MHP.old,MHP.new,MPE.old,MPE.new,PAR.old,PAR.new,SPI.old,SPI.new,TBN.old,TBN.new,TKP.old,TKP.new,PAE.old,PAE.new,PHL.old,PHL.new,RLI.old,RLI.new,SHI.old,SHI.new,BER.old,BER.new,ECS.old,ECS.new,PFL.old,PFL.new,IFL.old,IFL.new,FCL.old,FCL.new,TCG.old,TCG.new,FLI.old,FLI.new,FSH.old,FSH.new,FSS.old,FSS.new,FCD.old,FCD.new,BTZ.old,BTZ.new,BTO.old,BTO.new,RMS.old,RMS.new,APO.old,APO.new,OEB.old,OEB.new,OEC.old,OEC.new,NXA.old,NXA.new,SDA.old,SDA.new,AGR.old,AGR.new,SNM.old,SNM.new,PSU.old,PSU.new,PRS.old,PRS.new,RCY.old,RCY.new,WRS.old,WRS.new,WWG.old,WWG.new,WWC.old,WWC.new,WWT.old,WWT.new,WWR.old,WWR.new,HLT.old,HLT.new,AIR.old,AIR.new,HPE.old,HPE.new,HFD.old,HFD.new,OZD.old,OZD.new,NOD.old,NOD.new,SOE.old,SOE.new,COE.old,COE.new,VOE.old,VOE.new,H2O.old,H2O.new,USD.old,USD.new,UWD.old,UWD.new,HMT.old,HMT.new,LED.old,LED.new,WMG.old,WMG.new,WPC.old,WPC.new,SMW.old,SMW.new,WRR.old,WRR.new,PCC.old,PCC.new,CCH.old,CCH.new,CDA.old,CDA.new,CDF.old,CDF.new,CHA.old,CHA.new,FGA.old,FGA.new,NDA.old,NDA.new,BCA.old,BCA.new,LUF.old,LUF.new,GTI.old,GTI.new,GTP.old,GTP.new,GHN.old,GHN.new,CBP.old,CBP.new
|
||||
4,AFG,Afghanistan,Southern Asia,41454761,2116,18,30.7,21.1,31.2,25.6,32.1,NA,NA,NA,NA,NA,NA,0.3,0.3,0.6,9.1,0.3,11.7,24.6,24.6,79.5,79.5,80.9,80.9,75.8,75.6,67.8,66.4,50.1,50.5,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,5.2,42,19.4,18,39.9,37.6,0,34.2,0,55.5,45,41.1,35.3,31.2,100,97.2,60.6,52,40.2,41.9,9,9,89.7,89.7,0,0,0,0,0,0,17.7,18.2,16.8,15.8,22.8,18.8,1.1,3.6,7.5,10.3,33.4,34.9,63.5,58.7,51,50.2,36.5,37.1,26.2,32.3,20.7,31,22.3,33.1,0,0,0,0,25.2,25.2,60.6,60.6,0,0,2.4,2.4,13.7,40.2,13.7,40.2,0,38.4,0,100,4.2,48,36.8,4.3,9.3,50.8,1.2,39.3,42.2,44.4,0.7,35,8.1,46.7,17.9,22.6,97.7,97.7
|
||||
8,ALB,Albania,Eastern Europe,2811655,22730,45.9,52.1,50.3,51.8,50.9,50.6,21.2,25.5,24.4,24.4,100,96.7,46.4,46.4,54.4,56.8,54.2,60.7,58.4,58.4,65.2,65.2,63.4,63.4,70.5,70,78.4,53.5,44.3,45.1,58.4,62.4,NA,NA,NA,NA,65,71.7,36.5,36.5,67.5,67.5,13.7,15.8,NA,NA,24.2,24,9,3.5,5.6,7.8,100,100,80.3,74.5,25.8,25.9,23.3,21.8,100,100,100,69.2,48.4,50.4,20.3,22,35.7,36.2,67,65.7,68.6,73.6,21.8,39.2,64.8,56.6,19,26.5,10.9,49,33.4,33.4,40,43.8,32,36.5,32.8,36.6,19.3,27.6,43.6,60.2,37.5,34.5,39,44.6,59.6,64.4,48.9,47.2,68.1,71.3,67.1,73.2,65.4,70,50.5,51.5,50.7,51.5,16.4,16.4,35.6,35.6,0,0,5.3,5.3,44.1,59.4,44.1,59.4,37.8,54.7,47.5,77.2,82.4,87.6,36.8,3.8,72.3,100,65.5,100,49.7,50,43.3,56.9,44,56.3,32.7,39.5,87.6,87.6
|
||||
12,DZA,Algeria,Greater Middle East,46164219,18340,38.6,41.9,39.7,42.2,33.1,33,0,0,0,0,100,100,6.1,6.1,73.2,73.8,4.2,4.3,6,6,20.3,20.3,58.8,58.8,74.3,73.8,78.1,74,54.7,54.5,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,53.1,51.6,85.6,75.7,40.8,37.7,44.8,49.2,45.3,50.1,20.8,58.2,49.7,63.7,25.8,18.7,12,7.8,7.1,60.7,100,86.8,42.9,46.7,35,38.6,100,100,76.7,74.6,39.8,38.7,53.1,55.9,62.7,62.7,65,72,41.7,41.7,41.7,41.7,48,48.1,47.3,46.1,46.8,37.1,52.8,64.5,30.5,29.6,33.6,31.3,36.5,24,54,42.7,33.2,27.9,61.6,64.7,61,68.8,57.4,62,26.6,29.2,24.4,29.2,34.3,37.6,44.6,47.8,61.6,71.6,10.3,10.5,29.3,36.2,29.3,36.2,34.8,40.7,21.3,30.4,48,40.5,34.3,12.6,9.4,46.1,3.8,59.8,49.3,49.7,29.8,32.1,32.1,34.7,7.7,6.9,51.5,51.5
|
||||
24,AGO,Angola,Sub-Saharan Africa,36749906,9910,31.6,39.7,35.9,43.2,42.3,41.5,0,0,0,0,NA,NA,35.6,35.6,37.1,37.1,34.1,34.1,74.7,74.7,82.1,82.1,89.8,89.8,77.8,77.7,85.1,71.6,57.7,55.6,50.8,49.2,68.5,50.5,41.1,49.3,58.1,49.1,27.9,27.9,83.5,83.5,38.8,37.6,21,29,48.1,45.4,27.2,26.9,38.5,43.4,59.3,45.3,13.5,73.2,69.5,69.1,87.5,84.4,0,69.6,0,75.4,39.3,41,33,35.2,81.6,97.5,97,97.8,24,18.4,13.8,13.8,86.5,86.5,7.6,7.6,4.3,4.3,4.3,4.3,19.4,21.6,18.9,19.9,14.4,15.4,8.2,13.8,24.4,32.7,43.7,43.6,63.7,60.3,37.5,43.2,4.3,9.8,16.2,22.9,10,23.4,10,22.6,28.7,30.4,26.9,30.4,26.1,26.1,64.1,64.1,0,0,1.1,1.1,35.2,49.4,35.2,49.4,26.4,54.7,78.8,100,55.5,54.7,36.8,3.7,49.2,49,5.8,52.5,47.9,48,38.3,48.8,42.5,52.9,15.3,20.4,88.5,88.5
|
||||
28,ATG,Antigua and Barbuda,Latin America & Caribbean,93316,31474,54.4,55.5,52.4,53.2,52.5,52.8,74.7,74.7,33.1,33.1,60.3,88.5,NA,NA,19.6,19.9,51.5,51.5,72.9,72.9,28.3,28.3,90,90,67.3,64,NA,NA,93.7,91.4,35.4,28.7,0,0,NA,NA,70.6,59,30.2,30.2,46.1,46.1,97.6,97.3,81.5,100,NA,NA,100,100,100,100,51.3,56.4,64.6,72,40,36.2,44.4,39.6,39.5,84.8,76.3,72.9,30.2,31.4,5.2,3.8,40.2,39.8,29.4,41.2,54.1,54.1,48.2,48.2,56.5,56.7,50.8,50.8,44.4,44.4,44.4,44.4,65.7,69.6,72.8,77.8,93.9,93.5,57.3,62.7,100,100,42.2,35.1,63,68.8,82.6,85.8,87.3,91,55.6,56.9,53.3,56,56,57.5,45.8,48.5,46.1,48.5,35.6,35.6,39,39,100,100,0,0,47.1,46.4,47.1,46.4,42.1,46.3,22.8,28.8,67.9,57.4,NA,NA,52.1,57.5,57.2,59.9,50.3,50.2,39.1,42.6,36.8,39,51.5,51.6,54,54
|
||||
32,ARG,Argentina,Latin America & Caribbean,45538401,30380,45.9,46.8,41.7,47.1,32,35,13.4,17.1,9.5,33,68.2,89.1,14.9,14.9,30.9,32.9,26,27.9,40.5,40.5,37.6,37.6,71.6,71.6,54.4,54.2,69.6,48.2,39.9,39.3,35.6,48.9,47.2,62.7,44.9,51.3,21.4,44.2,0,0,72.2,72.2,52,38.5,77.5,70.5,53.4,50.8,12.8,26.8,15.8,24.6,49.9,48.3,57,80.5,80.1,77,94.4,92.5,36.7,69,62,90.4,84.1,81.4,82.6,87.7,100,100,37.3,29.5,80.8,95.3,48.5,48.5,32.8,32.8,55,55,55,55,11.8,11.8,52.1,52.9,48.1,47.6,47.9,44.6,47.8,54.5,49,48.6,11.6,18.2,65.6,66.9,66.4,64.5,14.2,17.4,64.4,68.3,61.6,70.2,60.2,67.1,68,72.8,65.8,72.8,26.6,26.6,32.5,32.5,56.1,56.1,6,6,47.1,41.4,47.1,41.4,41.8,50.8,30.7,44.8,87.6,46.6,42.6,6.8,58.4,27.3,41.7,54.3,45.1,48.5,44.9,43.4,39.9,39.1,7.4,6.6,53,53
|
||||
51,ARM,Armenia,Former Soviet States,2943393,24970,42.5,44.7,46.8,47.8,48.4,47.4,NA,NA,NA,NA,NA,NA,14.4,14.4,38.7,38.7,76.4,77.2,39.5,39.5,49.8,49.8,71.5,71.5,49.9,47.9,92.4,80.4,41.5,43.4,80.3,83.4,NA,NA,NA,NA,88.8,99.3,58.2,58.2,54.2,54.2,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,38.7,54.2,40.9,37.3,45.3,40.6,41.2,18.6,50.8,95.8,56.6,35.5,29.7,13.1,100,100,66.3,49.3,59.9,46.7,31.9,35.8,0,0,38,42.9,38,42.9,14.6,14.6,38.5,41.2,29.1,30.9,22.9,19.3,26.5,38.5,27.2,35.2,29.6,28.3,35.6,35.2,58.4,59.7,47.1,43.2,69.1,74.2,59.8,68.7,67.1,77.8,49.9,54.8,45.7,54.8,23.5,24.8,54.3,57.4,0,0,4.5,4.5,39.3,42.8,39.3,42.8,37.3,39,38.9,41.9,60.3,79.3,36.7,3.8,6.7,39.2,36,74.4,43.3,46.9,35.1,38.9,36,38.1,31.8,31.3,69.2,69.2
|
||||
36,AUS,Australia,Global West,26451124,71310,59,63,60.7,63.3,50.6,55.4,36.5,57.2,30.1,42.5,45,57.2,50.9,50.9,53.5,65.8,44.2,67.1,58.1,58.1,89.1,89.1,92.2,92.2,48,39.5,82.7,50.3,36.1,35.8,60.2,42.3,97.5,97.4,21.1,0,64.7,20.1,44.9,44.9,72.2,72.2,48.5,48.1,29.4,28.6,45.4,47.7,46.3,51.1,49,53.3,77.6,57.2,87.4,95.9,79,77.3,86.2,82.1,91.2,98.2,79.7,100,53.8,65.3,52.9,49.7,53.4,51.8,57.5,59,58.9,84.7,88.9,89.1,26.2,26.2,100,100,92.4,92.9,92.9,92.9,79.6,82,78.5,81,90,94.9,80.6,85.1,85.5,71,16.5,26.4,33.3,42.2,77.5,86.5,16.8,18.3,89.8,90.9,89,91.6,89.3,90.5,80.4,86.3,75.4,86.3,45.4,45.7,25.2,27.6,90.2,91.3,43.1,41.1,39.1,46.6,39.1,46.6,47.8,50.8,20.1,24,44.6,82.4,39.8,31.9,39.7,77.7,41.7,49.6,47.7,49.5,38,47.5,20.4,30.2,2.7,5.9,43.5,43.5
|
||||
40,AUT,Austria,Global West,9130429,74981,68.9,69,78.4,78.2,74.6,74.4,NA,NA,NA,NA,NA,NA,86.4,86.4,78.9,83.6,85.7,86.9,70.6,70.6,76.7,76.7,57.9,57.9,62.6,59.1,74,59.9,48.1,48,58.9,47.5,NA,NA,NA,NA,66.7,53.4,38.7,38.7,35.6,35.6,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,93.1,92.9,56.3,54.2,65.5,61,100,100,100,100,68.9,72.5,64.6,64,41,40.9,75.3,71.6,71.5,84.1,88.1,89.5,0,10.8,100,100,95.2,96,100,100,65.4,70,56.4,61.5,30.8,46.1,83.7,88.9,41.6,39.3,20.1,25.5,54.2,61.1,51.7,57.4,50.8,50.2,89,92.6,79.9,87.7,88.5,95.8,82.5,88.3,78.4,88.3,67.2,63.8,23.8,12.2,97.9,99.5,95.2,97.6,57.3,54.1,57.3,54.1,62.1,52.5,50.8,36.9,72.7,77.3,47.1,40.4,55.2,60.5,100,100,51.5,51.4,57.4,53,47.6,44.5,23.2,20.6,61.5,61.5
|
||||
31,AZE,Azerbaijan,Former Soviet States,10318207,25480,40.4,40.4,44.7,44.4,36.3,36.9,0.8,0.8,20,20,50,50,7.2,7.2,42.1,43.1,31.3,31.4,41.3,41.3,55.2,55.2,31,31,80.8,81.2,86,80.1,24.1,25.8,79.5,82.3,NA,NA,NA,NA,92.1,98.3,50.7,50.7,65.4,65.4,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,77.1,67,45,39.3,56.4,49.8,70.5,60.3,100,82.7,62.7,63,45.8,48.1,100,100,80.7,64.2,55.3,74.4,23.2,28.9,43,44,18.9,25.9,18.9,25.9,38.1,38.1,38.1,40.2,36.1,38.2,36.3,37.9,24,36.8,41.2,37.1,37.6,36.4,35.5,39.3,60.9,63.1,40.3,41.6,45,48.2,39.8,45.2,44.6,50.2,40.9,46.8,37,46.8,31.2,21.6,47.7,34.5,22.7,13.8,18.9,12.6,36.1,34.7,36.1,34.7,52.8,44.5,50.5,37.3,0,21.2,23,25.8,24,11.3,28.3,50.7,48.4,47.2,36.9,33.5,36.6,33,18.9,16.9,48.4,48.4
|
||||
44,BHS,Bahamas,Latin America & Caribbean,399440,37517,54.6,56,54.7,53.9,47,46.8,25.1,25.1,17.4,17.4,53,77.8,80.1,80.1,21.6,21.6,79.3,82.6,46.2,46.2,100,100,100,100,8.1,3.1,99.4,98.2,100,100,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,91.5,91.6,64.7,59,100,100,100,100,100,100,46.9,56,70,66.1,20.2,16.5,13.6,8.4,63.9,79.8,80,73.9,50.8,50.2,37.8,39.9,29.7,30.8,23.6,23.3,73.3,73.3,61.9,61.9,28.6,28.6,68.9,68.9,63,63,63,63,67.7,69.4,74.7,76.4,99,97.1,63,65.4,55.9,65.9,22.9,23.6,62.3,70.9,78,83,79.5,86.5,62.7,63.8,65.7,68.7,59.3,60.5,50.4,53.9,47.9,53.9,8.7,8.7,18.8,18.8,0,0,2.9,2.9,42.7,47.6,42.7,47.6,45.9,49,32.6,37.3,33.9,40.9,NA,NA,38.3,69.4,70.5,58.5,50,50.1,43.6,47.9,38.4,42.7,41.9,42.9,61.3,61.3
|
||||
48,BHR,Bahrain,Greater Middle East,1569666,66975,37.1,35.9,45.9,38.6,26.8,26,67.3,67.3,44.3,59.4,100,30.8,NA,NA,3.7,3.7,8.7,8.7,0,0,NA,NA,NA,NA,21.7,13.3,NA,NA,46.2,45.6,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,66.4,68.9,NA,NA,27,30.6,100,100,65.5,67.6,18.7,75.8,73.3,32.5,0,0,0,0,76,60.7,66.4,17.2,38,42.5,8.2,21.7,45.3,35.5,61.1,58.5,57.2,57.2,83.2,80.9,20.4,20,88,81,98.6,100,64.9,64.9,39.6,40.9,32.8,32.7,9.5,3.8,63.6,71.7,13.9,15.2,5.6,7.9,11,9.2,45.5,37.5,27,22.8,65.3,66.9,65.6,69.9,62.7,64.9,42.8,48,36.3,48,20,34.6,0,3.2,100,98.5,0,34,23.4,27.9,23.4,27.9,27.7,39.5,0,5.8,12.9,42.9,48.3,10.2,28.5,35.7,100,100,NA,NA,10.2,24.7,0,1.5,16,17,3.8,3.8
|
||||
50,BGD,Bangladesh,Southern Asia,171466990,10370,25.5,27.8,27.3,31.4,20.7,29.1,21,32.6,4.8,61.1,50,91.2,0,0,19.8,19.8,13.1,14,23.9,23.9,1.4,1.4,51,51,25.4,13.2,92.7,80.1,0.3,0.4,61.9,51.4,62.9,59.9,NA,NA,65.4,31.2,75,75,53.9,53.9,62.4,63.2,98.2,88.6,60.3,58.4,69.8,58.6,71.2,60.4,43.2,49,11.9,13.3,33.1,27.3,41.5,35.4,18.8,19.5,0,0,71.1,72.2,52.9,54.4,50.6,29.7,74.2,56.6,85.3,100,14.1,14,48,48.9,2.9,2.9,19.9,19.4,2,2,13.4,15,5.6,6.3,0,0,3.2,7,1.1,2.4,40.8,40,21.6,17.8,5.1,3.2,16.8,15.8,28.8,31.9,25,30.9,27,32.6,22.3,27,17.8,27,51.5,52.9,96.5,99.5,58.6,59.1,3,3.1,32.8,33,32.8,33,24.7,27.4,63.7,69.1,31.3,42.1,36.7,3.7,23.1,32.7,36.4,46.9,48.7,46.1,30.3,34.2,33.3,35.5,8.3,6.8,87.1,87.1
|
||||
52,BRB,Barbados,Latin America & Caribbean,282336,22035,50.5,53.1,34.1,35,11.8,12.5,0,0,0,0,50,100,NA,NA,1,1.2,1.6,1.6,1.7,1.7,NA,NA,NA,NA,58.9,54.7,NA,NA,19,19.5,42.5,45.4,NA,NA,NA,NA,36.6,47.6,60.1,60.1,5,5,77.9,80.4,11.8,6,86.4,77.4,100,100,100,100,NA,NA,67.8,70,48.5,43.6,54.7,48.8,41,74.8,73.1,74.6,48.7,47.9,61.6,41.4,23.8,20.3,0,13.5,71,71,49.5,49.5,33.8,33.8,55.1,55.1,48.2,48.2,48.2,48.2,76.5,77.4,85.2,85.8,100,100,75.6,76.5,100,100,20.8,25,87.1,92.5,83,85.4,94.1,96.3,59.1,59.8,58.7,61.1,58.1,59,62.7,65.7,62.2,65.7,42.9,46,32.6,8.9,100,100,24.7,56.2,50.5,56.7,50.5,56.7,47.3,59.2,38.1,56.4,61,49.5,NA,NA,42.4,53.8,55.1,54.8,54.6,66.4,40.5,56.1,39.8,55.4,44,55.2,82.3,82.3
|
||||
112,BLR,Belarus,Former Soviet States,9115680,33600,49.3,58.1,60.4,68.1,53.9,70.3,NA,NA,NA,NA,NA,NA,36.2,36.2,13.4,90.6,44.8,45.5,93.7,93.7,23.9,23.9,72.3,72.3,88.9,92.4,87.7,77.8,0,0,63.5,52.5,NA,NA,NA,NA,61.6,44.5,80.6,80.6,36.2,36.2,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,79.8,81.9,56.1,58.1,65,68.2,56,100,100,71.4,49,45.2,30.2,29.7,33.2,44.2,70.7,73.1,56.7,49.2,66.4,63.2,23.6,16.3,78.5,78.5,65.8,59.6,62.8,62.8,49.6,55.8,43.7,51.3,26.1,44.4,46.4,58.1,48.7,66.3,21.8,15.9,47.7,50.3,61.6,65.4,63.6,65.2,74.3,74.5,71.4,71.9,76.5,76.2,48.9,53,44.6,53,29.1,44.3,25.5,32,70.8,95.1,11.9,31.1,32.1,44.5,32.1,44.5,47,50.8,29.9,35.5,32.8,50.5,2,30.1,0,49.9,10.3,69.5,49.7,49.4,26.8,41.4,24,38.4,12.8,17.1,50.5,50.5
|
||||
56,BEL,Belgium,Global West,11712893,75199,62,66.7,61.6,69.1,53.2,66.4,45.5,45.5,80,80,48.5,47.1,70.4,70.4,38.7,96,24,51.6,46.1,46.1,3,3,70.8,70.8,93.8,92.7,45,48,16.5,16.7,48.8,43.6,NA,NA,NA,NA,47.8,47.5,48.5,48.5,13.9,13.9,7.8,8,NA,NA,15.2,15.7,0,0,0,3.2,44.5,51.4,95.4,94.3,68.1,61.6,80.8,70.2,100,100,100,100,68.9,68.5,44.7,43.6,27.6,29.3,62.1,61.6,99.6,99.6,81.6,83.6,29.3,29.3,95.2,98,81.9,84,78.2,78.2,66.5,70.8,59.5,64.8,30.4,48.7,87.1,92.7,44.6,44.8,10.7,24.9,43.1,54.7,49.9,60.2,63.4,67,86.4,88.2,82.9,87.4,86.3,88.7,74.4,81.3,68.9,81.3,70,65.1,31.9,14.3,96.6,99.3,94.9,98.9,59,59.7,59,59.7,70,56.8,59.9,41,63.3,100,28.6,60.5,39.6,61.8,100,100,48.8,47.2,59,55.8,48.1,46.2,23,19.8,64.7,64.7
|
||||
84,BLZ,Belize,Latin America & Caribbean,411106,14958,46.5,47.4,55.8,57.3,57.6,58.4,25.9,25.9,36.1,36.7,50,97.4,100,100,90.3,90.3,94.6,94.6,39.8,39.8,89.5,89.5,99.4,99.4,31.7,29.9,26,0,87.6,83.2,42,42.3,46.7,48.2,63.1,56.3,28.9,28.6,8.1,8.1,60.5,60.5,86.3,86.7,NA,NA,40.4,54.4,75.1,100,99.7,100,61.4,55.6,66,71,63.3,62.4,71,69.6,31.2,71.2,74.9,72.9,55.8,60.9,66.8,57.4,41,23.4,39.2,42,68.1,75.5,37.9,37.9,50.9,50.9,43.2,43.2,31,31,31,31,41.5,43.3,39.8,41.3,43.6,47.7,23.5,28,49.6,46.7,45.4,50.3,81.2,84.4,68.8,75,21,18.9,48.2,50.4,46.8,51.4,46.3,49.7,50.5,54.3,48.9,54.3,19.6,19.6,44.9,44.9,5.2,5.2,1.4,1.4,36.5,35.8,36.5,35.8,42.6,32.2,55.9,37.7,2.7,40.4,44.1,28.6,0,42.7,35.4,48.1,47.6,46.3,27.1,32.1,29.4,34.3,44.7,43.8,63.8,63.8
|
||||
204,BEN,Benin,Sub-Saharan Africa,14111034,4501,37.7,37.4,51,54.6,63.8,63.7,NA,NA,0,0,NA,NA,62.6,62.6,75.5,75.5,86.1,86.1,91.7,91.7,36.3,36.3,79.3,79.3,70.7,70.7,83.9,80.4,12,10.7,54.4,53.2,92.9,85.5,NA,NA,19,28.9,14.4,14.4,58.4,58.4,87.8,88.3,NA,NA,100,100,72.7,77.2,97.4,97.9,42.4,30.3,27.4,50.4,66.5,63.5,71.7,68.9,0,44.6,17.6,49.8,50.1,54,41.3,52.6,100,100,79,71.7,42.3,44.2,10,10,97.9,97.9,0.4,0.4,0,0,0,0,24.1,25.8,23.6,25,46.8,36.1,4.5,6.1,35.8,24.5,51.8,55.6,62.4,59.4,42.2,38.4,25.8,20.1,16.4,20.1,12.1,18.9,13.6,20.9,36,38.1,34.5,38.1,48.1,41.9,100,84.3,40.6,40.6,0,0.1,30.5,22.9,30.5,22.9,23.2,22,58.5,56.2,17.3,25.4,36.8,3.8,37.7,12.1,18.5,35.9,0,0,23.4,20.4,30,26.2,26.7,23.3,82.1,82.1
|
||||
64,BTN,Bhutan,Southern Asia,786385,16754,36.4,43.3,56.4,59.5,68,67.2,NA,NA,NA,NA,NA,NA,40.9,40.9,68.2,68.2,80.2,80.2,77.8,77.8,100,100,99,99,42.3,42.3,98,87.7,100,100,87.8,86.7,93.9,94.1,70.3,87.6,87,90.1,52.5,52.5,88.4,88.4,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,25.4,50.9,32,15.6,46.4,25.4,54.8,51.5,15.4,62.4,50.5,44.7,39.8,33.8,100,67.5,85.7,74.9,34.2,41.1,23.9,23.9,64.9,64.9,25.5,25.5,14.4,14.4,14.4,14.4,18.5,22.3,13,16.8,1.1,5.2,12.4,22.2,3.3,1.7,65.7,71.1,42.9,39.4,18.3,15.9,10.5,12.2,30.3,35,20.9,27.6,28.8,40,28.3,30.5,26.6,30.5,33.7,35.8,62.3,65.5,32.4,35.5,5.7,6.2,19.6,35.3,19.6,35.3,3.8,38.2,0,58.2,35.7,17.7,NA,NA,37.1,37.5,20.4,51.3,48.3,49.6,23,31.6,25.1,32.6,39.6,39.3,64.8,64.8
|
||||
68,BOL,Bolivia,Latin America & Caribbean,12244159,11323,41.6,44.9,58.4,55.7,67.6,63.6,NA,NA,NA,NA,NA,NA,73.3,73.3,69.1,69.4,81.5,85,66.5,66.5,46.1,46.1,95.5,95.5,53.2,51.9,69,24.3,51.8,49.9,53.2,33.7,59.9,47.1,44.3,23.6,44.4,24.4,21.9,21.9,84.7,84.7,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,61,73.9,100,100,100,100,27.6,55.9,57.4,81.5,62.3,59.6,49.5,61.3,82,98.6,52.8,42.8,63.9,61.7,24.2,24.2,66.7,66.7,26.4,26.4,14,14,14,14,29.5,29.4,24.8,23,23,14.9,14.8,21.9,59.1,39.2,20.9,20.4,95.3,91,63.2,53.1,0,0,42.1,46.5,36.1,44.7,39.5,47.7,41,43.3,39.3,43.3,24.8,24.5,49.7,49.8,12.6,11.8,5.9,5.5,25.8,41.4,25.8,41.4,29.6,45,33.7,60.8,24.9,45.6,10,24.3,32.7,26.1,22.7,72.6,48.7,49.2,22.2,35,29.5,40.7,17.2,18.8,62.1,62.1
|
||||
70,BIH,Bosnia and Herzegovina,Eastern Europe,3185073,22610,42.4,45.6,48.7,51.3,43.8,45.7,NA,NA,31,31,NA,NA,55.1,55.1,19.2,22,11.2,13.2,67.5,67.5,76.1,76.1,75,75,64.6,63.5,82.7,75.4,36.7,36.7,76.3,76.2,NA,NA,NA,NA,89.9,88.4,53.7,53.7,59.9,59.9,92.5,89.9,NA,NA,82.2,81,100,100,100,100,80,4.5,77.3,75.2,28.6,29.6,57.2,54.7,55,100,50.7,63.7,31.8,52.3,21,29.1,46.8,51.2,63,52.1,22.9,75.8,20.4,23,42.8,42.8,29.6,36,2.9,2.9,31.3,31.3,32.5,36,19.3,22.9,8.6,10.5,19,24.4,39.9,40.1,39.9,38.8,25.7,31.9,56.7,60.8,36.8,35.7,75.5,78.7,72.1,77.9,74.7,79.3,45.1,48.8,43.5,48.8,17.7,17.7,37.2,37.2,14.1,14.1,0,0,41.8,45.9,41.8,45.9,32.1,50.5,8.8,36,39.2,40.8,100,43.3,6,100,17.3,34.4,50.2,49.7,22.6,43.5,25.7,42.1,21.9,26.9,57.7,57.7
|
||||
72,BWA,Botswana,Sub-Saharan Africa,2480244,20800,50.9,49,68.2,74,85.9,85.8,NA,NA,NA,NA,NA,NA,84.1,84.1,93.7,93.7,87.4,87.4,78.8,78.8,46.2,46.2,54.5,54.5,92.3,92.2,95.3,94.2,59,59.6,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,52.5,83.5,65.6,61.9,71.3,65.6,43.6,74.9,100,100,33.7,35.3,1,6,56.1,56.8,97.6,93.8,38.5,38.5,42,42,53.3,53.3,46.7,46.7,36,36,36,36,27.2,31.7,29.2,34.5,28.8,38.9,17.4,25.5,30.1,31.3,57.5,61.2,45.3,45.1,66.2,60.8,13.5,12.3,18.1,20.1,14.8,18.4,16.9,21.3,31.4,37.3,25.6,37.3,31.4,31.4,53.8,53.8,49,49,0.3,0.3,44.1,25.1,44.1,25.1,38.6,45.1,35.1,45.7,0,0,36.6,3.7,0,0,31.6,80.7,0,0,6.4,19.3,6.6,18.7,22.4,22.9,27.5,27.5
|
||||
76,BRA,Brazil,Latin America & Caribbean,211140729,22930,46.2,53,58.2,63.8,58.1,62.2,47.4,66.4,26.7,39.9,46.9,73.4,100,100,66.7,69.6,75.6,76.7,59.7,59.7,68.5,68.5,94,94,63.8,62.2,34.2,0,23.2,22.6,55.4,44,67.4,56.3,61.7,40.2,47.8,37,20.3,20.3,75.1,75.1,48.1,47.9,58,58.6,18.3,16.5,59,54.2,61,56.8,46.7,48.4,60.3,90.6,100,100,100,99.5,43.7,82.2,76.3,95.3,80.1,81,81.3,78.8,34.4,30.2,42.8,53.5,88.5,99,49.6,55.3,15.1,15.4,63,72.2,46.9,52,40.8,40.8,40.2,42.2,36.1,36.2,44.5,39.3,27.4,35.8,50.4,35.9,9.8,15,42.8,43.8,62.8,59.8,16.5,14.2,52.6,59.4,44.9,57.6,47.9,60.6,51.5,57.4,46.6,57.4,26.2,26.2,35.3,35.3,57.8,57.8,1.4,1.4,32.9,45.5,32.9,45.5,33.1,53.4,32.4,66.8,45.3,41.8,12,26.6,35.1,30.2,34.1,69.7,47.1,47.9,34.5,45,33.5,44.4,0,0,64.3,64.3
|
||||
96,BRN,Brunei Darussalam,Asia-Pacific,458949,95046,51.8,48.5,51.5,48.9,49.1,47.4,0,0,0.6,1.1,50,57.9,20.8,20.8,89.6,89.6,100,100,44.5,44.5,100,100,99.9,99.9,52.8,51.7,74.9,33.3,100,100,54,64.2,68.7,80.3,47,51.1,52.3,65.1,47.1,47.1,75.8,75.8,44.3,41.4,NA,NA,37,35.6,24.8,34.2,31.7,48.7,28.8,50.1,64.6,41.9,83.2,84.4,79.7,83.1,68.2,67.1,0,0,20,24.1,0,0.7,12.7,10.7,16.1,22.4,20.1,49.4,67.2,67.2,27.3,27.3,76.1,76.1,68.1,68.1,68.1,68.1,62.9,70.9,58.2,68.7,71.4,76.8,70.9,72.3,70,67.7,40.6,42,56,57.8,45,52.5,0,0,85.8,87.9,84.5,88,85.6,87.9,59.5,65,57,65,35,35,34.9,34.9,100,100,2.5,2.5,43,29.2,43,29.2,31.1,30.4,0,0,46.4,73.3,36.8,3.9,31.1,38.8,20.1,72.5,47.5,47.9,28.6,27.9,4.9,5,27.4,26.8,1.6,1.6
|
||||
100,BGR,Bulgaria,Eastern Europe,6795803,41510,57.6,56.3,70.5,70.8,69.4,69.1,86.7,86.7,0,0,32.3,33,48.7,48.7,91.3,91.5,99.9,99.9,99.2,99.2,74.4,74.4,0,0,80.5,80.1,86,77.5,18.2,18.9,71.9,72.1,NA,NA,NA,NA,82,80.3,57,57,61,61,19.1,20.9,NA,NA,57.2,55.5,12.1,4.3,16.5,8.8,50,50,92.7,92.3,47.3,49,58,59,100,100,100,100,71.5,74.2,56.1,60.8,71.2,57.1,85.7,70.1,62.2,90.7,66,67.4,39.4,39.4,86.8,90.4,54.6,54.6,54.6,54.6,41.3,42.5,30.3,32,18.6,21,28.1,36.4,40.3,49.3,38.5,37.8,11.4,16,54.5,59.6,41,41.4,80.6,79.3,90.8,87.8,78.7,73.7,33.8,37.3,31.1,37.3,47.7,47.3,33.6,33.4,99.9,90.1,35.6,39.8,51.7,45.7,51.7,45.7,56.3,54.1,41.7,38.4,76,60.2,0,7.9,53.9,37.6,80.5,48.5,51.6,51,50.4,48,47.7,41.9,24.3,21.4,56.3,56.3
|
||||
854,BFA,Burkina Faso,Sub-Saharan Africa,23025776,2850,41.5,41.5,58,56.9,72.3,73.3,NA,NA,NA,NA,NA,NA,50.7,50.7,83.3,89.8,54.1,54.4,88.8,88.8,17.2,17.2,85,85,95.5,95.4,80.1,74.9,0,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,47.8,39.8,73.2,72.3,90.1,90.8,5.2,35.7,55.6,27.2,66.5,64,45.8,46.3,100,100,93.9,90.2,73.6,67.7,12.4,12.4,100,100,3.4,3.4,2,2,2,2,31.1,33.1,38,39.8,79.1,72.8,4.5,6.2,48.5,34.2,50.7,42.2,77.8,75.4,52.6,51.5,19.7,13.6,12.3,15.7,9,14.7,10.1,16.3,21,22.3,20.7,22.3,27.4,27.4,66.4,66.4,1.8,1.8,1.2,1.2,25,24.9,25,24.9,6.8,15.1,61.2,78.6,23.3,25.7,36.7,3.7,31.6,31.6,44.1,64.2,0,0,18.5,19.8,34.9,33.7,21.7,19.5,81.5,81.5
|
||||
108,BDI,Burundi,Sub-Saharan Africa,13689450,986,34.3,33,52.2,48.1,51.2,51.7,NA,NA,NA,NA,NA,NA,28.3,28.3,34.6,37,20.4,26.4,89.4,89.4,38.5,38.5,95.7,95.7,67.6,67.6,90.4,80.7,3.3,3.7,68.3,63.7,91.4,85.7,NA,NA,65.2,50.7,39.9,39.9,44.4,44.4,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,82.7,59.6,72.6,70.5,84.5,82.7,57.4,53.2,69.4,59.3,46.2,45.4,40.9,45,100,72.1,84.8,77.1,12.3,30.4,11.5,11.5,97.2,97.2,4.5,4.5,0,0,0,0,12.5,12.9,9.5,9.1,0,0,3.6,5.2,40.1,21.5,55,53.9,32.9,32.9,20.1,20.4,17.5,17.7,14.1,16.8,10.8,15.9,11.9,17.4,28.2,29.6,26.9,29.6,24,24,59,59,0,0,0.9,0.9,25.1,26.6,25.1,26.6,12.9,4.9,100,100,3.3,29.4,36.7,3.8,0,20.4,42,61.9,44.3,45.4,13.3,19.7,34.2,43,32.3,31.6,99.7,99.7
|
||||
132,CPV,Cabo Verde,Sub-Saharan Africa,522331,11397,39.6,37.9,26.4,23.1,19.1,19.8,0.1,0.1,0,0,100,100,NA,NA,0.4,3.5,9.4,9.6,1.3,1.3,0,0,91.3,91.3,69.3,69.7,NA,NA,100,100,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,80.6,70.2,93.5,61.5,48.2,38.6,NA,NA,100,100,63.6,14.8,38.5,14.3,15.5,14.8,NA,NA,4.1,12.6,60.5,15.9,26.7,28,11.4,8.1,46.9,50.5,33.1,51.9,36.1,36.1,25.6,28.7,90.4,90.4,20.9,28.6,16.5,16.5,16.5,16.5,53.8,54.7,62.8,63.1,100,100,16.6,21.4,62.8,47.8,82.7,79.9,85,88.9,77.5,81.3,94.1,95.5,33.2,36.5,28.3,34.2,31.6,38.1,46.1,45.2,48.9,45.2,20.2,20.2,49.4,49.4,0,0,1.2,1.2,45,43.4,45,43.4,41.4,43.2,77,80.5,34.6,41.9,0,21.3,39.8,48.9,48.9,41.2,42.9,52.7,38.9,42.3,40,43,49,49.1,89.7,89.7
|
||||
116,KHM,Cambodia,Asia-Pacific,17423880,8680,31,31,36.3,44,38,57.3,27.8,63.1,13.8,17.6,50,50,66.7,66.7,58.4,91.1,46.5,100,72.6,72.6,4.4,4.4,86.1,86.1,39.7,32.3,0,0,57.5,55.2,25.6,37.6,15.7,32.2,57.8,77.6,0,5.9,0,0,63.3,63.3,33.7,31.8,33.6,23,88.8,86.7,15.5,12,15.4,15.4,78.3,52,46.7,14.5,64.1,65.1,73.2,72.9,31,4.4,56.1,2.9,62,64.6,48.8,51.4,71.5,100,65.7,48.6,66.7,81.5,11.7,11.7,77.8,77.8,9.9,9.9,0,0,0,0,23.9,24.1,19.5,18.2,17,20,3.9,6.5,34.3,31.8,41.7,41.1,45.1,44.8,39.7,46.1,9,4.5,35,40.2,28.6,38.9,31.2,41,27.6,28.9,26.5,28.9,36.3,36.3,85.7,85.7,0,0,5.1,5.1,28.8,16.7,28.8,16.7,9.4,0,9.6,0,30.6,38.8,36.8,3.8,28.5,31.2,30.9,33.8,47.3,45.8,23.4,12.2,34.1,21.4,21,16.3,60.7,60.7
|
||||
120,CMR,Cameroon,Sub-Saharan Africa,28372687,5566,36,38.1,45.2,48.1,46,45,NA,NA,53.8,75.6,100,100,30.9,30.9,30,31,30.3,33.1,67.7,67.7,62.3,62.3,89.1,89.1,49.8,49,75.1,0,46.8,44.9,67.5,58.4,78.2,58.9,79.4,69.9,72.1,46.6,41.4,41.4,80,80,72.2,81.6,NA,NA,85.2,90.1,56.8,76.5,75,88,32.8,28.8,44.2,71.7,86.7,84.3,88.5,85.6,33.5,60.9,25.9,77.1,48.4,50.4,39.2,44.7,100,100,56.3,59.1,47,48.4,10.2,10.2,100,100,0.6,0.6,0,0,0,0,17.3,19.5,15.7,17,17.3,14.6,4.5,7.5,37.7,25,63.5,63,49,47.4,41.5,38.7,2.5,4.7,17.5,23,12.1,21.8,13.4,23.8,25.1,28.3,22.7,28.3,26.8,26.8,65.5,65.5,2.6,2.6,0.2,0.2,38.6,39.4,38.6,39.4,31.6,43.6,100,100,51.8,40.5,58.7,7.7,62.3,40.7,54.7,28.6,48.9,49.1,40.1,36.7,46.9,41.9,23.3,20.6,88.2,88.2
|
||||
124,CAN,Canada,Global West,39299105,64570,57.7,61.1,57.8,60.6,48.2,52.1,11.2,21.7,15.7,26.9,50.7,60.8,40.3,40.3,66.8,82.1,29.2,36.2,40.7,40.7,89.8,89.8,99,99,89.8,89.3,79.5,47.1,57.8,56.9,42.5,47.6,NA,NA,24.2,29.2,67.3,65.9,36.2,36.2,89.9,89.9,31.7,33.1,4.7,0,64.6,57.3,31.1,29,35.9,34,53.2,49.4,89.5,90.8,22.2,41.1,43,48.6,100,100,100,100,72.5,72.3,54.1,61.7,77,60,41.5,33.6,96.1,100,80.4,80.4,6.9,6.9,98.2,98.3,84,84,68,68,73.5,77.3,68.4,72.3,62.5,67,90.7,96.7,50.1,51.9,2.3,7.8,37.1,41.7,55.9,61,57.3,57.3,90.6,94.7,80.1,88,91.3,99.1,93.3,97.3,91,97.3,36,36,17.6,17.6,96,96,24.4,24.4,44.3,48.2,44.3,48.2,51.7,52.5,26,27.1,60.1,65.7,43.7,41.4,38,44.3,100,100,49.7,49.8,45.2,48.3,29.3,33.1,3.2,4.1,45.2,45.2
|
||||
140,CAF,Central African Republic,Sub-Saharan Africa,5152421,1296,43.3,38.3,58.7,56.1,68.7,71,NA,NA,NA,NA,NA,NA,37,37,59.4,76.7,59.5,59.5,94.5,94.5,87.5,87.5,99.4,99.4,79.5,79.5,93.9,77.5,48.4,47.2,77.7,68.6,79,73.4,81.2,59.6,79.5,78.7,43.4,43.4,92.7,92.7,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,63.3,47.7,95.1,88.3,100,100,38.5,40.6,70.8,36.2,38.3,38.3,15.8,16.2,68.7,67.9,94.6,93.7,34.8,34.8,10,10,100,100,0,0,0,0,0,0,12.1,14.4,13.2,15.6,13.4,19.9,0,1.2,13.3,7.5,56.4,61.1,79.5,77.3,32.2,32.7,0,0,6.3,8.9,4.4,8.4,4.7,9.2,13.7,15.3,12.7,15.3,20.7,20.7,50.9,50.9,0,0,0.9,0.9,45.6,31,45.6,31,71.5,19.4,100,100,50.7,49.1,36.8,3.8,60.3,55.2,56.5,83.4,49.8,49.9,2.4,0,49.5,47.1,29.8,28.2,75.1,75.1
|
||||
148,TCD,Chad,Sub-Saharan Africa,19319064,2832,33.2,35.2,50.9,49.4,61.8,60.1,NA,NA,NA,NA,NA,NA,29.8,29.8,68.8,68.8,61.5,61.5,72,72,4.4,4.4,87,87,72.3,71.6,88.6,70.2,25.8,24.7,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,56.6,52.4,44.6,35.5,99,93.4,27.6,32.7,62.6,67.3,41.1,42.7,30.7,30.2,100,100,60.4,73,37.8,37.8,10,10,99.9,99.9,0,0,0,0,0,0,23.5,26.4,30.3,33.6,56.6,57.1,2.6,4,34.6,24.7,67.6,66.6,84.9,86.1,49.8,54.4,0,0,1.8,4.3,0,4,0,4.5,16.1,17.5,14.8,17.5,31.2,31.2,77.1,77.1,0,0,1,1,14.2,21,14.2,21,15.8,45.8,100,100,5.6,0,36.7,3.8,8.6,0,44.8,56.7,0,0,0,0,24,18.9,15.6,11.8,39.7,39.7
|
||||
152,CHL,Chile,Latin America & Caribbean,19658835,34790,47,50,54.8,58.4,39.7,42.5,13.4,28.4,17.4,37.8,100,87.7,34.6,34.6,30.4,33.6,48.2,54.9,63.9,63.9,64.8,64.8,95.6,95.6,30,20.6,78.1,46.8,100,100,50.6,70.3,NA,NA,46.1,83.6,51.9,62.1,49.6,49.6,73.5,73.5,82.7,81.9,31,22.7,85.5,88.8,100,100,96.5,94.3,57.7,55.2,75.7,80.9,74.2,71.1,93.3,86.6,32.2,63.4,100,99.1,69.1,66.3,39.7,45.4,30.7,29.5,60.6,43.2,91,100,88.3,88.4,0,0,99.9,99.9,99.9,100,84,84,44.8,44.7,31.2,29.2,21,8.3,37.9,48,55.6,62.3,11.8,12.4,0,0,25.2,22.4,25.8,27.5,75.8,80.1,68.8,77.6,74.9,81.8,89,94,85.5,94,31.9,31,34,31.3,90.7,91.3,0.4,0.5,37,41.5,37,41.5,36.5,46.7,21.8,37.5,55.5,49.5,0,0,45.3,56,14,66.6,49.3,49.5,34.3,42.3,30.2,38.1,12.3,13.5,54.8,54.8
|
||||
156,CHN,China,Asia-Pacific,1422584933,28010,29.9,35.5,34.5,35.9,11.4,9.5,24,24,2.4,2.5,47.9,54.8,0,0,2.5,3.1,1.5,2.6,3.8,3.8,4.4,4.4,0,0,20,10.4,54.1,24.9,39.8,40.3,69.7,73.1,61.1,85.3,76.9,73.2,64.1,66,54.8,54.8,71.4,71.4,40.5,39.6,59,57.5,76.6,68.3,29.6,26.3,28.7,24.1,46.3,46,73.6,87.3,0,0,45.2,47.2,40.9,100,100,100,64.8,69,50.1,58.8,25,30.1,71.2,60.5,77.7,85.9,48.4,48.4,42.6,42.6,49,49,49,49,49,49,26,29.5,11,14.3,0,1.1,13.8,25.1,0.9,16.5,24.3,31.9,0,0,2.5,4.5,28,29.2,69.8,74.5,61.1,71.6,66.5,76.5,35.4,39.4,31.7,39.4,44.7,43.3,61.8,58.1,89.5,91.4,5.1,4.5,26,39.8,26,39.8,21,43.1,0,20.9,22.9,38.7,10.8,36.3,42.6,65.3,54.6,100,50.1,49.4,3.4,33.5,7.8,31.1,0,0,39.3,39.3
|
||||
170,COL,Colombia,Latin America & Caribbean,52321152,22190,44.9,49.4,52.9,56.4,56.1,55.5,97.1,97.2,40.9,51,67.8,75.6,67.6,67.6,45.1,54.1,48.7,53.5,81.2,81.2,64,64,97.1,97.1,17.6,14.3,56.4,0,54.9,53.5,73,57,79.5,67.1,84.5,52.7,62.4,52.1,39,39,82.6,82.6,51.6,46.2,8.1,0,63.8,42.9,52.6,51.3,66.1,62.9,51.9,55.5,42.5,84.9,100,100,100,100,38.6,64.3,39.6,99.4,57.1,59.3,52.5,47.4,25.8,28.8,40.1,48.2,64.9,78.4,28,28.1,60.3,61.8,31.8,31.8,20.2,20.2,11.3,11.3,42.8,45.2,37.6,39.6,38.5,37.6,28.9,40,66.7,58.8,20.8,23.1,57,57.9,51.7,49.2,11.9,9.4,56.5,59.7,55.8,62.1,54.3,58.1,61,65.3,55.7,65.3,27,27,30.3,30.3,56.8,56.8,8.8,8.8,34.2,42.2,34.2,42.2,30.7,49.2,32.7,65.1,42.1,34.9,36.4,4.6,55,21.5,0.8,97.2,48.9,49.2,35,41.5,35.1,40.6,9,9.3,65.8,65.8
|
||||
174,COM,Comoros,Sub-Saharan Africa,850387,3861,44,37.9,48.8,44.4,53.9,49.9,70.1,70.1,23.3,23.3,86.6,100,NA,NA,43.3,43.3,100,100,41.1,41.1,100,100,99.6,99.6,23.4,10.2,86.5,30.4,100,100,46.1,65.1,NA,NA,NA,NA,57,72.1,41.3,41.3,77.9,77.9,74.9,73.4,100,64.1,100,5.9,100,100,100,100,52.6,51.8,55.7,33.4,65,53.8,NA,NA,48.2,37.8,61.7,25,49.7,50.6,42.3,45.1,100,100,77.8,77.8,40.7,40.7,9.5,9.5,83.9,83.9,2.8,2.8,0,0,0,0,44,41.2,51.8,46.8,71.8,70.9,5.3,6.7,88.2,54.9,90.4,79.6,85.2,89.6,81.8,82.1,82.4,85.9,23.7,25.8,20,24.1,22.4,26.9,36.9,39,35,39,28,28,69.1,69.1,0,0,1,1,36.5,25.2,36.5,25.2,42.3,3.4,100,29,18.2,35.1,NA,NA,33.5,35.3,47.7,61.7,49.9,50,32.6,22.1,36.7,26.9,48.6,44.6,86.1,86.1
|
||||
188,CRI,Costa Rica,Latin America & Caribbean,5105525,31090,55.3,55.5,63.2,62.5,65.7,63.9,86,86.1,34.1,37.5,63.3,100,99.9,99.9,58.6,58.8,84.4,84.8,54.7,54.7,60.9,60.9,97.2,97.2,51.7,49.1,59.9,14,79.1,77.1,77,72.3,85.6,83.6,88.6,83.8,57.5,64,38.1,38.1,46.4,46.4,41.9,35.7,19,18,9.4,3.8,57.9,47.4,51.4,50.2,50,56,72.8,79.8,66.8,64.9,75.5,78.7,51.1,62.7,40.6,100,52.8,57,49.7,42.7,32.2,33,35,49.1,76.7,76.7,40.3,38.7,20.5,17.7,84.2,81.4,7.6,7.1,15.2,15.2,51.5,53.7,47.6,49.6,55,56.3,37.5,45.3,65.9,59.8,18.8,23.8,50.1,51.4,67.5,68.1,20.6,20.4,65.9,68,67,73.3,62.2,64.4,59.7,64.4,55.6,64.4,31.2,31.2,42.9,42.9,63.6,63.6,3.2,3.2,46.1,46.3,46.1,46.3,46.4,50.5,68.3,75.6,30.9,39.3,36.7,4.2,24.6,46.3,45.8,82.5,49.7,49.7,42.3,47.1,41.4,45.9,28.9,29.7,78.4,78.4
|
||||
384,CIV,Cote d'Ivoire,Sub-Saharan Africa,31165654,8060,35,42.5,38.4,48.9,49.7,56.3,NA,NA,2.4,2.4,100,100,37.1,37.1,48.1,84.4,76.2,76.3,94,94,68.3,68.3,96.2,96.2,70.8,70.7,0.6,0,27.6,25.6,20.7,26.2,28.6,39.5,25.6,27.2,32.2,11.4,15.3,15.3,36.5,36.5,49.3,46.4,51.2,28.4,68.8,61.8,17.7,15.9,73.9,69.2,49.4,31,27.2,75.6,76.5,76.3,87.5,87.8,24.4,49.3,63.6,99.4,44.9,42.2,34.4,32.4,100,100,51.9,45.5,49.8,45.8,11.5,11.5,90.2,90.2,6.1,6.1,0,0,0,0,30.8,33.5,34.8,37,73.8,66.9,4.1,7,53.3,31.1,45.9,38.2,69.1,67.3,49.8,47.7,17.4,13.1,19.9,24.4,15.4,23.1,16.9,25.2,28.3,30.9,26.4,30.9,23.7,23.7,57,57,1.5,1.5,1.5,1.5,33.4,40.9,33.4,40.9,43.8,42.7,100,100,27.2,39.8,36.8,3.7,38.3,38.9,11.8,60.2,45.5,46,37.1,39.8,40.2,41,23.4,22.3,92.5,92.5
|
||||
191,HRV,Croatia,Eastern Europe,3896023,51220,58.1,62.6,70.2,72.8,69.5,69.8,66.7,66.7,32.8,33.4,55.3,55.3,55.8,55.8,81.3,84.6,40.4,100,95,95,63.2,63.2,52.5,52.5,65.1,63.6,85.4,78.4,34.4,34.5,68.5,61.7,NA,NA,NA,NA,80.9,69.4,48.7,48.7,49,49,59.3,62.1,60,61.5,46.3,68.5,45.3,61.9,47.8,63,37.1,33.8,73.7,91.1,39.7,37.3,59.4,56.4,100,100,100,100,64,67.9,53.5,61.5,37.7,56.2,78.8,78.2,53.2,71.1,77.5,77,37.3,39.8,98.3,96.5,81,80.9,20.6,20.6,48.5,51.7,36,40.6,23.2,29.3,45.7,52.8,37.7,36.2,34.3,34.9,35.3,41.9,50.7,55.2,38.2,37.2,87.7,85.4,96.3,91.1,89.5,81.6,62.3,68.1,56.5,68.1,39.1,39.1,31.6,31.6,96.8,96.8,17.8,17.8,47.5,56,47.5,56,54.6,52.9,48.5,45.8,51,90.5,30.5,46,58.3,40.2,89.5,94.1,52.1,51.1,53.1,52.7,49.4,47.5,29.6,28.9,68.1,68.1
|
||||
192,CUB,Cuba,Latin America & Caribbean,11019931,,49.8,52.3,52.1,49.8,47.3,43.4,80.8,80.8,33.9,33.9,50,26.4,40.8,40.8,39.2,39.2,41.7,41.7,71.9,71.9,98.1,98.1,97.1,97.1,0,0,71.6,21.6,47.7,46.5,80.9,66,85.6,73.8,96.9,65.5,64.6,66.6,49.2,49.2,53.6,53.6,83.6,81.4,33.1,31.4,98.9,99.1,86.4,88.9,87.9,89.8,69.1,63.7,62.7,78.8,29.5,24.6,38,32.5,84.5,84.5,68.5,93.1,50.5,47,41.8,45.7,63.4,71.2,43.8,54.5,55.2,43.2,23.3,20,6.6,3.7,16.8,18.7,33.7,24.3,24.6,24.6,50.1,52,50.6,52.5,62.9,62.8,37.7,44.9,46.8,55.1,20.9,22.1,54,56.9,72.4,76.3,43.6,43.1,57,58.8,55.9,59.8,56.1,58.1,42.9,45,42.1,45,22.1,23.5,21.1,25.8,48.6,49.9,9.9,7.9,46.1,56.4,46.1,56.4,42.6,62.3,54.4,88.7,42.3,62,36.8,3.8,53.2,60.4,100,55.9,51,51.5,38.8,58.9,40,59.6,20.1,33.6,90.1,90.1
|
||||
196,CYP,Cyprus,Eastern Europe,1344976,62290,54.3,54,55.7,57.2,48.7,51.6,7.8,7.8,16,16,44.2,36.4,37.6,37.6,49.4,69.3,57.2,100,59.9,59.9,25.2,25.2,37.1,37.1,73.3,73.4,73.1,60.2,74.9,76.2,75.8,60.6,NA,NA,NA,NA,83.7,60,55.3,55.3,74.5,74.5,41.5,43.6,8.9,10.9,31.8,26.4,40.7,74.9,98.6,51.3,94.2,0,79.6,83.3,0,0,0,0,100,100,100,100,39.1,35.7,13.7,9.2,28.9,27.7,55.3,48.6,57.6,57.6,70.4,70.8,61,61,82.7,83.5,62.5,62.5,62.5,62.5,61.9,62,57,55.9,42.9,37.1,82.7,87.2,27.9,30.4,20.1,21.8,29.9,40.5,62,67.7,36.8,42.4,85.1,86.7,84,87.5,84,86.2,60.4,67.1,56,67.1,31.7,31.7,19.9,19.9,85.4,85.4,16.6,16.6,45.9,42.6,45.9,42.6,54.6,48.6,43.9,35.1,0,30.3,15.7,33.8,59.6,35.9,100,52,57.8,54.5,49.2,45.2,44.9,39.6,36,33.4,55.6,55.6
|
||||
203,CZE,Czech Republic,Eastern Europe,10809716,59210,65.4,65.6,79,78,78.5,78.7,NA,NA,NA,NA,NA,NA,63.2,63.2,94.9,96.8,63.8,69.9,98.4,98.4,65.7,65.7,31.2,31.2,91.1,89.6,75.7,68.1,8.4,8.6,49.4,22.5,NA,NA,NA,NA,57.8,17.1,38.6,38.6,17.1,17.1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,93.4,93.8,62.8,59.3,70.3,66.8,100,100,100,100,74.7,74,60.3,58.5,96.1,73.5,74.5,70.6,67.6,90.9,77.1,80.2,27.3,27.3,80.8,84.7,80.8,84.8,96.8,96.8,55.3,58.8,44.7,50.4,21.1,37.7,62.5,69.7,43.7,38.4,22,27.1,33.6,40.4,48.5,54.1,54.1,53.2,83.3,80,98.3,89.6,83.7,73.6,75.7,80.9,71.2,80.9,55.5,51.2,38.9,23.4,100,100,49.9,54.5,53,52.2,53,52.2,61.8,57.8,44.9,39.4,57.2,63.4,0,36.3,52.3,69.1,69.3,65.9,54.9,54.6,53.8,53.3,44.7,43.3,20.1,18.6,59.5,59.5
|
||||
180,COD,Dem. Rep. Congo,Sub-Saharan Africa,105789731,1842,33,39,47.9,53.1,53,51.8,NA,NA,59.6,59.6,NA,NA,33.9,33.9,51.1,62.7,41.6,45.8,66.8,66.8,74.9,74.9,97.6,97.6,62.1,62.1,71.9,0,60,54.8,57,47.1,69.5,55.4,64.7,45.8,55.7,39,32.2,32.2,75.6,75.6,73.2,73,NA,NA,100,100,19.9,18,100,100,41.5,51.3,50.6,100,100,100,100,100,39.5,100,38.3,100,39.4,39,37.7,37.5,100,100,64.8,57.8,26.9,27.6,10,10,100,100,0,0,0,0,0,0,12.3,13.8,8.1,8.2,0,0,3.5,5.1,26.5,16.3,47.6,53.9,27.3,28,24.8,26.1,0,0,18.3,25.7,10.5,24.1,11.6,26.7,27.5,27.7,27.4,27.7,23.9,23.9,58.2,58.2,1,1,1,1,29.5,40.1,29.5,40.1,29.3,51.8,100,100,20.3,29.3,36.8,3.8,57.7,42.1,42.4,40.9,47.9,47.1,23.3,30,41.8,45.5,17.3,16.4,98.3,98.3
|
||||
208,DNK,Denmark,Global West,5948136,85791,68.3,67.9,64.2,63.5,53.4,53.3,28.9,29,17.3,17.3,21.2,21.4,41.5,41.5,74.9,75.4,48,48,52.4,52.4,24.9,24.9,67.4,67.4,93.6,93.8,90.6,87.1,5.3,6.3,56,51,NA,NA,NA,NA,49.9,45.9,87,87,4.3,4.3,49.6,44.7,9.5,27.3,68.8,72.7,34.7,39.2,24.5,41.2,57.9,36.6,90.9,90.3,39.2,38.9,42.7,44.1,100,100,100,100,80.6,77.8,65.9,61.3,44.6,41,75,71.2,96.8,100,85.1,85.8,20.4,21.4,99.6,99.8,90.8,92,69.3,69.3,73.9,76.9,67.7,70.9,54.3,59,90.6,95.6,37.5,40.7,26.6,32,59.1,66.8,62.9,68.2,78,80.3,89.7,91,87.7,91.1,89.1,90.9,92.3,98.8,86.4,98.8,64.4,65.5,12.3,13.9,100,100,98.8,99.9,69.9,67.1,69.9,67.1,63.3,77.9,59.6,81.7,60.3,56.5,54.3,80.4,57.5,49.6,72.2,100,47.6,48.2,63.1,64.3,53.1,56.9,37.6,40.5,83.7,83.7
|
||||
262,DJI,Djibouti,Sub-Saharan Africa,1152944,8601,32,32.2,25.2,24.4,19.7,18.1,0,0,0,0,NA,NA,0,0,6.8,6.8,0.3,4.4,2.1,2.1,100,100,100,100,46.7,39,90.1,81.3,43.8,42.9,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,95.9,96.4,NA,NA,100,100,45.2,100,100,100,13.5,38.8,18.7,16.8,34.4,10.4,NA,NA,17.1,17.1,17.7,17.7,58.4,65,49.9,59.3,23.9,42.4,68.9,86.3,63.6,63.6,14.8,14.8,74.1,74.1,14.5,14.5,3.2,3.2,3.2,3.2,27.1,28.9,28.2,29.2,29.1,33.2,14.3,16.8,49.2,34.3,33.3,30,60.5,60.5,67.1,61.6,56.3,56.9,21.1,25.8,16,24.4,17.7,26.8,31.6,34.5,29.2,34.5,29.1,29.1,71.6,71.6,0,0,1.1,1.1,47.9,47.9,47.9,47.9,51.4,51.4,100,100,37.1,37.1,NA,NA,46.2,46.2,48.6,50.3,NA,NA,43,43,46.5,46.5,44.4,44.4,88.9,88.9
|
||||
212,DMA,Dominica,Latin America & Caribbean,66510,18391,49.4,49.2,42.9,40.6,27.8,27.8,0,0,3.2,3.2,50,78.3,NA,NA,24.7,24.7,70.4,70.4,43,43,52.2,52.2,95.7,95.7,4.8,0,NA,NA,100,100,79.4,56.4,89,62,NA,NA,83.5,64.3,43.2,43.2,10,10,39.6,49.6,NA,NA,18.2,33,100,100,0,24.9,45.9,37.6,75.6,68.1,44,39.8,NA,NA,49,68.6,91.5,73.3,40.9,45.7,35.5,37.5,57.6,55.6,19.8,38,56.4,56.4,44.5,44.5,50.2,50.2,49.9,49.9,39.1,39.1,39.1,39.1,55.8,57.6,59.6,62,84.1,80.8,28.5,32.2,86.3,100,50.2,43,80,85,82.3,85.5,78,83.2,51.2,51.3,51.5,53,50.8,50.2,42.9,44.8,41.8,44.8,39.6,38.4,43.9,43.5,100,95.2,5,4.8,52.8,53.6,52.8,53.6,45.3,50.7,55.1,64.4,40.7,45.9,100,100,46.7,47.3,66.4,52.1,50.1,50.6,42.1,48.1,42.6,48.8,58.8,60.9,79.1,79.1
|
||||
214,DOM,Dominican Republic,Latin America & Caribbean,11331265,28950,48.7,47.6,58.4,56.8,59.4,57.6,82.6,82.6,43.5,43.5,65.8,50,56.8,56.8,51.6,51.8,67,69.9,95.3,95.3,34.6,34.6,91,91,15.5,12,81.3,56.7,70.5,67.9,54.6,61.1,68.3,68.8,64,82.1,42.2,39.9,37.3,37.3,41.8,41.8,95.2,95.7,80.8,86.6,100,100,100,100,100,100,54.6,54.6,68,51.7,50.3,46.2,56.3,53.1,72.5,43.5,79.5,60.8,74.5,78.7,65.1,85.4,46.3,68.8,49.9,55.4,82.5,82.5,21.1,25.2,24.4,27.2,20.9,20.9,23.4,32.8,9.7,9.7,40.8,43.2,43.9,46.3,56.1,53.9,27.8,37.1,58.4,66.9,17.1,19.5,54,58.2,63.9,64.7,31.6,29.9,39.4,42.4,36,42.8,37.1,42.1,28.6,30.5,27.4,30.5,18.3,18.3,35,35,7.1,7.1,7.1,7.1,40.3,37.3,40.3,37.3,41.4,45.2,48.5,54.9,20.2,34.3,36.8,3.8,34,24,57.2,24.9,50.7,50.7,35.9,40.4,35.8,38.9,21,20.7,67,67
|
||||
218,ECU,Ecuador,Latin America & Caribbean,17980083,16890,44.1,51.2,51.2,56.7,50.7,50.3,84.2,84.2,64.4,66.3,93.4,47.8,50.1,50.1,33.8,39.2,53.7,63.9,52.4,52.4,73.3,73.3,96,96,0,0,68.4,30.1,80.3,77.6,74.8,71.3,81.6,76.7,87.3,78.5,61.6,66.5,42.5,42.5,76.4,76.4,65.4,69.9,0,0,64.8,74,72.6,83.4,80.8,91.6,48.6,43.2,41.5,85.7,100,100,92.5,87.9,31.8,68.1,33.9,100,51.1,50.1,37.5,37.9,46.5,40.3,39,34.2,50.2,69.7,37,38.7,37.5,35.5,48.9,48.9,25,29.8,36.8,36.8,42.4,44.3,37.2,37.3,33,29.3,31,39.1,79.8,65.3,15.4,23.9,68.3,69.1,55.2,50.8,16.1,14.3,56.1,63.5,47.6,62.7,50.3,64,55.3,62.3,50.1,62.3,36.4,32.4,47.5,44.4,58.9,49.5,14,11.8,34.6,48.5,34.6,48.5,36.5,52.3,37.6,64.3,35.6,62.1,36.8,3.8,32.8,45.2,29,59.1,48.7,49,32.6,48.8,33.7,50.3,16.1,20.9,77.4,77.4
|
||||
818,EGY,Egypt,Greater Middle East,114535772,21610,40.5,43.8,46.9,51.7,48.4,47.4,30.2,30.2,27.5,27.5,100,100,22.5,22.5,41.7,41.7,42.7,42.7,44.6,44.6,82.8,82.8,98.7,98.7,75.4,68.7,93.9,90.1,64.1,64,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,30.1,32.4,58.6,41.9,36.6,34.5,29.1,31.2,26.8,23.3,36.9,64.9,35.8,73.3,0,0,14.8,0,35,76,45.5,100,51.1,48.9,57.5,54.1,100,73,49.2,44.4,39.9,43.5,57.1,57.1,18.8,18.8,91.8,91.8,32.1,32.1,56.7,56.7,29.5,33.3,28,31.7,6.4,10.3,44.8,58,22.4,26.3,17.3,20.8,6.2,3.5,30.1,27.2,39.3,38.3,47.3,53,39.7,50.3,45.2,54.8,0,1.9,0,1.9,25.2,25.2,53,53,6.8,6.8,6.5,6.5,39.7,40.4,39.7,40.4,36.2,43.8,36.4,49.3,44.3,46.1,36.7,10.6,34.7,60.2,0.8,51.3,19.5,32,33.2,40.7,34.7,40.9,5.2,5.5,71.7,71.7
|
||||
222,SLV,El Salvador,Latin America & Caribbean,6309624,13173,46,41.5,45.8,44.7,36.9,36.3,13.4,13.4,38.9,38.9,50,84.2,35,35,18.1,18.8,22.8,24.1,45.5,45.5,77.9,77.9,85.2,85.2,41,37,84.5,66.7,58.5,57.9,68.1,67,82.8,79.4,NA,NA,59.3,67.6,41.8,41.8,40.2,40.2,24.8,21.6,0,0,28.8,22.6,21.3,30.9,30,18.8,53.7,55.3,91.5,85.1,54.9,54.4,57.7,55.6,94.8,82.3,94.1,100,56.5,62.3,49.8,55.8,49.9,53.3,56.1,50.1,76.3,74.7,21.2,21.2,50,50,37.4,37.4,2.5,2.5,2.5,2.5,28.5,29.8,22,22.9,8.5,10.3,19.7,27.3,53.2,45.9,21.9,32.9,33.9,35.6,47.8,48.3,3.8,2,46.7,50,41.6,48.7,45,50.9,38.2,39.6,37.8,39.6,29.2,27.4,45,40.5,53.1,53.1,1.4,1.4,61.1,46.4,61.1,46.4,51,40.8,85.6,66.7,94.1,79.8,36.9,3.7,53.3,78.2,69,45.9,49.4,51.1,53.6,44.2,54.7,44.9,35.5,30.5,85.3,85.3
|
||||
226,GNQ,Equatorial Guinea,Sub-Saharan Africa,1847549,21751,44.7,41.6,53,43.7,49,45.6,3.5,3.5,25.3,25.3,0,10.5,33.3,33.3,70.1,70.1,59.2,59.2,100,100,85.7,85.7,97.3,97.3,40,40,72.2,8.8,84.1,82.7,61.2,66.6,76.9,75.6,74.4,68.9,64.3,59.8,42.5,42.5,80,80,45,44.7,39.7,7.2,85.4,95.7,32,17.1,52.2,43.9,63.3,97.4,90.1,22.3,74.1,69.3,NA,NA,81.1,18.5,100,16.8,41.5,43.7,32.3,34.5,100,100,54.8,64.9,39.4,39.4,34.8,34.8,52.8,52.8,34.8,34.8,31.1,31.1,31.1,31.1,32.9,33.3,33.3,32.4,19.2,14.9,34.4,37.1,56.8,32.1,92.7,95,65.8,66.4,57.7,53.5,18.7,18.3,30.7,35.3,25.7,36.3,26,34.7,38,39.5,37.1,39.5,26.4,26.4,64.7,64.7,0,0,1.4,1.4,42.1,45.5,42.1,45.5,42,54.9,38.8,59.9,41.5,55.9,36.8,3.7,29.5,54.9,100,0,49,49.2,35.5,48,26.7,47.7,26.9,35.6,69.9,69.9
|
||||
232,ERI,Eritrea,Sub-Saharan Africa,3470390,1832,28.9,28.6,27.3,25.1,18.5,16.8,0,0,0,0,NA,NA,3.1,3.1,0,0,0,0,0,0,0,0,65.5,65.5,68.7,61.4,95.9,86.3,27.2,26.8,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,63.1,66,0,28.4,100,100,9.4,15.7,100,100,49.3,57.1,64.6,56.3,35.4,12,57.7,30.6,58.1,52.2,96.3,74.5,33.9,31.9,19.3,20.5,75.9,100,95.9,90.4,15.1,13.2,7.6,7.6,76.2,76.2,0,0,0,0,0,0,23.2,24.6,26.2,26.9,37.9,40.6,4.2,5.9,29.4,26.3,46.5,46.7,67.6,63.7,60,52.2,20.2,22.9,13,15.9,9.7,14.9,10.9,16.6,24.7,27.7,21.9,27.7,21.3,21.3,52.2,52.2,0,0,1,1,36.6,38.1,36.6,38.1,55.6,44.4,100,100,35.3,38,NA,NA,40.1,40.5,30.5,29.2,0,0,22.9,24,45,43.9,35,34.3,84.8,84.8
|
||||
233,EST,Estonia,Eastern Europe,1367196,49700,60.6,75.3,75.8,76.6,77.1,78.8,94.9,94.9,82.6,82.6,66.2,69.3,48.4,48.4,79.6,95.9,60.7,66.2,95.6,95.6,88.2,88.2,92,92,95.2,95.2,69.3,43.3,11.5,12,39.4,28.9,NA,NA,NA,NA,44.9,25.9,35.8,35.8,30.3,30.3,69.9,70.4,80.1,73.2,55.6,56.6,90.8,90.2,74.1,69,68.4,27.7,87.6,91.5,42.3,46,44.5,52.5,83.5,100,100,100,71.1,71,38.5,51.6,51.3,54.7,70.7,68.7,69.8,92.8,74.5,72.2,25.2,25.7,88,83,83,82,36,36,60.8,63.9,57,60.9,58.8,69.3,45,55.4,68.4,77.8,25.4,22.8,34.7,37.3,57.8,62.6,64.4,70.6,71.8,71.9,69.5,70.4,73.1,72.9,63.9,68.8,59.3,68.8,62.6,65.1,35.8,34.4,87.4,98.7,77.1,79,37.3,82.8,37.3,82.8,45.9,100,25.4,100,27.3,100,27.9,49.1,40.3,45.3,30.4,100,50.3,49.6,33.5,78.9,23.7,69.6,25.1,100,99.1,99.1
|
||||
748,SWZ,Eswatini,Sub-Saharan Africa,1230506,12963,40.8,38.5,39.9,38.7,30.5,30.7,NA,NA,NA,NA,NA,NA,35.2,35.2,15.2,17,13.3,14,26.6,26.6,79.5,79.5,98.1,98.1,39.6,39.6,34.5,26,64.7,65,41.1,44.6,NA,NA,NA,NA,32.1,49.1,34.9,34.9,41.3,41.3,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,83.2,75.3,70.4,69.5,82.3,82,100,62.8,89.4,87.7,52.3,51.7,33.3,26.4,100,100,71.5,71.8,64.6,64.6,14.5,14.5,65.7,65.7,11.9,11.9,6.4,6.4,6.4,6.4,21,21.9,23.2,22.5,26.7,24.5,6.6,12.1,35.9,23.6,55.3,62.9,35.8,36.5,43.4,40.9,19.9,16,14.2,18.1,10,17.3,10.9,18.7,18.2,25.6,13.2,25.6,22.8,22.8,55.8,55.8,0,0,1.2,1.2,60.1,52.9,60.1,52.9,40.8,42.6,72.1,75.3,100,81.1,NA,NA,41,50.2,41.9,70.9,49.8,50.1,49.9,48.3,52.6,49.6,43.6,42.9,85.2,85.2
|
||||
231,ETH,Ethiopia,Sub-Saharan Africa,128691692,4045,32,35.8,42.3,45.9,44.1,46,NA,NA,NA,NA,NA,NA,31.2,31.2,45.2,51.4,41.2,56.5,29,29,30.4,30.4,8.8,8.8,50.4,50,95,78.1,23.2,23.1,58,63.8,69.3,67.5,56.9,63.3,65.2,71.3,31.9,31.9,71.7,71.7,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,44.8,53.9,79.4,70.1,84.5,74.7,30.4,41.4,34.4,59.1,52.8,58.8,41,48.2,90.2,87.2,65.6,62.8,40.6,65.3,10.8,10.8,100,100,2,2,0,0,0,0,23.5,25.1,24.6,25.4,30.6,33,4.8,7.4,45.4,30.6,61.9,63.3,70.3,69.4,36,36,14.1,14,14.9,18.5,11.1,17.2,12.5,19.4,29.7,33.1,26,33.1,36.1,36.1,89.2,89.2,0,0,1,1,22.8,28.9,22.8,28.9,23.2,22.6,100,100,9.6,23.1,NA,NA,6.9,18.8,35.3,43.2,43.4,41.8,11.3,23.6,28.6,34,9.4,8.3,84.5,84.5
|
||||
242,FJI,Fiji,Asia-Pacific,924145,16003,48.1,45.8,39.6,36.9,17.9,16.2,4.3,4.3,16.8,16.9,80.6,99.5,0,0,7.5,7.5,8.1,8.1,5.5,5.5,59,59,99.3,99.3,5.7,0.1,90.9,64.9,40.2,38.4,79.2,75.3,92.8,87.6,NA,NA,80.3,72.8,40.8,40.8,83.7,83.7,76.4,75.8,53.9,33.9,41.7,40.6,100,100,100,100,48.9,51.6,81.8,70.7,78.7,75,92.8,87.8,100,66.2,100,71,62.6,63,71.9,68.2,58.6,44.2,27.3,30.3,73,73,42.4,42.4,47.9,47.9,49.1,49.1,36,36,36,36,54.8,55.7,61.2,61.7,100,100,10.2,15.8,77.2,66.2,91.8,93.8,63,64.1,95.5,94.2,46.2,47.8,34.3,36.1,33,37.5,32.7,35.1,56.7,59.6,54.5,59.6,45.2,44.7,58.5,57.5,100,100,4.4,4.2,55.6,51.1,55.6,51.1,60.5,51,100,87.6,47,61.1,36.8,3.8,68.6,75,56.8,59.9,49.7,49.8,52.6,50.9,53.4,51,45.5,45.3,86.2,86.2
|
||||
246,FIN,Finland,Global West,5601185,67077,70.5,73.7,70.1,68.4,61.8,58.7,64.7,64.9,44.4,44.7,69.4,64.2,27.4,27.4,64.1,67.9,33.9,42.4,84,84,100,100,100,100,97,97,72.5,13.5,40,38.9,61.1,60.8,NA,NA,81,93.2,45.9,31.6,41.3,41.3,50.9,50.9,89.6,90.4,88.6,80.8,94.2,95.8,94.4,91.4,100,100,59.4,25.6,92.1,92.8,36.4,51.6,49.6,62.3,100,100,100,100,68.5,66.6,43.8,37.7,51.6,50.4,60.6,59,94.5,100,84.1,84.5,32.4,32.4,99.9,100,84,85,72.6,72.6,82.5,85.6,78.5,82.2,73.4,81.9,90.6,95.3,62.5,79.6,21.9,20,64,69.3,62.7,66.9,71.3,76.7,93.4,95.2,89.2,93.5,93.3,96.3,95.2,99.3,91.9,99.3,69.5,68.4,27.1,21.5,100,100,96.7,99.4,61.3,71.8,61.3,71.8,62.7,73.7,52.5,68.5,80.4,100,41.2,64.5,57.3,54.4,63.5,100,49.4,49.3,58.2,66.6,45.6,56.9,28.1,100,87.5,87.5
|
||||
250,FRA,France,Global West,66438822,67669,65.6,67.1,68.3,68.4,60.2,61.6,47.4,48,57.4,58,43.3,44.1,71.5,71.5,67.6,71.6,64.4,83,68.4,68.4,45.3,45.3,0,0,59.6,46.2,80.7,72.8,27.1,27.6,64,58.6,NA,NA,NA,NA,66.3,65.3,49.3,49.3,43.5,43.5,45.7,43.2,23,20,31.5,39.9,42.6,51.5,37.8,48.9,53.6,44.7,93.3,92.8,61.4,60.8,55.9,53.1,100,100,100,100,77.1,72.8,65,63.7,65.2,57.4,56.6,59.8,95.1,88.6,84.2,84.2,33.8,33.8,100,100,82,82,80.3,80.3,67.9,71.5,61.3,65.2,36.3,49,86.8,91.5,55,57.5,13.8,19,50.4,62,53.6,60.6,56.8,57.4,84.4,85.9,82.8,86.7,83.2,85.3,89,94.8,84.4,94.8,56.6,59.6,24.4,23.9,92.6,100,70.8,75.2,59.6,61.3,59.6,61.3,63.4,60.9,63,59.1,67.9,69.1,36.2,73.3,71.4,70.1,100,100,51.2,51.1,57.4,59.1,50.5,53.6,10.3,12.8,77.7,77.7
|
||||
266,GAB,Gabon,Sub-Saharan Africa,2484789,24129,46,53.1,57.2,64.8,63,63.9,0,2.2,40.9,50,28.9,45,50.5,50.5,87.1,87.1,72.9,73.2,90.5,90.5,47.2,47.2,84.2,84.2,84.9,84.9,94.4,77.8,68.5,65.8,75.6,80.5,88.8,89.1,76.7,81.2,82.1,80.2,47.9,47.9,90.7,90.7,46.2,47.5,54.1,37.2,88.2,88.1,51.4,33.9,35.8,35,41.5,70.5,48.8,98.9,84.1,86.4,100,100,20.1,100,11,100,28.5,28.2,29.2,24.9,80.3,55.6,18.6,32.3,27.5,27.6,42.5,42.5,62.1,62.1,45.8,45.8,35.9,35.9,35.9,35.9,31.5,32.1,31.4,30.6,15.6,15.1,29,35.1,67.9,42.2,71.4,67.4,70.1,69.4,51.8,48.6,11.1,8.8,29.6,34.1,23.9,31.9,27.1,35.6,38.1,41.4,35.6,41.4,29,29,71.1,71.1,0,0,1.4,1.4,40.8,52.8,40.8,52.8,51.4,57.5,61.4,71.8,100,81.4,36.7,3.8,17.9,55.1,14,81.8,49.7,49.8,51.5,47.3,52,47.8,42.5,32.3,67.6,67.6
|
||||
270,GMB,Gambia,Sub-Saharan Africa,2697845,3491,36.5,37.1,40.1,35.5,40.6,38.3,0.7,0.7,56.4,56.4,NA,NA,40,40,30.9,30.9,17.9,25.3,15.5,15.5,52.2,52.2,99,99,87.4,87.3,93,41.8,0,0,41,49.9,NA,NA,NA,NA,43.7,55.4,37.3,37.3,48,48,90.8,91.1,NA,NA,98.6,100,75.7,73.9,95.8,100,1.7,78.9,48.9,26.4,50.9,51.2,66.2,65.7,20.2,18.9,67,21.1,40.3,33.7,30.5,15.4,100,96.6,67.4,55,51.1,37.8,9.5,9.5,92.6,92.6,0.7,0.7,0,0,0,0,37.5,40,44.3,46.9,96.7,93.2,4.4,5.2,41.5,28.9,50.2,58.3,32.4,29.8,54.8,51.9,28.8,29.7,21.2,24.9,17.7,23.6,19.4,25.8,22.7,23.4,23,23.4,32.6,32.6,80.4,80.4,0,0,1,1,29.6,37.2,29.6,37.2,34,26.6,100,99.3,0,43.7,NA,NA,44.4,44.5,41.5,52,0,0,21.6,33.8,30.2,41.5,39.5,40.1,94.5,94.5
|
||||
268,GEO,Georgia,Former Soviet States,3807492,29530,41,46.9,45.8,50.2,42.6,44.3,46.4,46.4,14.3,14.3,33.5,67.3,28.5,28.5,24.5,28.7,26.7,36.5,31.9,31.9,89,89,98,98,79.1,76.6,92.4,85.7,53.1,53.8,87.9,85.1,NA,NA,88.4,84,95.2,97.4,61.6,61.6,77.9,77.9,70.9,61.2,NA,NA,48.4,38.1,79.5,67.6,81,76,39.6,17.9,48.3,73.9,49.6,47.3,60,56.9,17.4,68,75.8,88.5,24.8,26,16.7,19.2,77,51.7,55.3,42.1,14.8,24,34.3,38.2,51.3,51.3,32.1,37,32.1,37,34.5,34.5,39.7,42,33,34.5,41.6,39.9,13.1,25.5,48.3,41.8,33.2,26.5,44.3,44.8,62.7,65.3,40,35.2,66.7,70.6,59,66.6,64.9,73.3,32.1,37,27.1,37,35,36.6,43.1,42.8,79.4,88,4.6,4.6,34.8,46,34.8,46,24.8,38.1,11,32.7,64.3,81.7,56.7,19.7,46.8,77.8,17.5,88.2,52,52.1,31.2,40,31.9,38.7,27.4,27.7,63.4,63.4
|
||||
276,DEU,Germany,Global West,84548231,72661,70.5,74.6,80.9,80.5,81.9,82.5,85,85.3,95,95.1,38.2,43.2,76.3,76.3,94.5,98.3,100,100,76.7,76.7,15.9,15.9,0,0,92.8,91.6,74.3,71.9,17.9,18.5,64,38.5,NA,NA,NA,NA,68.7,37.1,49.9,49.9,22.8,22.8,37.5,36.4,8.2,0,32.9,48.6,6.9,26.6,35.7,49.6,60.6,52.8,89.2,92.6,56.9,51.7,65.1,58.9,92.1,100,100,100,78.7,78.8,65.5,67.1,50,51.3,66.8,65.4,95.2,98.4,90.7,90.9,25.7,25.7,99.3,99.3,96.8,97.3,97,97,70.9,75.4,61.9,66.9,36,50,92.8,96.7,45.4,43.5,20.9,26.9,51,62.1,53.8,61.3,59.4,60.4,94.9,97.9,90.9,97.7,92.3,98.1,90.1,94.6,86.5,94.6,65.9,67.4,20.3,19.7,100,100,94.4,98.9,54.4,64.9,54.4,64.9,55.3,68.3,38.3,56.9,86.8,87,54.1,55.7,65.6,85.7,86.6,97.8,52.3,52.1,53.5,62.6,42.1,53.4,3.3,14.9,78.4,78.4
|
||||
288,GHA,Ghana,Sub-Saharan Africa,33787914,8260,34.8,36.6,45.5,46.9,48.1,45,0,0,0.1,0.1,100,56.7,40.8,40.8,79.2,79.2,49,49,90.4,90.4,69.4,69.4,92,92,46.4,45.5,78.1,42.1,17.5,16.9,41.6,25.1,65.4,35.9,NA,NA,39.9,8.5,24.5,24.5,45.2,45.2,57.2,58.6,37.1,45,21,22.2,68.7,72.7,73.9,78.4,49.2,35.8,50.6,78.3,69.3,68.5,83.6,84.6,0,57.4,19.3,100,61,70.7,46.1,51.9,100,100,68.8,64.9,61.4,89.4,14.5,14.5,65.5,65.5,12.1,12.1,6.3,6.3,6.3,6.3,29.7,31.9,30.6,32.4,58.4,49.5,5.7,9.4,51.3,35.9,56.8,55.6,62.6,60,43.8,39.6,22.1,17.4,23.6,27.4,19.7,26.6,21.1,27.9,36.1,39.5,33.2,39.5,31.5,31.3,60,59.9,28.1,27.5,4.8,4.7,22.7,24.7,22.7,24.7,21.3,26.5,55.6,65.8,0,9.1,37.6,4.1,26.6,30.4,28.3,26.9,46.2,49.2,21.2,23.6,23.4,25.9,19.3,16.6,82,82
|
||||
300,GRC,Greece,Eastern Europe,10242908,43800,58.7,67.4,65.6,67.9,62.9,62.7,72.2,72.2,39.7,39.7,43.4,47.2,36.5,36.5,56.4,56.5,100,100,85.2,85.2,75.6,75.6,18.5,18.5,57.7,56.6,90.6,85.1,44.9,44.8,68.2,58.2,NA,NA,NA,NA,73.9,60.7,48.1,48.1,66.1,66.1,42.8,47.8,45.8,30.2,36.2,46.2,50.8,49.7,37.4,51.1,59.3,73.6,68.9,88,23.5,24,37.4,38.4,79.7,98.7,100,100,63.8,61.4,55.9,52.2,100,100,55.5,50.1,62.7,72,84.3,85.4,18.1,18.1,93.4,94.7,93.4,94.7,78.1,78.1,61,61.9,53.3,53.8,44.9,41.2,71.3,73.7,30.8,44.8,19.4,26.6,32.5,37.4,58.1,63.3,46.6,45.9,91,92,82.9,85.3,95,96.4,62.9,67.3,58.4,67.3,38,39.4,27.4,26,100,100,17.7,22.4,46.1,71.3,46.1,71.3,51.4,69,38.6,64.8,50.5,96.8,14.3,58,58.6,69.1,65.3,100,51.3,52.7,47.7,66.7,41.3,60.8,17.5,100,89.9,89.9
|
||||
308,GRD,Grenada,Latin America & Caribbean,117081,20306,45.6,46,39.2,40.4,20.6,21.4,0,0,1.8,3.4,100,100,NA,NA,11.2,14.2,27.3,27.3,60.6,60.6,28.3,28.3,74.6,74.6,0,0,NA,NA,84.8,81.5,62.6,63.1,NA,NA,NA,NA,63.1,76.2,40,40,44,44,83.5,84,NA,NA,53.4,50.8,100,100,100,100,48.6,24.6,73,76.5,47.8,42.5,NA,NA,36.5,87.3,82.8,72.6,48.3,51,43.8,50.6,59.7,55.8,4.1,21.6,63.3,63.3,46.8,46.8,23.4,23.4,55.6,55.6,44.5,44.5,44.5,44.5,64.3,66.1,72.5,74.4,100,100,39.4,47.1,74.5,82.7,56.3,51.7,83.8,88.4,83,84.7,90.4,92.3,53.8,55.2,51.7,55.7,52.7,54.9,33.1,36.9,30.3,36.9,38.8,38.8,48.3,48.3,96.8,96.8,0.2,0.2,38.5,36.7,38.5,36.7,36.1,39,32.2,36.9,46.9,43.6,0,20.3,12.5,50.2,55.6,50.7,52,51.5,23.7,30.3,24.1,29.9,51.1,50.5,56.1,56.1
|
||||
320,GTM,Guatemala,Latin America & Caribbean,18124838,15390,35.3,32.6,42.8,38.6,38.2,36.8,53.8,53.8,17.8,19.2,89.6,20.6,57.6,57.6,31.9,33,65.5,66.6,35.6,35.6,46,46,88,88,11.3,7.7,0,0,82.5,78.7,46.6,33.3,39.2,41.1,61,32.2,31.7,29.5,19.8,19.8,38.5,38.5,40,39,70.9,32.3,42,35.2,21.3,44.1,31.2,38.2,66.4,54.8,63.5,49.8,79.9,80.9,63.9,60.9,65.5,37.8,70.4,53.4,59.2,56.8,62,64.7,44.9,44.3,50.2,49.5,47.4,53.1,28.7,28.7,25.3,25.3,35.5,35.5,23.9,23.9,23.9,23.9,22.2,24,19.2,20.1,7,10.9,11.9,15.8,58,59.5,34.3,38.6,37.7,37.9,41,43.1,3,0.7,27.4,31.4,25.5,31.8,25.3,31.1,33.9,38.2,32.9,38.2,24.3,24.3,58.6,58.6,1.7,1.7,1.3,1.3,34.7,30.6,34.7,30.6,49.3,33.3,85.9,56.1,18.5,26.7,36.9,3.8,22.1,32.2,21.7,17.2,46.7,48.2,38.3,32,40.1,33.3,22.5,19,73.2,73.2
|
||||
324,GIN,Guinea,Sub-Saharan Africa,14405465,4321,39.1,36.2,51,47.4,64,61.4,81.4,81.4,7.7,7.7,100,100,67.1,67.1,58.5,65,95.6,95.6,69.6,69.6,33.4,33.4,91.1,91.1,65.9,65.6,87.1,25.4,66.8,65.7,39.7,30.6,69.1,56.4,NA,NA,44.2,5,8.3,8.3,48.8,48.8,43,38.2,53.9,55.4,39.7,28.6,12.4,25.6,52.8,43.7,52.5,48.7,44.9,33.8,62.5,66.9,80.3,85.6,34.7,28.7,20.5,22,42.4,45.9,38,41,100,100,95.6,81.4,21.1,31.6,9.6,9.6,95.7,95.7,0,0,0,0,0,0,29.7,32.4,34.5,36.8,71.6,67.4,2.5,4.6,40.6,27.6,61.8,62.4,62.2,62.7,35.2,38.9,5.5,4.5,15.1,20.1,10.5,19,11.6,20.8,20.9,23.2,19.3,23.2,39.3,39.3,95.5,95.5,1.8,1.8,1.8,1.8,28.7,22.2,28.7,22.2,35.9,7.1,100,49.3,0,26.6,36.8,3.8,14.3,22.2,40.3,56,47.8,48.3,6.2,16.8,25.2,31.4,21.8,20.6,73,73
|
||||
624,GNB,Guinea-Bissau,Sub-Saharan Africa,2153339,3110,42.1,41.6,48.7,44.8,54.9,54.2,47.7,47.7,21.4,21.4,100,100,63.3,63.3,60.5,79.4,71.9,87.9,23.4,23.4,46.2,46.2,96.7,96.7,70.5,70.4,60.5,0,59.3,56.6,39.2,33.7,65.5,50.9,NA,NA,33.9,17.3,11.8,11.8,56.3,56.3,64.8,67,46.7,49.2,100,100,43.3,14.4,100,100,35.9,19.5,57.5,35,50.4,45.3,65,64.3,36.2,35.9,79.7,26.1,44,42.2,28.6,28.2,81.2,67.5,90,76.3,40,40,10,10,100,100,0,0,0,0,0,0,33,35.4,41.2,42.9,87.8,83.5,1.3,3.2,36.8,24.4,74.1,71.3,54,51.6,51.5,51.4,14.7,14,14.8,19.8,9.7,19,10.5,20.4,13.4,16,11.7,16,25,25,61.5,61.5,0,0,1,1,39.4,41.8,39.4,41.8,41.8,39.2,100,100,24.4,37.1,NA,NA,36.3,43.6,53.1,67.9,48.2,48.8,21.3,29.3,38.8,43.6,39.3,39.6,88.8,88.8
|
||||
328,GUY,Guyana,Latin America & Caribbean,826353,91380,46.4,48.6,53.3,56.2,57.2,56.1,NA,NA,0,0,NA,NA,96.9,96.9,38.3,38.3,27.8,27.8,100,100,71.3,71.3,98.5,98.5,62.5,59.4,89.2,79.8,44.1,41,81.4,79.8,92.2,89,78.3,74.6,88.7,84.4,48.2,48.2,95.8,95.8,26,31.1,55.4,50.9,29.1,29.6,19.4,22.5,22.9,25.9,55.4,57.8,35.2,61.2,100,100,84,87.1,31.4,47,40,62.4,77.6,74,57.2,55.3,66.6,100,69.4,51.4,77.9,100,27.3,27.3,52.7,52.7,29.8,29.8,20.3,20.3,20.3,20.3,53.7,55.8,63.9,65.4,100,100,18.6,27.5,100,100,39.3,37.1,97.3,99.3,78.5,77.2,23,16.1,38.4,42.2,35.5,43.5,35.4,41.4,16.2,20.3,13.8,20.3,31.1,31.1,49.6,49.6,55.1,55.1,0.5,0.5,29.4,30.6,29.4,30.6,43.4,19.6,32,0,22.3,59.9,NA,NA,36.5,44.9,51.1,39.6,49.7,49.6,31.8,30.3,34.1,24,36.6,32.8,35.5,35.5
|
||||
332,HTI,Haiti,Latin America & Caribbean,11637398,3039,28.5,36.2,29.2,36.8,26.7,30.6,42.1,52.6,22.3,26.8,50,50,45.4,45.4,11.5,21.2,6.9,25,30.9,30.9,0,0,62.9,62.9,13.7,10.5,63.7,22.2,70.1,67.7,56.6,51.4,64.8,53.3,NA,NA,55.9,52.6,48.5,48.5,40.1,40.1,87.6,86.8,64.1,47.1,NA,NA,100,100,100,100,53.9,47.2,13,55.7,27,22.9,38.4,31.6,41,57.9,0,64.8,50.9,50.6,30.9,27.5,41.2,52.9,93.3,98.3,53.7,53.7,10.7,10.7,89.9,89.9,4.2,4.2,0,0,0,0,20,22.1,23.2,25,37.1,38.4,2.3,3.4,34.4,35.9,15.5,14.4,73,75.9,57.2,59.9,33,33.8,14.6,18.1,10.5,17.4,11.3,18.6,6.4,8.4,5,8.4,21.6,21.6,52.3,52.3,1.2,1.2,1.1,1.1,34.8,47.7,34.8,47.7,30.2,51.2,100,100,29.2,42.2,NA,NA,38,47,26,42.4,43.9,48,31.8,42,37.7,48,27.8,30.2,94.3,94.3
|
||||
340,HND,Honduras,Latin America & Caribbean,10644851,7605,37.4,40.2,47,49,51.8,51,76.9,76.9,24,25.6,51.5,11.1,64.7,64.7,60.5,61.9,59.3,60.2,85.3,85.3,39.9,39.9,95.3,95.3,20.4,16.7,11.1,0,80.4,77.5,36.2,20.2,42.4,27.1,28.8,0,41.7,25.5,35,35,44.7,44.7,55,45.3,43.6,29.2,53.2,37.4,63.6,53.1,65.2,55.1,61.6,18.3,53,87.8,74.1,74.4,86.5,89.8,45.2,77.9,55.2,100,39.3,38.6,36.7,34.9,48,40.5,41.2,41.3,45.6,40.9,28.3,28.3,47.1,47.1,34.7,34.7,19.5,19.5,19.5,19.5,21.8,22.8,18.3,18.7,11.2,14.5,9.7,11.5,40.4,33.1,34.4,41.1,52.1,54.5,56.5,61.9,0,0,34.3,37.8,29.3,36.1,32.5,38.9,17.5,18.7,17.5,18.7,25.7,25.7,50.5,50.5,25.3,25.3,1.2,1.2,35.6,41.2,35.6,41.2,38.1,44.1,66.5,77.7,27.9,38.4,36.8,3.8,25.8,34.1,17.1,84,49.4,48.6,30.5,37,36.2,41.4,24.8,24.8,79.8,79.8
|
||||
348,HUN,Hungary,Eastern Europe,9686463,49150,61.6,60.1,73,73.8,66.9,67,NA,NA,NA,NA,NA,NA,38.1,38.1,83.3,83.3,75,75,83.6,83.6,8,8,38.5,38.5,71.7,71.6,74.9,77.2,6,6.3,53.7,50.1,NA,NA,NA,NA,55.5,47.4,70.6,70.6,22.5,22.5,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,94.1,93.3,60.8,56.8,67.7,62.9,100,100,100,100,75,69.2,64.5,67,94.6,89.7,73.7,75.6,59.8,67.1,75.8,87.1,49.3,49.3,76.6,83.5,76.6,97.9,96,96,43.7,48.1,31.9,38.7,22.5,35.5,36.5,43.6,27.6,30.8,25.9,27,24.4,31.8,52.9,58.3,48.5,49.8,76.3,74,83.1,76.9,80.5,72.1,57.3,61.9,54.4,61.9,54,51.7,35.5,32.7,100,98.3,49.4,47.3,59,49.2,59,49.2,63.8,47.5,62.3,37.4,65.8,73.3,14.6,33.7,80.5,37.2,30,100,53.6,53.6,64.2,46.4,60.1,41,100,19.4,58.4,58.4
|
||||
352,ISL,Iceland,Global West,387558,80000,62,64.3,56.8,60.9,54,54.8,46,46.1,29.2,29.2,34.8,40.9,63,63,46.7,49.7,44.6,47.6,32.2,32.2,100,100,99.7,99.7,62.6,62.5,100,100,100,100,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,57.6,47.5,17.9,39,67.6,78.5,41.9,30.9,48.6,45.1,54.2,48.1,63.5,89.8,33.5,46.6,40.5,54.6,100,95.2,10.1,100,33.6,36.5,0,0,29,28.9,29.8,46.8,69.4,69.4,76.7,76.7,20.4,20.4,86.9,86.9,79.7,79.7,79.7,79.7,87.4,89.3,88.3,89.7,100,100,92.6,96.6,51.7,58.8,32.7,29.6,74.6,87.8,70.1,75.2,94.3,95.8,93.5,95.2,89.3,93.7,93.5,96.2,88.2,95.7,82.2,95.7,40.1,39.3,19.3,21.2,94.5,84.9,33.6,34.7,48.5,48.2,48.5,48.2,43.5,49.9,19.3,28.4,63,50.9,18.3,45.8,54.2,49.2,100,100,NA,NA,40.1,48.2,26.9,35.8,36.7,38.8,46.2,46.2
|
||||
356,IND,India,Southern Asia,1438069596,11940,23.5,27.6,28.1,30.5,13,11.4,1.6,1.9,0.2,0.2,100,100,0,0,0.9,0.9,0.7,0.7,0.8,0.8,88,88,94.5,94.5,3,0,85.7,61.1,15.6,15.7,75.4,73.8,76.2,71.9,90.2,90.4,74.2,63.6,56.6,56.6,70.9,70.9,37,37,84.1,81.3,54.1,58.9,22.1,16.8,25.1,19.5,45.2,40.8,31.9,55.3,32.5,25.1,29.9,22,22.8,66.4,30.6,57,59.7,65.1,45,51.6,38.1,39.4,62.9,45.8,76.7,88.8,29.9,29.9,71.8,71.8,32.7,32.7,19.2,19.2,19.2,19.2,11.4,13.3,5.9,6.8,0,0,5.8,10,0,0,33.8,37.9,11.1,8,3.7,0,20.4,17.8,20.2,25.6,14.8,25.3,16,25.8,26.3,28.2,25.7,28.2,31.3,31.8,64.3,65.6,9.3,9.3,9.3,9.3,26.4,35,26.4,35,24.1,37.1,20.3,42.6,39.6,39.2,0,18.3,21.3,31.2,15.6,56.8,48.5,49.2,19.6,31.1,26.1,34.9,0,0,70.6,70.6
|
||||
360,IDN,Indonesia,Asia-Pacific,281190067,17520,28.1,33.8,31.7,39.3,25.5,31.5,24.9,28.6,11.3,13,84.6,96.1,14.9,14.9,3.3,43.2,38.2,38.2,43.7,43.7,77.8,77.8,97.4,97.4,31.2,19.6,34.5,0,93.7,91.8,41.2,52.7,47.5,65,63.1,60.9,16.7,31.8,36.9,36.9,66.1,66.1,40.2,39.9,64.1,60.3,60.2,58.3,27.2,26.3,33.1,31.7,50.2,31.1,21.5,46.2,90.6,92.6,67.1,62.3,0,38.9,27,41,74,72.2,50.5,52.5,74.6,49.3,65.2,59.3,97.3,99.3,36.9,36.9,39,39,45.2,45.2,29.8,29.8,29.8,29.8,20.6,25.7,16.9,22.8,24.2,23.2,9.6,17.5,37.4,28.6,40.8,47.1,18.2,17.6,26.2,40.1,8.7,8.8,29.3,33.4,26.7,36.6,24.5,31.3,26.9,30,24.5,30,26.7,26.7,48,48,31.1,31.1,3.1,3.1,28.8,32.1,28.8,32.1,30.2,34.7,23.2,30.7,9,25.9,37.4,8.5,25,21.3,48,100,45,44.2,22.9,28.9,25.2,29.6,0,0,55.3,55.3
|
||||
364,IRN,Iran,Greater Middle East,90608707,20370,41.6,41.6,45.5,45.9,43.8,42.9,66.4,66.4,22.2,22.2,100,100,10.1,10.1,24,25.4,23.2,23.2,68,68,65.5,65.5,80.2,80.2,61.9,54.2,81.6,69.6,45.7,44.9,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,62.4,63.3,55.5,76.5,61.5,62.6,50.2,58.4,70.2,67.8,42.6,20.2,63.9,70.7,18.7,2.4,25.2,5.2,44.1,80.1,78.3,88.1,41.2,37.8,26.9,31.6,49.4,83.7,54.4,50.2,28.7,35.1,28.1,28.7,51.8,51.8,30,31.5,21.8,21.8,21.8,21.8,40,41.6,36.6,36.9,19.8,15.8,56.8,66.6,32.6,29.3,21.8,21.8,11.7,6.7,33.3,22.9,24.4,22.6,60,65.6,52.2,61.5,59.6,68.3,22.8,26.8,20.8,26.8,31.7,31.7,52.4,52.4,19.8,19.8,17,17,37.1,35.1,37.1,35.1,37,44,12.7,22.6,40.6,35.4,35,14,100,35.9,37.8,68.7,52.9,53.4,25.4,30.5,26.5,30.4,0,0,37.5,37.5
|
||||
368,IRQ,Iraq,Greater Middle East,45074049,15260,24,30.4,27.4,33.1,21.4,20.2,0,0,0.4,0.4,NA,NA,8.8,8.8,12.8,12.8,1.9,4.9,17,17,68.1,68.1,78.2,78.2,38.4,31.6,94.7,87.1,41.5,38.3,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,74.2,72.7,NA,NA,72.3,68.2,81.9,75.8,82.7,76.8,100,47.1,8.7,57.3,10.2,0,26.6,9.6,0,51.1,34.9,84.6,52,49.6,28.5,31.5,53.6,52,90.5,84.2,41.4,53.2,48.9,44.1,64.9,55,27.1,28.9,71.8,60.5,28.2,28.2,30.9,32.6,26.7,27.7,10.4,4.2,31.7,51,36.6,35.8,26,24.1,14.8,10.7,36.8,33.4,22.6,23.2,52.1,57.7,46.5,58.2,48.7,57.3,24.1,24.3,22,24.3,10.9,8.6,22.5,16.7,0,0,4.8,4.8,13,24.6,13,24.6,35.3,38.7,21.4,26.8,0,12.1,36.7,5.5,0,24.7,36.4,48.1,0,0,14.6,19,20.1,25.5,5.4,4.1,36.7,36.7
|
||||
372,IRL,Ireland,Global West,5196630,133550,63.4,65.7,61,67.5,50.7,62.9,30.9,33.1,42.6,46.9,70.9,60.7,46.8,46.8,25.1,93.8,43.9,47,70.3,70.3,66.9,66.9,95.5,95.5,60.2,60.5,96.8,97.7,70,72.9,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,62.2,40.6,41.2,14.6,40.3,43.6,59.5,28.9,60.6,56.8,42.1,52,86.6,87.3,15.5,22.4,19.3,25.3,100,100,100,100,75.7,72.9,50.6,46.6,29.6,23.5,82.8,80.9,89.9,100,72.7,73.8,10.4,10.4,93.5,94.8,62.1,63.6,94.3,94.3,77.2,79.8,74.7,76.8,62.3,67.1,87.8,93.5,57.6,85.4,20.2,25.6,55.2,61.3,67.2,72.5,80.3,83.4,87.1,88.4,78.2,82,90.9,92.7,84.1,93.2,78.6,93.2,56.4,60.7,22.9,19.8,95.8,98.7,70.1,82.6,55.6,51.1,55.6,51.1,61.1,50.5,47.1,32,64.3,51.5,48.5,80.9,60.9,47.9,100,100,55.8,52.5,59.6,51,46.4,36.9,29.2,20.5,48.3,48.3
|
||||
376,ISR,Israel,Greater Middle East,9256314,54446,47.6,48.1,45.1,43.6,31.4,30,0,0,50,50,57.7,100,18.7,18.7,32.8,34,68.3,69.5,23.3,23.3,46.2,46.2,92.1,92.1,10.4,10.7,54.4,0,48.1,47.7,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,23.7,27.5,NA,NA,19.3,25.4,11.8,22.1,15.7,25.6,51.2,75.5,61.7,65.2,31.2,18.3,51.4,32.4,52.2,46.4,99.3,100,63,45.3,35.9,24.5,40.4,51.6,37.2,45.2,92.5,65.6,90.3,90.5,32.9,32.9,97.7,97.9,96.8,97,92.3,92.3,60.3,62,52.3,53.7,36.7,33.3,83,88.5,35.9,41.6,17.7,24,0,0,27.9,26.9,38.5,41.4,78.7,80.2,74.5,77.9,79.7,81.7,94.3,100,89.9,100,36.6,37.1,21.2,19.2,100,100,20.4,23.5,40.7,43.3,40.7,43.3,42.2,60.6,24.3,51.5,21,2.1,0,14.6,62.3,42.7,100,95.2,58.1,11.4,36.1,48.9,27.9,41,15.3,18.6,55.8,55.8
|
||||
380,ITA,Italy,Global West,59499453,62600,55.8,60.5,58.4,63.4,53.5,58.9,66.3,66.8,37.3,41.8,44.1,45.3,55.4,55.4,26.7,57.6,57.4,72.1,71.9,71.9,70,70,44.7,44.7,63.4,57.8,77.5,59.4,34.3,34.4,65,55,NA,NA,NA,NA,77.8,61.3,48.5,48.5,36.5,36.5,35.5,34,20.8,11.3,45.3,48.8,28.2,35.5,24.4,30.1,67.3,63.1,72,89.5,38.3,32,51.3,41.9,86.5,100,100,100,62.1,56.4,45.5,41.7,46.4,43,65.7,61.2,72.8,70.3,70.9,73.9,28.5,28.5,86.9,86.9,62.5,70,82.6,82.6,61.1,63.9,49.1,52.3,29,31.7,75.6,79.4,43.7,38.6,24.8,34.3,41.5,50.8,45.3,54.7,45.3,44.8,97.9,98.2,94.7,95.6,100,100,74.9,79.6,71.1,79.6,52.5,57.5,27.5,28.1,90,90.9,58.7,70.2,47.5,53.2,47.5,53.2,54.1,55.9,42.7,45.4,55.4,51.9,23.9,40.5,76.8,56.7,64.1,100,53.4,52.9,54.5,54.6,47.7,48,9.3,9.2,67.6,67.6
|
||||
388,JAM,Jamaica,Latin America & Caribbean,2839786,12283,47.7,48.5,49.9,49.7,39.7,38.9,76,76,19.2,20.3,50,50,44.5,44.5,31.2,32.4,62.1,63.4,58.1,58.1,52.2,52.2,52.2,52.2,0,0,45.3,0,80.6,77.8,65.2,68.7,74.8,83.2,NA,NA,58.5,64.3,45.6,45.6,50.1,50.1,84,83.2,82.3,20.6,91.4,88.5,100,100,100,100,46.1,47.5,74.9,77.4,21.9,19.1,25.2,22.6,89.1,77.5,88.7,100,60.3,55.1,67.5,54.4,46.8,42.5,53.6,55.6,53.3,56.6,40.5,40.5,49.1,49.1,46.8,46.8,33.7,33.7,33.7,33.7,38.1,39.5,34,35.8,35.2,35.9,25.9,29,49.3,50.9,27.3,33.8,38.1,41.2,63.6,67.3,41.7,43.4,53,53.8,51.9,53.4,53.3,54.1,42.2,42.7,43,42.7,25.5,25.5,37,37,50.5,50.5,1.4,1.4,52.4,54.3,52.4,54.3,52.1,58.8,63.9,75.3,61.2,54.4,30.6,24,71.6,51.8,56.6,41.1,47.1,50.2,50.6,56.8,52.7,58.1,36.3,41.5,90.2,90.2
|
||||
392,JPN,Japan,Asia-Pacific,124370947,54910,57.6,61.7,56.9,59.9,46.8,47.5,42.6,42.9,55.9,58.7,33.7,37,25,25,45.3,58.9,88.5,95.1,26.9,26.9,68.8,68.8,78.5,78.5,27.3,17.7,70.8,43.3,72.8,72.5,79.6,80.1,NA,NA,92.8,98,81.4,76.4,47.3,47.3,57.4,57.4,41,48.5,32.6,49.8,40.5,44.2,39.8,40.7,50.8,54.5,47.7,58.4,72.5,86.4,17.8,17.9,19.8,18.6,100,100,59.3,100,61.9,63.3,48.9,50.3,24.6,25.1,29.4,38.5,89.9,89.8,76.6,78.4,24.6,24.6,89.9,91.7,77.8,80.6,70.7,70.7,65.4,67.4,57.4,59.9,40.5,42.2,83.2,86.7,59.2,62.9,12.7,17.7,29.2,33.9,50.2,58.9,40.2,43.9,77.5,78.7,77.9,80.5,75.8,77.5,100,100,98.8,100,72.5,73.6,38.8,39.6,99.3,100,92.7,94.4,52.2,59.7,52.2,59.7,49.9,63.1,29.8,48.4,70.8,72.3,62.5,40.6,71.1,63.3,100,100,51,50.5,47.9,61.1,38.4,52.8,0,10,76.9,76.9
|
||||
400,JOR,Jordan,Greater Middle East,11439213,11380,37.7,47.5,36.7,50.1,30.5,32.9,NA,NA,0,0,NA,NA,31.6,31.6,5.2,13.5,3,12.2,14.9,14.9,57,57,87.1,87.1,87.6,87.4,82.5,62.3,64.9,64.5,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,96.2,95.7,NA,NA,100,100,100,100,100,100,49.2,26.1,13.4,85.5,11.3,4.6,27.4,21.1,21.8,100,52.1,100,34.1,38.1,31.5,31.1,51,88.4,52.6,49.9,29.1,35.9,72.5,73.3,53.4,54.3,63,63,89.3,91.2,62.1,62.1,44.6,46.6,41.1,42.9,22.6,20.4,65.2,74.2,33.6,41.1,12,18.6,0,0,37.2,32.3,37.1,36,62.3,64.3,61.1,65.6,60.1,63.5,38.8,42.8,33.8,42.8,27.3,27.3,47.4,47.4,29.4,29.4,6.2,6.2,33.2,44.6,33.2,44.6,42.1,58,50.7,78.1,0,15.7,36.7,3.8,20.2,42.4,100,100,0,0,33,45.3,34.1,47.1,21.9,24.3,78.7,78.7
|
||||
398,KAZ,Kazakhstan,Former Soviet States,20330104,43610,43.3,47.5,51.5,49.2,50.2,50,87.6,87.6,41.7,41.7,50,50,12.6,12.6,57.4,58.3,32.3,32.6,34,34,31.9,31.9,16.1,16.1,63.7,62.3,93.3,88.9,22.4,22,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,76.9,61.7,35.7,42.1,44.8,54.2,48.9,55.5,100,73.4,43.2,44.7,28.7,37.4,100,95.1,87.6,66.4,18.2,38.7,32.2,32.6,0,0,57,56,11.3,13.2,48.9,48.9,46.6,50.8,41.1,44.5,43.5,48.2,31.1,45,26.4,22.4,43.3,41.6,32.4,33,62,64.5,53.4,53.1,66.7,73.1,56,68.4,62.5,76.3,51.6,58.6,45.1,58.6,28.5,30.8,48,47,31.1,34.2,7.8,13,28.6,42.3,28.6,42.3,38.3,51,8,25.1,14.9,44.1,0,41.9,52.3,20.4,0.3,96.4,43.2,45,21.1,38.9,14.6,31.1,4.6,8.1,40.1,40.1
|
||||
404,KEN,Kenya,Sub-Saharan Africa,55339003,7520,37.3,36.9,48,49.1,44.7,43.9,58.6,58.6,20.3,20.3,43.4,59.9,38.4,38.4,51.3,54.4,40.1,40.2,54.6,54.6,31.2,31.2,5.5,5.5,34,24.9,90.1,80.7,14.9,15.2,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,73.9,77.1,64.1,78.7,65.5,70.9,100,90.6,74.2,78.2,30.5,21.4,60.5,72.6,78.6,70.2,84.8,74.9,13.8,45.1,40.9,100,49.3,44.2,42.7,44,54.1,44.9,85.2,83.8,38.8,27.8,38.2,38.7,48.5,48.5,7.5,8.5,76,76,0,0,27.5,27,27.1,25,31.3,32.4,6.6,8.8,58.6,31.1,60.6,64.5,49,48,28.4,26.5,18.4,17.4,16.8,21.2,12.2,20.1,13.4,22,42.2,45.7,39.6,45.7,59,51.8,100,87.7,74.9,73.4,10,5.2,29,26.5,29,26.5,25.1,24,75.4,73.3,5.4,17.2,0,24.2,0,13.2,19.4,30.1,40.9,46.7,19.5,24.6,25.1,29.3,13.6,11.8,76.9,76.9
|
||||
296,KIR,Kiribati,Asia-Pacific,132530,3612,45.2,44.1,46.8,45,33.2,31.4,23.6,23.6,8,8,99.8,100,NA,NA,NA,NA,57.7,58.3,29.7,29.7,NA,NA,NA,NA,27.9,18.9,NA,NA,100,100,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,92,91.4,79.3,94.1,82.7,82.2,100,100,100,100,62.1,16.4,86,81.1,89.1,94.3,NA,NA,100,89.9,87.5,69.7,58.3,58.6,23.1,23.8,100,100,77.8,77.8,81.9,81.9,19.5,19.5,81.9,81.9,20.4,20.4,6.3,6.3,6.3,6.3,45.9,46.2,54.9,54.5,100,100,2.5,5.1,27.9,14.6,82.5,72.9,100,100,95.4,97.6,100,100,19.6,21.6,17.1,21,18.4,22,48.6,50.3,47.3,50.3,18.8,18.8,42.3,42.3,0,0,4.7,4.7,42.6,40.9,42.6,40.9,40.5,37.9,100,95.7,28.9,30.2,NA,NA,32.6,37.8,41.7,66.7,NA,NA,34,31.7,43.6,40.3,64.8,62.8,96.6,96.6
|
||||
414,KWT,Kuwait,Greater Middle East,4838782,49736,46.8,44.9,56.7,54.8,50.7,50.6,0,0,6.5,7.4,50,100,44.2,44.2,71.2,71.5,54.8,55.3,86.8,86.8,87,87,99.8,99.8,61.8,55.3,81,67.5,48.3,49,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,19.6,23.3,NA,NA,0,0,21.1,25.8,24.5,29.1,47,63.6,63.4,51.8,0,0,0,0,42.2,44.9,72.9,79.3,62.9,59,44.5,37.1,16.2,7.7,84.3,75,78.4,78.4,87.4,87.4,30.9,30.9,100,100,88.7,88.7,88.7,88.7,50.1,50,41.6,41.5,12.4,7,76,82.5,54.7,62.4,5.2,9,0,0,34.7,30.2,13.7,11.1,75.3,76.5,77.5,81.5,72.1,73.1,54.6,60.3,48.8,60.3,59,42.6,28.9,17.2,79,59.6,79,59.6,28.5,24.9,28.5,24.9,36.6,38.6,2.1,4.7,47.8,42.6,36.2,5.8,20.5,29.9,0,75.5,NA,NA,27.6,22.1,5.2,1,11.7,9.7,0,0
|
||||
417,KGZ,Kyrgyzstan,Former Soviet States,7073516,7773,29.5,42.2,35.5,43.3,37.5,36.5,NA,NA,NA,NA,NA,NA,36.3,36.3,13.7,13.7,11.7,11.7,13.7,13.7,64.1,64.1,74.8,74.8,64.2,63.6,91.2,83.9,39.8,40.8,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,30.3,77.3,3,2.6,31.3,27.6,0,100,33.1,79.4,54.7,51.9,43.4,39.5,72.9,59.9,80.7,51.8,42,63.6,22.7,22.7,75.9,75.9,26.9,26.9,8.7,8.7,8.7,8.7,32.2,36.7,26.2,30.6,37.4,45.7,7.3,14.2,12.4,21.5,32.3,25.5,37.5,38.8,61.9,61.9,45.5,45.8,53.3,59.4,43.4,54.8,49.5,62.4,38.4,43.1,34.2,43.1,16.2,14.8,37.2,33.9,0,0,3.2,3.2,17.5,45.4,17.5,45.4,25.1,56.2,33.1,89.6,19.4,22,NA,NA,14.9,35.2,0,52.4,46.5,47.6,14.9,39,23.9,45.9,24.5,28,79.1,79.1
|
||||
418,LAO,Laos,Asia-Pacific,7664993,9727,24.2,26.1,35,40,39.1,50.8,NA,NA,NA,NA,NA,NA,32.9,32.9,44.8,66.2,37.3,63,63.2,63.2,74.4,74.4,97.3,97.3,44.2,43.4,0,0,93,90.5,31.8,24.5,52.3,40.4,35.9,25.7,24.6,2,14.2,14.2,55.8,55.8,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,16.2,16.2,54.2,56.1,53.3,55.5,30.8,16.6,15.4,0,75.4,78.5,59.8,78.1,65.9,45.5,72.2,72.2,84.4,84.4,20.9,20.9,51.2,51.2,24.7,24.7,11.8,11.8,11.8,11.8,16.5,19.2,11.8,13.7,5.3,9.9,2.7,6.8,22.9,22.2,49.8,49,47.3,49.4,18.9,34,0,0,26.2,32.3,19.6,30.9,21.7,33.3,19.1,21.9,16.7,21.9,42.6,42.6,94.9,94.9,12.1,12.1,5.5,5.5,13.4,9.6,13.4,9.6,0,0,0,0,21.8,28.8,NA,NA,14.3,24.4,22.6,52.3,47.9,48,19.9,0,24.6,0,24.9,16.5,27.6,27.6
|
||||
428,LVA,Latvia,Eastern Europe,1882396,45450,59,59.9,70.3,68.6,69.3,68.3,86.8,86.8,42.9,42.9,39.1,37.2,42.6,42.6,83,84.2,60.3,60.4,95.2,95.2,71,71,55.7,55.7,96.3,96.3,63.2,44.2,10.2,11.3,39.8,31.8,NA,NA,NA,NA,35.9,26.5,50.7,50.7,20.6,20.6,72.6,69,43.2,34.4,37.7,54.9,88.4,87.4,96.1,81.2,41.6,51,86.3,82.4,43,46.8,46.6,52.1,89.8,100,100,77.9,67,64.4,45.5,60.3,55.7,52.3,78.1,73.4,63.5,65.8,68.1,69.8,22.2,22.2,75.1,77.3,74.8,76.9,59,59,49.3,52.8,40.9,45.1,29.4,37.8,33.7,45.1,69.7,70.5,31.9,30.6,53.5,56.6,53.2,59.3,59.6,67.5,74.9,75.1,73.3,73.8,76.2,75.9,63.4,68.1,58.4,68.1,36.1,42.8,28.2,24.7,77.5,84.4,23.2,40.1,49.8,52.4,49.8,52.4,52,52.4,51,51.7,46.2,73.1,6,48.1,34.3,43.5,66.3,60.7,49.6,49.1,48.2,51.3,44.4,46.5,32.3,33.7,67.2,67.2
|
||||
422,LBN,Lebanon,Greater Middle East,5733493,11784,32.2,40.1,34.1,38.1,25.3,24.1,5,5,0,0,100,50,14.9,14.9,4.2,4.3,5.8,6.2,4.3,4.3,42.6,42.6,79.2,79.2,87.1,87.6,88.9,63.2,48.9,49,64.5,48.5,NA,NA,NA,NA,68.5,45.7,60.8,60.8,37.5,37.5,96.9,96.2,NA,NA,92.6,94,100,100,100,100,55.4,60.2,22.8,62.5,29.4,23.2,33.9,27,0,68,59.3,72,53,50.6,39.2,44.6,29.6,52.7,41.3,37.5,62.6,61.8,47.3,47.3,38.6,38.6,55,55,42.8,42.8,42.8,42.8,44.1,46.3,37.9,40,29.6,27.4,52.8,62.1,26.6,35.5,5.2,0,10,10.1,31.7,33.5,41.4,45.7,60.7,63.2,66.4,73.2,53.4,56.6,58.3,62.4,54.1,62.4,36.6,36.6,40,40,57,57,23,23,19.3,38,19.3,38,32.8,47.8,16.2,39.3,16.5,22.3,36.6,4.5,11.5,38.2,0,67,48.5,45.5,26.6,37.3,24.8,37.7,21.4,23.1,56.2,56.2
|
||||
426,LSO,Lesotho,Sub-Saharan Africa,2311472,3260,36.6,36.6,45.7,46.3,51.5,60.4,NA,NA,NA,NA,NA,NA,25.6,25.6,0.5,60.1,69.9,69.9,66.6,66.6,64.1,64.1,77.2,77.2,81,80.9,93.6,53.2,79.6,79.7,69.7,59.6,NA,NA,NA,NA,81.1,64.8,53.3,53.3,45.9,45.9,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,55.4,35,59.9,54.7,64.2,61.4,0,29.6,0,31.3,35.4,34.3,11.2,11,59,73.9,84.9,84,33.5,33.5,9.6,9.6,84.8,84.8,2.9,2.9,0,0,0,0,13.7,12.8,14,11.8,11.5,6.1,2.4,4.3,24.5,15,67.7,68.4,16.6,15,53.5,47.7,26,20.2,7.6,9.4,5.4,8.9,6.1,9.8,13,16.1,11.8,16.1,40.4,40.4,100,100,0,0,1,1,41.9,41.7,41.9,41.7,33.7,43.7,49.4,67.5,47.6,55.8,35.2,0,56.1,60.9,41.9,60.2,0,0,24.2,32.5,38.9,49.3,35.7,38.2,85.4,85.4
|
||||
430,LBR,Liberia,Sub-Saharan Africa,5493031,1902,32.9,34.1,32.2,30,26.5,26.5,NA,NA,4.5,4.5,100,100,24.6,24.6,14.7,15,12.7,12.7,10.3,10.3,55.9,55.9,96.9,96.9,72.4,72.4,18.7,0,70.7,69.5,50.7,42.4,69.3,49.2,77.9,68.4,33.9,6,32.1,32.1,47.8,47.8,65.9,68.8,65.3,49,99.3,96.2,13.8,21.1,99.6,99,41.2,45.7,42.3,34.1,69.3,69.8,90.2,91.6,23.5,26.8,61.7,22.7,38.4,34,24.3,22.2,91.2,70.6,72.7,49.8,36.2,36.2,9.9,9.9,99.1,99.1,0,0,0,0,0,0,32.7,36.3,39.5,43.2,78.4,76.9,4.3,5.6,60.2,33.7,77,73.6,79.2,79.8,54.7,51.7,19.7,16.2,14.2,18.7,9.9,18,10.6,19.1,24.2,25.5,22.6,25.5,28.2,28.2,69.6,69.6,0,0,1,1,34.2,38.4,34.2,38.4,29.5,39.9,100,100,6,21,NA,NA,0,35.2,38.1,55.7,48.3,48.4,18.5,28.4,29.1,40.3,35.6,36,96.1,96.1
|
||||
440,LTU,Lithuania,Eastern Europe,2854099,56000,59.6,63.9,70.3,74.3,68.6,74.8,61.1,61.1,100,100,55.5,68.8,41.7,41.7,53.4,94.5,56,56.5,86.9,86.9,50.2,50.2,41.8,41.8,96.7,96.8,89.5,77.5,0,0,51.1,45.9,NA,NA,NA,NA,45.4,38.6,79,79,16.4,16.4,81.1,80.1,NA,NA,40.5,74.4,77,81.2,92,89.8,64.3,28.9,81.3,83.2,45.7,50.8,50.2,57.1,80.4,78.2,98,100,66.7,67,42.6,61,64,78.5,74.2,76.1,65.7,68.3,70.8,73.8,35.2,35.2,76.7,79.8,72.4,77,75.9,75.9,53.4,58.8,46.3,53.2,31.3,45.2,46.4,58.4,58.3,73.8,32.2,29.5,49.1,50.9,56.2,60.4,67.5,69.7,72.1,72.5,69.2,70.4,74.1,73.9,65.4,71.5,60.2,71.5,56.8,61.3,30.5,28.1,94,93.5,64.6,78.3,48.4,52.4,48.4,52.4,50.6,48.9,42.7,40,70.1,100,0,45.8,38.1,55.5,45,41.9,48.9,48.6,47.7,50.9,41.9,43.9,27.5,28.8,61,61
|
||||
442,LUX,Luxembourg,Global West,665098,154915,71.7,75,83.1,83.6,82.7,84.9,NA,NA,NA,NA,NA,NA,89.6,89.6,93.1,100,100,100,89.2,89.2,0,0,0,0,94.3,93.2,60.8,66.4,31.3,32,52.6,46.1,NA,NA,NA,NA,57.5,51,51.4,51.4,11,11,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,95.1,94.3,66.5,61,77.1,70.2,100,100,100,100,66,62.8,51.4,44.8,36.2,35.1,84.6,80.3,72.7,75.9,92,92.4,40.8,40.8,99.4,99.4,98.5,99.4,87.8,87.8,69.7,74.6,61.2,67.1,34.4,52.9,89.5,94.5,43.2,45,13.9,23.1,59.5,68.2,51.5,58.6,57.7,58.5,91.4,93.2,88.9,93.2,90.8,93.2,90.1,97,85.3,97,63.3,63.8,12.9,13.6,100,99.8,95.4,95.9,55.8,62.4,55.8,62.4,59.6,67.4,38.7,49.3,50.7,68.7,29.7,53.2,66.5,78.6,100,100,49.8,49.6,55.9,62.5,34.9,48.4,36.5,47.5,74.1,74.1
|
||||
450,MDG,Madagascar,Sub-Saharan Africa,31195932,1990,29.2,29.9,28.4,27.7,27.4,27,15.9,19.8,10.5,14.8,81.9,55.2,34.5,34.5,38,38.9,23.5,24.3,24.5,24.5,68.3,68.3,91.1,91.1,25.2,14.9,0,0,75.1,75.2,26.7,23.5,41.9,33.8,36.9,20.6,26.5,11.3,20.5,20.5,46.3,46.3,53.8,49.3,94.9,33.1,67,54.9,65.4,51.1,63.5,52.3,44.3,45,29,31.2,81.2,71.2,97.9,85,30.7,24.9,0,18.7,52.5,48.2,47,42.6,100,100,90,80.6,42.7,36,10,10,100,100,0,0,0,0,0,0,26.2,26.5,31.6,30.8,47.7,49.6,2.2,3.5,63.9,31.4,51.3,47.1,82.1,85.7,57,64.2,16.6,18.2,9.7,12.9,6.5,12.1,7.5,13.5,21.8,23.9,20.1,23.9,25.7,25.7,63.4,63.4,0.6,0.6,0.6,0.6,33,36.1,33,36.1,25.2,34.1,100,100,36.9,38.8,36.8,3.8,38.1,75,33.5,8.2,47.6,48.9,24.6,29.9,41.7,44.7,22.2,22.2,92.4,92.4
|
||||
454,MWI,Malawi,Sub-Saharan Africa,21104482,1714,41.3,34.9,57.8,53.8,68.3,68.3,NA,NA,NA,NA,NA,NA,63.9,63.9,79.2,81.4,67.3,77.6,79.9,79.9,24.5,24.5,90.9,90.9,37.5,37.6,96.2,86.5,16.6,17.1,45.2,28.2,70.7,30.7,NA,NA,45.6,26.4,10.6,10.6,57.3,57.3,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,68.4,47.5,88.2,84.8,100,98.2,45.9,35.3,85.1,42.2,47.1,46.6,43.9,43.6,100,56.3,73.2,65.8,41.2,40.8,21.7,29.4,100,100,16,16,13.2,32.5,0,0,21.1,20.8,21.9,20,24,21.4,3.4,5.3,45.1,36.9,58.1,48.8,64.3,64.6,43,45.5,14.5,15.8,13.4,17.1,9.7,16,11,17.8,27.2,29.9,25.1,29.9,33.9,33.9,83.7,83.7,0,0,1,1,32.8,17.7,32.8,17.7,38.1,15.3,100,100,6.6,2.7,36.8,3.8,0,0,46.8,66.3,37,42.9,20,5.9,33.5,17.7,28.1,22.9,90.3,90.3
|
||||
458,MYS,Malaysia,Asia-Pacific,35126298,43100,34.1,41.2,33.8,39.7,28.3,28.8,6.2,6.2,6.6,12.4,39.8,86.1,14.6,14.6,56.8,57.7,31.3,42.8,40,40,80,80,96.7,96.7,11,0.1,0,0,100,100,25.8,41,36,49.9,33.8,55.9,0.7,14.5,31.1,31.1,50.1,50.1,52.4,52,51.3,51.5,87.9,87.8,39.5,39.4,41.8,41.3,54.5,48.7,31.8,60.7,88.1,88.9,60.9,53.8,28.3,68.6,12.3,48.6,65.2,63.6,56.7,63.9,46,45,14.6,19.7,86.7,83.2,45.1,48,35.3,33.2,75.4,83.1,22.9,22.9,22.9,22.9,39.2,45.7,33.8,43.2,24.2,33.7,52.8,60.2,47.6,35.1,24.6,29.5,35,37.5,31.8,46,0,0,53.5,54,54.9,57.7,52,51.6,48.6,51.3,46.2,51.3,40.1,35.4,31.9,32.7,100,47.2,18.3,32.2,30.2,39.9,30.2,39.9,35.7,41.3,9.6,17.5,52.4,44,19.8,43.5,29.1,64.3,42.4,90.2,46.1,44.8,29.3,36.2,24.6,29.2,5.3,5.1,36,36
|
||||
462,MDV,Maldives,Southern Asia,525994,34322,35.3,38.1,40.5,39.4,15.5,12,0,0,0.9,1.3,81,26.8,NA,NA,NA,NA,1.3,5.9,0,0,NA,NA,NA,NA,59.6,47.3,NA,NA,NA,NA,71.3,72.9,75.3,70.1,NA,NA,77.6,84.5,52,52,NA,NA,90.3,90.5,75.7,52.2,100,99.5,100,100,100,100,54.3,54.9,68.2,65.9,NA,NA,NA,NA,60.5,58,68.5,73.8,48.7,55.8,47,46.4,72.7,73.4,77.8,77.8,54.5,54.5,40.6,40.6,38.4,38.4,45.4,45.4,37.1,37.1,37.1,37.1,45.9,48,46.5,47.8,41.8,44.2,28,40.4,34.7,21.6,93.3,96.9,94.2,97.2,72.2,74.5,91.8,93.5,47.8,51.9,46.8,61.3,41.2,45.7,52.2,57.3,47.6,57.3,13.4,13.4,29.4,29.4,2.7,2.7,2.7,2.7,19.4,27.9,19.4,27.9,24.2,30.4,8.5,18.5,1,15.9,NA,NA,0,28.3,0.9,38.5,49.9,50,16.2,25.2,15.1,23.5,42.2,40,54.6,54.6
|
||||
466,MLI,Mali,Sub-Saharan Africa,23769127,2843,37.1,33.9,45.9,43.2,51.7,50.8,NA,NA,NA,NA,NA,NA,15.9,15.9,70.5,71,18.6,19,16.6,16.6,22,22,92.2,92.2,93.3,92.9,94.7,85.4,27.7,26.3,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,47.6,36.7,58.4,56.4,89.5,91.2,3,26.3,62.3,32.2,67.9,66.4,41.7,47,100,100,99.1,99.2,73.2,69.4,8.9,8.9,89.4,89.4,0,0,0,0,0,0,35.2,37.5,42.8,44.7,92.3,88.3,3.9,5.5,39.5,19.8,54.1,48.2,84.5,82.6,54.7,54.6,9.4,8.4,14.1,18.3,10.1,17.3,11.1,19,25.9,27.3,25.2,27.3,30,30,74,74,0,0,1,1,25.4,16.5,25.4,16.5,20.9,4.6,83.6,50,19,11.9,36.8,3.8,25.6,7.8,44.1,65.4,0,45.5,15.1,6.4,33.7,25.3,20.5,16.3,70.3,70.3
|
||||
470,MLT,Malta,Global West,532956,75822,62.1,66.6,55.1,65.5,47,67.7,41.7,99.3,56.6,57.9,45.5,36.8,NA,NA,10.3,34.6,94.1,95.2,99.8,99.8,0,0,0,0,75.1,75.1,NA,NA,27.1,26.7,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,57.3,56.9,11.2,33.6,16.9,33.2,42.2,74.4,0,73,40.2,21.8,83.3,83.3,0,0,0,0,82.3,100,100,100,57.2,43.5,48.5,16.4,23.8,21.6,45.5,39.5,74,74,51.8,51.9,17.8,18.5,100,100,0,0,100,100,68.6,72,66.2,69.9,68.4,69.9,74.5,83.4,44.3,42.6,23.7,27.4,36.3,48.2,67.6,70.5,80.2,80.9,89.7,91.7,83.9,88.9,90.5,93.6,57,63.7,51.2,63.7,27.1,27.1,14.7,14.7,93.1,93.1,6.5,6.5,66.1,63.6,66.1,63.6,56.4,67.2,61.3,78.7,59,34.7,0,44.7,89.2,79.7,33.4,100,100,100,51,63.6,45.4,59.8,43.6,57.7,89.7,89.7
|
||||
584,MHL,Marshall Islands,Asia-Pacific,38827,6688,41.9,42.6,38.2,34.9,14.9,13.4,0.2,0.2,5.1,5.1,100,100,NA,NA,3.8,3.8,2.9,2.9,0,0,NA,NA,NA,NA,49.3,39.6,NA,NA,92.5,93.1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,91.7,86.9,51.6,56.2,71.4,70.6,100,100,100,100,NA,NA,95.1,83,80.4,88,NA,NA,79.6,92.5,100,72.5,77.8,77.8,NA,NA,NA,NA,77.8,77.8,NA,NA,39.8,39.8,54.9,54.9,47.2,47.2,30.8,30.8,30.8,30.8,54.8,55.4,63.1,63.4,100,100,5.8,8,100,100,88.1,78.4,100,100,91.7,93.9,100,100,35.3,36.5,34,36.2,34.9,36.7,41.5,44.2,39.3,44.2,36.4,36.4,57.9,57.9,22.1,22.1,22.1,22.1,35,41,35,41,41.1,46.7,32.8,41.7,0,17.5,NA,NA,9.5,28.3,44,69.9,NA,NA,24.7,33.9,35.7,41.8,60.2,61.2,67.9,67.9
|
||||
478,MRT,Mauritania,Sub-Saharan Africa,5022441,8233,37.7,34.2,37.9,33.7,37.1,36.2,45.4,45.4,20.7,20.7,100,100,0.9,0.9,5.1,5.2,2,2,52.3,52.3,NA,NA,NA,NA,91,90.4,90.1,80.4,58.8,58.3,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,78.7,77.1,66.3,60.5,14,54.4,74.9,81.7,31.1,95.9,18,63.2,47.8,23,33.2,34.5,57.5,56.1,24.1,14.4,58.9,22.7,41.3,42.1,16.1,21.5,65,62.4,97.2,95.7,38.7,38.7,11.9,11.9,90.8,90.8,7.1,7.1,0,0,0,0,45.7,46.3,54,53.5,100,100,9.3,11.8,61.9,42.4,36.1,35.2,70.9,69.4,69,68.8,28.1,30.7,22.8,27,17.8,25.7,19.5,27.9,40.1,40.8,39,40.8,30.1,30.1,71.6,71.6,4.5,4.5,1.4,1.4,30.5,24.8,30.5,24.8,25.5,17.9,46.9,32.5,36.4,34.7,36.7,3.8,35.1,36.2,37.3,42.5,0,0,27.5,22.9,37,31.5,28.6,25.5,61.5,61.5
|
||||
480,MUS,Mauritius,Sub-Saharan Africa,1273588,32063,44.5,47.3,33.2,34.3,16.4,14.6,0.8,0.8,17.1,17.1,73.9,1.7,NA,NA,11,11,15.7,15.7,6.7,6.7,100,100,99.7,99.7,0,0,NA,NA,79.9,75.8,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,78.3,75.7,46.4,16.1,87.9,70.9,91.8,87.2,82.3,94.6,34.7,83.7,58.7,69.6,62.8,47,NA,NA,59.2,77.7,49.6,66,64.2,68.6,86.7,92.4,42.4,45.6,0,17.6,67.9,67.9,35.6,36.9,51.6,51.6,25,28.1,40.9,40.9,40.9,40.9,68.1,69.8,74,75.8,88.1,88.5,46.3,56.4,100,100,58.6,60.9,71,79.9,83.9,92.1,95.8,99.8,59.3,61.4,54.6,61.2,59.7,61.6,55.5,57.6,54.1,57.6,38.5,34.8,35.3,34.3,100,100,10.9,2.7,39.7,45.8,39.7,45.8,39.8,50.1,32.8,49.2,44.8,47.1,0,24.4,45.5,51.6,61.4,73.5,48.4,48.1,29.4,43.8,27.5,40.9,33.2,35.2,62.4,62.4
|
||||
484,MEX,Mexico,Latin America & Caribbean,129739759,25560,42.4,44.7,46.5,47.7,33.2,32.5,51.6,55.5,34.3,48.6,29.8,53.7,18,18,27.4,28.3,44.5,46.5,30.7,30.7,34.7,34.7,77.9,77.9,2.9,0,66.7,8.2,82.7,82,60.2,48.8,60.5,52,66.2,45.1,53.3,47.5,43.8,43.8,68.2,68.2,35,38.4,58,52.8,34.2,31.7,44,34.9,47.7,39,51.2,35.6,74.6,89.1,58.2,54.7,60.9,55.1,71,100,67.9,91.9,51.7,56.8,42.3,48.5,64.3,50.1,55,50.1,60.8,68.5,67.3,71.5,35,35,91.7,91.7,57,67.5,43.4,43.4,35,36.9,28.2,29.7,25.5,27.5,30.3,34.4,28.6,36.9,15.9,22.2,0,0,41.7,40.7,11.2,10.6,54.9,58.6,51.5,59.6,51.9,58,46.7,49.1,44.7,49.1,26.3,26.3,31.3,31.3,59.6,59.6,4.7,4.7,42.5,46.4,42.5,46.4,46.3,51.2,38.5,46.1,42,46.3,0,24.9,22.2,38.2,45.2,100,49.5,47.9,39.6,45.4,37.2,42.8,0.2,1.5,61,61
|
||||
583,FSM,Micronesia,Asia-Pacific,112630,4689,40.4,40.6,29.5,27.6,5.3,5,0,0,0,0,100,88.5,NA,NA,0,0,0,0,0,0,NA,NA,NA,NA,0,0,NA,NA,100,100,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,84.4,85.3,65.3,66,63.9,64.8,100,100,100,100,29.3,49.2,88.2,76.6,79.3,86.6,NA,NA,100,81.6,100,69.7,46.1,47,43.5,24,38.7,100,0,1.7,84.4,84.4,24.8,24.8,57.1,57.1,27.6,27.6,16.1,16.1,16.1,16.1,55.7,56.5,64.1,64.8,100,100,6.1,8.5,91,100,100,100,100,100,90.5,94,99,100,38.7,39.3,38.5,39.3,38.9,39.3,43.7,45.8,42,45.8,21.8,21.8,49.5,49.5,0,0,4.9,4.9,41.7,44.4,41.7,44.4,51,45.2,82.2,71.6,33.2,37.8,NA,NA,31,37.9,76.7,58.1,59.4,62,39.6,34.3,47.7,43.5,61,58.9,84.2,84.2
|
||||
498,MDA,Moldova,Former Soviet States,3067070,19910,42.8,45.6,44.1,48.4,41.1,53.3,NA,NA,NA,NA,NA,NA,16.2,16.2,16.1,68.4,35.3,35.3,52.9,52.9,NA,NA,NA,NA,90.2,91,57.6,58.8,0,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,68.7,54.2,43.1,44,46.6,48.7,51.3,60.3,80.9,51.3,47.6,49.9,46.6,55.9,100,66.1,66.4,66,17.4,35.8,23,23.3,2.4,0,36.1,36.1,16.6,18.1,16.6,16.6,37.2,40.6,30.1,34.5,27.5,35.3,14.9,23.4,35.9,57.9,39.8,37.3,30.9,32.1,60.6,65.2,64.5,64.7,61.1,62.2,57.3,59,62.8,64.3,46.9,51.2,42.3,51.2,17.2,16.2,24.8,21.7,31.9,31.8,2.3,2.9,45.6,45.4,45.6,45.4,50,43.2,63.6,51.9,71.4,71,0,23.3,43.4,29.6,33.7,61.5,51.3,55,48,42.2,49.4,42.4,35.5,32.8,72.7,72.7
|
||||
496,MNG,Mongolia,Asia-Pacific,3431932,20510,31.5,37,52.6,54.4,63.1,63.4,NA,NA,NA,NA,NA,NA,26.5,26.5,80.4,82.5,55.3,59.2,73.4,73.4,26.8,26.8,63.3,63.3,85.7,84.9,81.6,58.5,29.5,29.3,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,41.9,48.2,11.2,21.1,29,41.7,38.7,54.4,23.2,48.6,23.7,29,1.3,0.2,35.6,28.2,96.9,88.1,58.3,33.2,44.1,44.1,42.1,42.1,53.5,53.5,36.9,36.9,36.9,36.9,24.8,28.3,15.2,17.8,0,0,9.2,20.5,29,41,39,33.4,27.8,23.6,64,67.5,58.5,56.7,56.4,61.8,48.3,58.3,53.4,64.1,34.5,41.8,28.1,41.8,11.6,12.3,22.6,24.3,0,0,6.4,6.4,4.6,17.6,4.6,17.6,0,38.2,0,10.1,0,8.1,0,5,28.3,23.4,0,39.6,50,50.6,0,0,0,8.8,11.2,14,1.8,1.8
|
||||
499,MNE,Montenegro,Eastern Europe,633552,33620,48.3,47.6,48.2,50.2,42.2,42.1,14.5,14.5,0,0,100,75.1,65,65,43.9,47.1,27.2,42.5,50.4,50.4,84.1,84.1,86.9,86.9,49.4,48.2,72.2,53.2,40.6,40.5,65.7,67.9,NA,NA,NA,NA,79.4,79.2,40.9,40.9,65,65,30.4,47.9,NA,NA,57.2,46.4,34.4,47.4,37.3,49.7,41.2,44.6,78,87.3,24.4,24.7,23.2,22.7,0,100,0,100,44.6,43,16,17.3,11.1,12.7,75,64.1,62.4,62.4,44.1,44.1,43.8,43.8,61,61,30.6,30.6,30.6,30.6,44.9,48.5,31.1,35.3,23.3,32.4,23.2,28.4,61.7,57.7,48,43.2,38.9,43.6,60.4,64.3,43.5,42.3,94.3,97.5,93.2,100,87,95.8,55,56.1,55.5,56.1,12.7,12.7,25.6,25.6,4.1,4.1,4.1,4.1,51.3,43.1,51.3,43.1,43.1,44.6,35.2,37.5,50.9,39.4,100,20,69.8,51.5,8.6,83.7,51.9,52.7,43.7,41.8,42.1,38.8,40.7,39.3,58.3,58.3
|
||||
504,MAR,Morocco,Greater Middle East,37712505,11100,37.1,39.7,34.8,40.7,22.6,30.4,4.8,5.2,6.6,6.6,100,100,12.6,12.6,4.1,57.9,7,7.1,7.7,7.7,43.5,43.5,66.1,66.1,65.7,62.2,56.7,49.7,56.2,56.4,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,48.7,49.6,51.6,51,46.4,48.4,28.6,34.5,59.5,63.6,45.4,28.7,59.4,69.1,22.7,27.4,26.6,33.4,38.8,63.8,77.2,89.8,52.6,35.6,39.1,40.4,54.9,71.3,66,62.3,18.5,16.6,50,57.6,61.2,61.2,60,79,40.1,40.1,38,38,42.1,43.8,44.4,44.7,70.9,62.1,23.6,34.3,34.8,27.1,38.3,40.8,27.7,21.9,55.7,48.6,34.4,34.2,43.8,50.6,39,52.6,37.1,49.2,24.9,27.1,23.6,27.1,28.4,28.4,55.2,55.2,18.8,18.8,6.3,6.3,36.5,34.9,36.5,34.9,37,39.7,45.3,50.1,28.7,31.6,36.8,3.8,41.8,39.3,30,39.9,50.2,50.6,31.9,33.9,35,36.6,13.9,12.9,70.8,70.8
|
||||
508,MOZ,Mozambique,Sub-Saharan Africa,33635160,1730,33.6,38.6,48.4,47.8,57.3,57.3,34.2,34.2,16.6,16.6,63,54.7,68.4,68.4,56.6,69.6,86.7,89,81.8,81.8,81.7,81.7,96.8,96.8,38,29.2,80.1,67,63.8,61.5,44.1,41.5,57.2,58.3,NA,NA,40.9,32.5,0,0,69.2,69.2,59.1,66.9,59.3,96.5,31.2,50.3,45,68.3,47.1,69.8,68.3,17.1,49.1,41.3,83.5,79,97.1,91,37.8,4.1,85.3,61,36,40.1,34.2,32.1,100,100,95.2,94.2,23,20.6,9.6,9.6,96.1,96.1,0,0,0,0,0,0,24.6,25,27.9,26.9,35.9,35.2,2.5,4.3,56.9,41.7,56.7,58,79.1,81.2,59.4,62.5,17.3,17.1,16.4,20.5,12.2,19.3,13.5,21.3,13.5,16.7,11.6,16.7,31.5,31.5,78.1,78.1,0.5,0.5,0.5,0.5,18.4,35.7,18.4,35.7,19,36.8,90.7,100,7.1,34.3,70.4,22.5,43.4,46.9,100,28.9,48.2,48.7,10.8,22.9,32.8,42.6,20,20.4,90.4,90.4
|
||||
104,MMR,Myanmar,Asia-Pacific,54133798,5206,28.4,26.9,31.5,26.6,26.5,23.4,4.8,5.1,1.6,2.1,93,98.1,7.1,7.1,32.8,34.3,17.6,19.6,27.7,27.7,54.9,54.9,95.3,95.3,39.8,31.5,71.1,17,69.3,68.4,54.5,51.5,68.2,65.3,65.4,56.7,43.3,32,32.7,32.7,71.7,71.7,38.6,36,72.7,50.5,67.2,55.3,22.1,22.8,24.5,25.3,39.1,56.4,28.8,12.5,70.7,69.9,76.6,80,51,0,28.9,0,68.9,59.6,71.6,54.7,100,62.6,69.2,58,67.1,64.8,12,12,72.4,72.4,12,12,0,0,0,0,15.3,17,8.4,9.1,0,0,2.7,7.1,13.2,11.9,49.7,47.3,51.8,48.2,30.9,37.7,0.2,0,30.6,35.5,25.6,34.2,27.6,36.3,25.7,29.2,22.1,29.2,34.7,34.7,78.1,78.1,7.2,7.2,5,5,34.5,35.6,34.5,35.6,47.2,3.6,100,19.2,36.4,75.1,26.1,27.8,19.8,92.3,49.8,34.7,46.6,47.3,32.4,38.1,41.9,45.7,14.1,14.4,83.3,83.3
|
||||
516,NAM,Namibia,Sub-Saharan Africa,2963095,11730,43.8,43.8,58.6,62,70.4,69.8,7.5,7.5,7.7,7.7,96,73.4,100,100,84.4,84.6,100,100,99,99,46.2,46.2,80.1,80.1,91.2,91.1,80.1,77.2,70.9,72.4,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,36.7,34.2,11.1,18,59.1,58.6,28.2,20.5,34.3,35.8,52.2,42.1,59.4,84,68.6,65.8,69.2,67.5,48.3,74.9,46.5,100,22.6,25.5,12.9,10.1,72.3,69.9,99.1,97,1,7.5,29.3,29.3,59.6,59.6,32.4,32.4,20.7,20.7,20.7,20.7,25,26.6,26.4,27.4,32.1,33,10,16.2,20.8,20.7,46.5,45.6,68.2,67.8,60.2,59.9,9.2,11.1,16.8,19.8,13.2,19.2,14.2,20.2,31.1,34.3,28.9,34.3,30.5,30.5,72.1,72.1,2.7,2.7,2.7,2.7,36.8,30.3,36.8,30.3,34.4,41.1,46.5,58.5,11.7,22.2,36.9,3.7,0,23.7,4.5,50.1,0,0,20.8,26.6,23.9,31.1,26,27,48.7,48.7
|
||||
524,NPL,Nepal,Southern Asia,29964614,5348,32.2,32.9,47.4,47.4,55.6,55.6,NA,NA,NA,NA,NA,NA,13.8,13.8,48.4,48.8,55.9,56.5,80.3,80.3,53.6,53.6,76.9,76.9,50.6,50.3,97.7,95.9,85.3,84.7,81.1,80.6,93.9,93.4,55.7,67.8,88.3,91.7,57.3,57.3,72.3,72.3,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,15.7,15.8,21.7,9.5,31,17.1,22.3,32.6,28.3,0,65.3,65.6,76.3,70.7,100,71.7,85.6,67,46.2,59.3,11.4,11.4,81.5,81.5,8.1,8.1,0,0,0,0,13.1,14.4,6,6.2,0,0,4.4,7.1,0,0,55.7,42.7,27.3,23.8,0,0,8.8,7.6,28.2,33.8,22.2,33,23.8,34.4,20.9,21.4,21,21.4,42.7,42.7,98.4,98.4,14.6,14.6,1,1,24.4,25.8,24.4,25.8,5.6,5.2,32.3,31.4,35.1,42.6,NA,NA,18.3,27,37.3,28.6,48.7,49.1,29,27.6,35.8,32.9,20,17.5,82.1,82.1
|
||||
528,NLD,Netherlands,Global West,18092524,83823,63,67.2,64.7,67.8,54.4,61,40.2,77.7,52.9,53.2,32.7,32.6,52.8,52.8,40.2,40.5,53.5,90.1,76.8,76.8,28.3,28.3,61.4,61.4,73.8,69.6,55.6,52.9,38.6,39.5,71.2,62,NA,NA,NA,NA,69.5,64.1,84.8,84.8,5.7,5.7,25,22.5,8.3,0,26.2,29.8,7.4,11.8,34,31.9,66.3,47.9,94.3,92.6,57.7,50.5,70.1,60.9,100,100,100,100,68.4,68,46.4,45.2,16.9,17.8,57.6,55.9,99.5,100,91.4,91.3,19.4,18.1,100,100,99.4,99.5,97,97,70.3,74.2,62.7,67.4,37.4,51.1,92,96.5,49.7,44.1,12.9,20.4,52.8,64.3,56.2,65.3,66.8,70,87.1,88.2,84.8,87.7,87.1,88.5,93.9,99,89.2,99,69.5,69.6,26.2,26.4,100,100,97.5,97.7,54.4,60.7,54.4,60.7,54.8,68.3,39.8,59.1,66.1,100,83.5,17.9,100,61.9,100,100,36.6,40.5,55.5,58.3,43.2,47.9,15.6,18.6,68.7,68.7
|
||||
554,NZL,New Zealand,Global West,5172836,52983,56.6,57.7,51.3,51.3,37.7,39.6,15,27.2,12.6,24.5,83.6,61.2,28.5,28.5,49.4,50.2,86.2,86.8,16.8,16.8,97.1,97.1,99.5,99.5,0,0,80.1,59.4,79.1,81.7,60.3,67.4,NA,NA,81.1,87,53.6,52,45.1,45.1,70.9,70.9,34.3,31.4,54.6,34.4,40.2,38.8,19.4,25.6,33.4,26.7,72.4,54.7,78.7,69.1,72.3,60.2,92.5,85.2,77.5,65.6,100,71.2,75.6,72.9,63.7,52,53.1,50.9,58.8,62.3,100,100,72.7,72.7,20.2,20.2,77.1,77.1,84.1,84.1,61.8,61.8,80.6,81.5,83,83.1,97.8,96.2,80.8,85,74.5,65.2,31.2,40.6,42.8,45.1,90.6,94.6,43.8,53.5,82.4,84.8,80.4,85.6,80.5,84.2,76.5,80.8,73.2,80.8,40,39.5,16.4,15.1,100,100,33.6,33.6,44.6,47.6,44.6,47.6,53.5,53,39.9,39.2,51.1,64.6,29.1,31.8,58,54.1,57.8,68.4,52.6,51.7,44.5,48.5,30.9,35.2,18.8,19.6,47.3,47.3
|
||||
558,NIC,Nicaragua,Latin America & Caribbean,6823613,8950,46.2,47.4,58.6,58.5,65.9,66.1,97.1,97.1,40.6,40.6,50,100,85.3,85.3,72.9,72.9,69.3,69.5,92.9,92.9,66.1,66.1,96.3,96.3,48.2,40.9,0,0,64,61.6,33.8,16.7,43.2,22.8,31.8,5.7,24.7,25.2,0,0,36.1,36.1,51.7,48.9,73.4,67,35.1,43.3,28.3,41.2,43,50.1,60.5,47.6,72.3,82.4,74.3,74.5,71.6,73.7,58,68.1,93.4,100,44.8,51.6,30.3,36.8,56.8,48.3,50.9,58.8,52.1,63.6,41.3,41.3,31.5,31.5,53.7,53.7,33.3,33.3,33.3,33.3,37,39,35.7,36.7,47.1,47.7,13.6,17.6,62.2,58.3,42.1,48.2,37.1,41,69.8,73.5,13.9,12.1,42.4,47,36.4,44.7,40,48.5,41.7,47.6,38.1,47.6,21.6,21.6,49.2,49.2,7.4,7.4,1.2,1.2,34.8,37.6,34.8,37.6,47,45.9,95,92.9,24.2,30.6,36.8,3.7,23.6,30,36.7,41.1,45.4,47.5,31.3,33.3,38.3,39.5,26.6,25.5,72.4,72.4
|
||||
562,NER,Niger,Sub-Saharan Africa,26159867,1978,32.2,39.2,46.1,57,61,69.7,NA,NA,NA,NA,NA,NA,53.9,53.9,54.9,78.1,29.2,59.7,85.2,85.2,36.3,36.3,89.6,89.6,79.4,76.9,85.7,72.2,30.4,28.7,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,24.2,57.9,52.3,41.7,70,59.7,8.1,48.2,10.5,70.4,57.5,55.9,31.6,33.7,100,100,91,77.7,62.4,65.4,10,10,100,100,0,0,0,0,0,0,28.9,30.4,35.5,36.5,76.1,65.4,4.8,5.7,38.7,26.1,50.4,45.9,70.4,69.7,50.5,51.6,21.4,24.1,8.3,12.2,4.2,11.4,4.7,12.8,23.2,23.3,23.8,23.3,31.9,31.9,78.4,78.4,0.9,0.9,0.9,0.9,13.6,19.4,13.6,19.4,0,33.2,79.4,100,15.3,5.2,36.8,3.8,13.1,3.7,19.8,14.1,0,0,3.6,2.8,30.1,26.9,20.9,17.5,78.8,78.8
|
||||
566,NGA,Nigeria,Sub-Saharan Africa,227882945,6710,32.9,37.5,38.7,43.3,39.5,47.1,NA,NA,0.4,0.4,NA,NA,28.2,28.2,23.2,68.8,44.5,44.5,88.7,88.7,32.9,32.9,41.4,41.4,53.2,52.7,78.4,62,0,0,53.8,32.8,63.1,46.6,64,25.7,52.3,24.4,19.7,19.7,61.8,61.8,58.2,63.4,83.9,47.6,88.5,95.6,38.1,56.9,40.8,57.9,43.4,52.8,32.7,54.4,59.1,53.8,61.1,55.6,39,53.6,72.4,55.1,49.1,47.9,45.5,50,100,100,56.1,47.3,42.7,41.8,13.4,13.4,74.8,74.8,10.6,10.6,3.4,3.4,3.4,3.4,18.2,20,17,18,30.6,18.3,5.8,8.8,36.5,30,41.8,40,55.4,51.2,26.2,20.4,19.2,16.7,9.2,14.4,5.2,14,5.2,14.6,44.7,47,43,47,29.7,29.7,63.7,63.7,19,19,1.1,1.1,36.9,43.9,36.9,43.9,38.6,44.9,91.9,100,59.1,59.6,36,5.8,26.4,30,29.3,41.1,44.8,47.6,41.5,43.7,46.5,47.8,6.2,6.3,88.1,88.1
|
||||
807,MKD,North Macedonia,Eastern Europe,1831802,28720,49,50,54.1,55.1,47.3,52.8,NA,NA,NA,NA,NA,NA,42.3,42.3,34.9,53.2,28.6,44.4,26.3,26.3,76.1,76.1,94.5,94.5,77.3,75.2,80.4,67,30,30.6,66,64.6,NA,NA,NA,NA,65.9,71.1,43.3,43.3,74.3,74.3,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,87.5,74.7,41.9,43.7,47.2,49.7,77,100,77.4,60.6,42.1,46.7,36.8,37.7,44.9,50.6,53.5,56.7,38.2,51.3,41.9,41.9,62.5,62.5,46.9,46.9,33.7,33.7,33.7,33.7,33.6,39.1,24,29.9,12.4,21.5,19,28.7,34,56.1,35.7,36.8,15.1,21.1,54.7,61.2,40.1,38.6,65.4,70.4,63.1,71,63.3,70,37.4,43,34.3,43,31.6,31.6,42.2,42.2,73,73,0.2,0.2,54.2,51.3,54.2,51.3,53.3,47.5,51.9,42.7,48.4,78.8,22.9,24.4,68.3,79.2,50.5,100,51.2,51.1,48.1,45,47.9,43.5,34.4,32.5,65.5,65.5
|
||||
578,NOR,Norway,Global West,5519167,106540,66.7,70,67.2,72.6,63.9,71.6,93.6,93.9,9.9,11.3,62,62,98,98,19.4,67.4,55.6,58.5,73.4,73.4,99.5,99.5,99.9,99.9,84.2,83.8,83,74,100,100,71,61.4,NA,NA,78.6,72.9,69.3,53.3,43.2,43.2,69.7,69.7,50,54.2,31.6,40.2,73.3,91.9,65.9,50.5,64.4,39.6,48.3,65.7,79.2,90.9,35.1,48.4,48.3,49.2,65.4,98.6,100,100,52.7,52.3,19,18.9,44.7,43.7,32.2,26.8,73.9,97,81.9,83.3,10.1,10.1,99.2,100,84.1,86.7,76.1,76.1,84.5,86.3,81.1,82.9,78.7,85.1,97.1,100,47.5,58.1,22.6,28.9,41.8,54.5,62.9,67.3,59,59.4,96.6,97.6,94.7,97.4,97,97.8,93.9,100,86.8,100,61.3,58.3,14.9,13.2,95.1,90.4,90.9,87.3,51.1,52.6,51.1,52.6,49.3,58.8,30.9,44.4,72.7,51,64.4,52.1,86.2,47.8,94.5,100,49.8,49.7,51.5,53.2,37.6,40.3,20.8,21.7,54.6,54.6
|
||||
512,OMN,Oman,Greater Middle East,5049269,41652,39.3,51.9,48.6,65.6,38.7,56.7,37.8,73.7,26.2,65.8,97,100,42.1,42.1,12.7,19.1,9.3,72.9,53.5,53.5,71.3,71.3,98.6,98.6,68.2,61.6,95.6,61.1,75.8,74.6,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,93.9,88.8,100,68.8,79.8,83.6,69.1,100,70.4,100,26.5,35.3,32.2,73.6,26.1,13.7,0,0,1.1,73.9,100,100,67.1,70.7,31.2,46.4,49.8,49.3,63.1,62.8,100,100,88.6,88.4,60.7,58.6,99,99,99,99,33.1,33.1,49.7,50.1,47.7,47.5,38.4,34.4,59.3,68.3,34.6,37.2,27,29.5,29.6,24.7,60.3,51.7,36.3,33.6,67.4,69.5,73.8,78.4,61.5,63.5,30,36.7,25.8,36.7,33.8,22.7,36,19.8,32.3,24.7,32.3,24.7,16.3,32.6,16.3,32.6,15.5,47.9,0,20.1,46.7,27.6,31.9,9.4,3.1,25.2,52.3,100,100,0,11.4,32.4,0,18.9,11.7,14.2,21.9,21.9
|
||||
586,PAK,Pakistan,Southern Asia,247504495,6920,29.5,25.5,33.1,29.4,27.6,25.7,0,0,0.7,0.7,50,50,6.6,6.6,28.1,28.3,35.5,35.5,62.8,62.8,34.1,34.1,18.7,18.7,54,41.6,43.6,32.7,38.5,39,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,56.7,62.2,62,67,88.4,91.1,42.9,52.1,44.7,53.4,58.1,45.3,51.6,32.2,20.3,13.2,26.1,21.1,53.5,47.2,51.6,23.1,46.4,46.8,34.1,33.9,46,35.3,34.8,28.9,66.4,68.2,21.1,21.1,55.9,55.9,29,29,7.9,7.9,7.9,7.9,11.2,13,5.7,6.4,0,0,5,8,1.5,0,38.2,43.9,11.8,8.7,2.6,0,17.7,17.2,22.3,28.2,18.1,28.2,18.4,28.2,20.5,22.4,19.2,22.4,29.3,29.3,64.2,64.2,10.8,10.8,3.6,3.6,39.2,30,39.2,30,43.6,35.7,86.2,71.1,23.7,25.1,35,9.9,24,9.2,33.1,29.9,44.9,37.5,32.7,28.6,38.5,33,4,1,76.2,76.2
|
||||
591,PAN,Panama,Latin America & Caribbean,4458759,41292,47.6,52.9,56.4,59.1,59.1,57,76.8,76.8,23.4,23.5,52.4,88.1,68.9,68.9,70.2,71.8,93.1,93.4,84,84,72.2,72.2,97.9,97.9,11.8,8.4,51.2,0,64.9,63.5,67.4,60,77.7,72.3,71.8,66,53.8,48.3,32.5,32.5,63.3,63.3,67.1,71.6,15.9,57,42.8,50,52.7,77.1,67,82.2,81.4,100,52.1,80.9,65.5,65.6,68.2,67.5,33.1,67.5,51.7,100,40.5,50,26.4,31,49.8,41.2,49.7,53.9,53.8,68,42.5,42.9,28.6,28.5,38.3,38.3,53.4,54.4,29.6,29.6,51.2,54.9,53.3,57.5,70.2,70.6,33.5,46.2,70,60.3,33.7,43.6,61.6,65.5,66.5,69.3,31.3,32.5,46,49.1,42.1,48.4,45.2,49.5,58.4,61.6,56.3,61.6,25.7,27.5,38.4,42.3,46,47.5,2.8,2.8,31.3,41.9,31.3,41.9,25.9,45,15.5,47.2,30.3,48.1,36.7,3.7,30,40.9,2,61,48.2,48.8,27.2,43.4,24.3,40.4,24.9,27,65.6,65.6
|
||||
598,PNG,Papua New Guinea,Asia-Pacific,10389635,3542,40.1,36.5,38,35.5,23.1,19.8,0,0,3.5,3.5,100,100,0,0,7.2,8.4,10.3,11.8,3.9,3.9,79.5,79.5,98.6,98.6,51.6,41.2,91.2,50,100,100,67.8,65.3,83,73.3,71.3,59.1,75.6,64.7,49.6,49.6,88.6,88.6,85.7,88.6,84.7,66.6,67.9,75.6,99.1,98.9,97.2,98.2,5.1,87.2,74.3,68.2,100,100,100,100,100,54,90.3,69.6,58.2,61.8,48.2,57.3,100,100,67.9,75.2,63.7,57.5,9,9,86.1,86.1,0.9,0.9,0,0,0,0,37,37,40.8,40,60.4,58.1,1.6,2.9,86.2,95.4,83.1,78.4,45.5,44.7,80.6,77.6,0,0,19.3,21.2,16.8,20.2,18.3,21.9,49.6,51.7,48,51.7,36.8,36.8,71.6,71.6,38.4,38.4,1.2,1.2,46.2,37.7,46.2,37.7,48.6,36.4,99.4,76,100,29,NA,NA,63.3,47.9,34.7,44.9,49.1,49.3,53,33,57.1,37,37.7,27.9,88.7,88.7
|
||||
600,PRY,Paraguay,Latin America & Caribbean,6844146,17360,38.2,39,44.4,43.6,47.9,47.8,NA,NA,NA,NA,NA,NA,43.3,43.3,36.9,36.9,46.8,47.3,61.7,61.7,38.2,38.2,82.6,82.6,84.3,84.2,0,0,46.3,43.1,12.9,20.6,23.7,33.9,0.2,9.2,1.4,18,0,0,63.9,63.9,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,69,62.3,100,100,100,100,36.7,23.2,91.4,86.3,80.6,71.6,80.9,86.7,52.9,100,85.9,79.7,46.1,50.7,11.5,11.5,46.2,46.2,11.2,11.2,4.8,4.8,4.8,4.8,37.4,39.3,32.3,33.6,46.4,39.6,16.8,24.2,58.8,43.2,20.8,20.8,83.7,83.8,60.2,57.2,0,0,53.2,56.7,47.7,55.1,51.2,57.7,48.9,52.6,47.6,52.6,23.4,23.4,43.5,43.5,26.8,26.8,1.5,1.5,29.4,31.9,29.4,31.9,34.5,25.7,51.6,35.5,13.9,46.1,36.8,4,14.2,38.6,51.8,31.4,46.7,47.3,23.7,34.8,25.5,35.4,19.3,20.2,50.6,50.6
|
||||
604,PER,Peru,Latin America & Caribbean,33845617,18390,42.4,46.6,53.2,56.4,50.2,48.9,92.1,92.1,13.5,16.6,23.2,53.4,48.4,48.4,42.3,46.2,62.5,71.8,65.6,65.6,83.4,83.4,98.4,98.4,15.3,15.2,72.2,10.5,77,75.6,65.2,60.1,73.4,69.1,66,53.9,62.6,57,45.1,45.1,88.6,88.6,75.8,85,52.4,80.8,46.4,62.3,95.2,94.9,95.3,94.8,81.1,69.5,53.7,74.7,100,100,100,99.1,32.9,65.8,77.9,73.7,42.6,45.3,34.8,34.2,52.9,46.8,36,37.4,51.2,59.5,53.6,64,51.9,48.9,53.5,66.9,53.5,66.9,56.3,56.3,35.5,35.6,28,26.6,16,10.5,22.3,33.2,89.1,66.2,6.2,6.2,61.4,56.4,66.6,57.2,11.3,10.9,50.9,55.1,45.2,52.9,49.7,56.6,66.2,68.3,66.3,68.3,25.2,25.9,51,48.6,22.4,28.5,0.7,1.8,31.5,40.7,31.5,40.7,27.5,40.2,29.4,51.7,29.1,48.3,36.7,3.8,33.2,36.6,29.3,81.5,49.2,49.5,29.3,40.2,29.8,40.3,13.4,14,72,72
|
||||
608,PHL,Philippines,Asia-Pacific,114891199,12910,31.7,32,33.9,33.7,22.8,25.6,16.4,19.4,7.2,12.5,67,53.1,28.5,28.5,10.6,26.3,39.4,51.4,37.1,37.1,56,56,78.7,78.7,3,0,58.8,0,77.2,76.3,62.8,50.6,74.7,67.4,66.3,36.3,50.1,49.2,42.8,42.8,59.1,59.1,74.5,76.4,86.6,72.7,85.4,86.2,74.6,76.7,76,77.2,56.2,41.8,43.1,39.7,60.2,61.5,71.6,72.2,53.8,32.8,73.2,35.7,72.1,72.3,79.4,73.7,100,86.1,49.5,49.8,71.4,79.2,10.6,10.6,80.9,80.9,2.8,2.8,2.8,2.8,2.8,2.8,26.9,28.5,21.7,22.8,20.4,17.4,9.4,13.1,54.7,79,22.8,24.2,11.7,11.3,56,61.4,18.9,19,38.5,42.7,35.8,45.5,34.1,40.8,40.3,41.6,39.7,41.6,30.8,30,56.5,55.9,13.7,12.8,13.7,12.8,32.4,32.2,32.4,32.2,37.1,31.4,57.3,46.8,32.9,39,35.7,8.3,50,30.5,27.6,45.2,46.1,48.5,35.4,31.3,37.8,32.8,9,5.9,75.2,75.2
|
||||
616,POL,Poland,Eastern Europe,38762844,54500,62.7,64.4,78.8,79.3,81.3,81.3,82.1,82.2,79.5,79.5,69.9,58.5,66.6,66.6,98.4,99,100,100,90.9,90.9,0,0,0,0,89.5,92.3,87.1,83.6,0,0,56.2,48.4,NA,NA,NA,NA,56,45.3,69.2,69.2,22.4,22.4,58.4,57.8,85.6,50.2,68,78.5,73.8,84.2,32.7,33.6,64.4,34.8,92.8,93.5,55.8,55.8,67.1,65.7,86.9,100,100,100,59.7,68.3,52.5,60.8,39.4,43.1,71.1,72,59.8,76.3,77.2,79.2,37.9,36.3,94.2,96.9,72.6,75.2,67.4,67.4,45.6,49.9,31.6,38.5,13.8,28.8,36.5,46.7,46.4,49.6,16.2,10.8,25.8,34.9,52.8,60,61.6,63.2,84.5,80.7,91.5,83.9,89.5,78.6,60.6,65.3,56.6,65.3,57.9,58.8,41.8,36.9,100,100,53,60,52.3,53.5,52.3,53.5,50.2,49.3,30.1,28.8,93.6,85.3,14.8,100,48,49.6,47.4,64.8,53.8,53.4,45.8,48.7,39.6,39.9,7.5,7.7,53.2,53.2
|
||||
620,PRT,Portugal,Global West,10430738,51260,58.2,62.2,61.4,63.4,59.7,60.4,70,70.1,28.6,30.5,25,26.4,46.3,46.3,61.9,65.2,75.3,76.6,80,80,38.1,38.1,47.9,47.9,68.1,66.7,71.6,64,63.1,63.6,18.7,16.5,NA,NA,NA,NA,17.7,11.4,33.1,33.1,8.6,8.6,36.5,31.1,24.3,5.5,25,21.7,62.8,42.5,49.1,36.7,54.8,49,75.9,88.7,22.8,30.3,24.6,34.4,100,100,100,100,46.1,49.7,13.4,15.1,35.8,35.6,72.4,72.1,53.8,76.1,87.3,87.3,40.5,40.5,97.1,97.1,91.8,91.8,76.8,76.8,64.7,68.2,57.4,61.1,55.7,55,69.3,77,42.2,52.8,13.3,22.8,37.1,44.2,57.9,65.3,47,48,92.3,94.4,87.7,92.5,92.9,95.6,65.2,71.6,59.7,71.6,50.7,50.8,28.9,26.5,95,100,50.4,50.4,48,55.3,48,55.3,61.5,62.3,62.2,63.5,62.2,41.6,0,31,57.9,59.3,93,100,51.8,51.7,61,56.6,56.3,51.9,31.7,24.7,75.2,75.2
|
||||
634,QAT,Qatar,Greater Middle East,2979082,118760,41.5,47.2,54.1,57.4,50.5,50.2,42.9,42.9,36.2,36.2,92.3,84.9,55.3,55.3,13,25.2,44.9,44.9,94.5,94.5,64.1,64.1,98.6,98.6,50.4,39.4,86.3,66.1,54.7,54.6,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,88.3,88.6,NA,NA,61.7,62,100,100,100,100,0,57.4,41.7,65.3,0,0,0,0,0,56.7,90.6,100,35.5,35.7,6.1,6.7,43.9,30.8,43,39.9,63.3,63.3,86.7,86.7,20.3,20.3,100,100,89.3,89.3,89.3,89.3,49.1,50.7,41.3,42.4,0,0,88.7,96.8,26.4,31.7,5.3,6.6,21.7,19.7,46.1,37,22.1,18.8,73.7,75.1,76,80.6,70.4,71.5,57.4,64.8,46.6,64.8,42,42,30.8,31.3,100,100,24.3,23.6,15.1,28,15.1,28,21,40.7,0,5.8,0,47.2,31.2,7.2,0,14.9,100,91.2,NA,NA,0,30.5,0,0,6.3,10.2,4.1,4.1
|
||||
178,COG,Republic of Congo,Sub-Saharan Africa,6182885,6404,40.2,41.2,55.4,63.8,71.5,71.4,NA,NA,22.7,22.7,100,100,69.8,69.8,80.6,81.4,77,85,75,75,61.8,61.8,87.7,87.7,89.3,89.2,93.3,72.8,62.8,58.8,71.9,67.9,85.3,79.5,74.5,64.4,75.4,64,43.1,43.1,88.9,88.9,51.3,61,NA,NA,71.3,59.7,NA,NA,75.2,63.4,54.2,49,16,76.6,100,100,88.8,97.2,0,68.8,0,75.7,47.5,48.1,36.7,37.6,100,100,56.7,66.1,46,46.8,21.3,21.3,88.4,88.4,21.3,21.3,7.9,7.9,7.9,7.9,16.2,17.5,12.3,12.2,1.3,2.5,6.6,10.3,36.4,22.9,36.8,48.1,49.9,50.5,33.7,32.7,0,0,18.6,24.4,14.6,22.9,16.4,25.4,32.7,35.4,30.6,35.4,37.8,37.8,79.1,79.1,10.3,10.3,10.3,10.3,38.8,29.3,38.8,29.3,34,35,53,55,40.1,25.3,36.7,3.8,27.2,55.4,0,48.9,49.5,49.6,25.3,12.5,37.4,33.2,25.2,23,57.6,57.6
|
||||
642,ROU,Romania,Eastern Europe,19118479,49940,60.2,57.2,67.7,68.4,71.3,71.9,98.8,98.8,90,90,31.2,53.7,43.8,43.8,77.9,78.8,63.5,68.9,81.1,81.1,56.4,56.4,71.1,71.1,63.4,63,69.6,62.3,8.4,8.5,60.2,57.1,NA,NA,52.2,44.1,71.6,72.1,57.3,57.3,59.6,59.6,25.6,24.5,NA,NA,32.3,88.1,40,0,100,1.9,60.2,50,93.3,86.8,53.3,51.3,62.5,60,100,86,100,100,58.2,67.8,43.8,68.5,55.2,51.3,82.4,84.4,32,61.6,44.7,52.5,24.1,25.1,47.8,58.3,46.4,55.2,45.7,45.7,43.1,46.4,34.7,39.4,26.7,29.6,31.9,42.8,44.2,66.6,23.6,24.4,33,38.5,54.1,60,49.1,50.1,69.1,68.5,67.5,65.9,73,70.2,48.6,53.4,44.1,53.4,43.1,42.3,46.6,42.3,87.1,92.7,17.7,17.1,63.1,49.3,63.1,49.3,62.9,54,65.4,51.4,62.6,63,73.7,23.6,54.3,36.1,44.9,58.3,51.1,51.5,59.7,51.1,56.5,46.4,26.2,17.1,67.4,67.4
|
||||
643,RUS,Russia,Former Soviet States,145440500,48960,46.5,46.5,48.2,48.2,41.8,41,10.6,11.4,4,4.4,90.6,85.6,27.2,27.2,45.7,47.2,31.9,34,31,31,79,79,91.8,91.8,82.9,82.4,88,67.3,68,67.1,46.4,43.9,NA,NA,27,18.2,71.7,63.1,49.9,49.9,90.2,90.2,59.9,63,31.5,51.3,28.7,24.5,77,74.4,85.7,84.6,64.6,43.7,67.3,65.2,32.4,46.9,57.1,65.2,70.4,65.1,63.1,69,50.9,62.9,33.6,43.9,73.9,82.5,68.1,53,42.1,84.4,53,53,33.9,33.9,55.1,55.1,55.1,55.1,55.1,55.1,50.7,54.7,46.3,50.5,41.2,48.4,44.4,55,42.2,59.5,22.6,23.7,29.5,31.5,58.2,59.1,57.2,56.3,71.1,73.8,63,68.3,72,77.5,55.3,61.8,48.4,61.8,15.5,15.5,32.8,32.8,4,4,4,4,40.5,36.9,40.5,36.9,47,48.8,21.7,24.2,37.1,32.9,66.6,30.6,38.3,36.2,39.5,40,50,49.9,37.2,38.1,29.7,29.6,0,0,35.7,35.7
|
||||
646,RWA,Rwanda,Sub-Saharan Africa,13954471,3747,33.7,33.4,45.7,44.5,51.8,49.9,NA,NA,NA,NA,NA,NA,34.4,34.4,44.5,44.7,29.4,29.8,57,57,100,100,99.3,99.3,63.1,63.1,97.1,67.3,0,0,67,58.3,94.4,84.4,NA,NA,56.1,39.6,35.7,35.7,39.8,39.8,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,47.3,51.2,69.8,66.7,80.1,77.2,34,46.2,47.4,47.9,42.1,41.6,50.4,48.8,100,61.7,68.9,65.9,39.7,22.6,8.6,8.6,79.6,79.6,1.6,1.6,0,0,0,0,13.4,14.2,8.8,8.5,0,0,5.3,7,42.4,21.5,46.6,53.6,0,0,11.8,13.1,11.7,14.5,20.5,24.6,15.8,23.2,17.3,25.5,34,36.2,31.7,36.2,15,15,36.5,36.5,0,0,1,1,32.1,32.3,32.1,32.3,32.2,18,100,100,21.8,26.3,31.5,29.2,7,31,32.9,32.2,43.6,47.4,28.8,32.1,40.8,41.1,31.9,30.2,98.3,98.3
|
||||
662,LCA,Saint Lucia,Latin America & Caribbean,179285,27052,48.8,51,45.4,45.1,30.4,30.3,12,12,13.2,13.2,50,70.2,NA,NA,21.1,21.1,52,52,44.5,44.5,0,0,82.2,82.2,31.8,27.4,NA,NA,92.7,91.2,78.5,80.7,87,92.4,NA,NA,76.3,85.5,43.2,43.2,62,62,92.7,94,NA,NA,100,80.5,100,100,100,100,56.1,76.4,71,68.6,46.5,41.5,51.9,45.9,47.9,75,95,72.1,41,39.3,41.5,27.8,44.7,39.3,22.7,21.7,58.2,58.2,38.4,38.4,43.5,43.5,41.9,41.9,34.6,34.6,34.6,34.6,63.5,64.9,72.1,73.7,100,100,35.4,42.3,88.1,100,54.3,53.1,71.3,77.4,82.5,85.4,82.1,87.5,52.9,53.8,51.7,54.8,52.1,53.2,43.1,44.3,41.4,44.3,11.7,12.5,29.1,31,0.1,0.1,0.1,0.1,41.3,47.5,41.3,47.5,39.1,50.4,38,56.8,55.5,51.4,43.3,24.3,34.6,49.1,43.7,49.9,51.3,51.2,36.7,46.2,36.3,45.6,50.2,52.5,73.8,73.8
|
||||
670,VCT,Saint Vincent and the Grenadines,Latin America & Caribbean,101323,19425,53.4,54.1,49.8,50.6,31.7,35.6,9.6,9.6,10.7,10.7,65.9,100,NA,NA,9,26.4,58.1,58.1,61.6,61.6,100,100,99.6,99.6,19.3,16.2,NA,NA,96.4,95.2,81.1,75.5,90.3,81.9,NA,NA,77.3,83.9,38.3,38.3,69.9,69.9,90.6,86.1,NA,NA,42.8,43.4,100,100,100,100,45.3,90.2,76.7,72.8,46.6,41.6,NA,NA,56.7,78.5,84.7,73.3,75.8,76.9,76.4,79.7,61.8,56.5,77.8,77.8,75.5,75.5,41.5,41.5,47.2,47.2,46.7,46.7,36.1,36.1,36.1,36.1,63,64.5,72.6,74.1,100,100,34.7,40.9,100,100,66.3,67.6,69.4,74.6,82.7,85.2,88.1,91.3,50.1,51.7,48.2,51.9,49.3,51.6,26.4,28.3,25.8,28.3,37.1,37.1,42.7,42.7,100,100,0.1,0.1,49.9,49.9,49.9,49.9,49.1,49,58.9,58.7,41.6,47.4,NA,NA,36.5,56.5,60,53.3,50.2,50.2,46.8,47.9,47,47.5,58.4,58.3,79.5,79.5
|
||||
882,WSM,Samoa,Asia-Pacific,216663,6998,40.9,46.8,35.9,37.2,26.2,25.9,7,7,5.2,5.2,89.3,100,NA,NA,8.2,8.2,25.8,25.9,14.5,14.5,28.3,28.3,89.8,89.8,26.3,22.1,100,100,44.8,46,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,85.3,75.9,33.3,29.2,82.4,42.5,100,100,100,100,54.4,60.1,65.4,75.2,87.4,82.4,NA,NA,94.3,79.3,64.4,69.7,51.2,57.1,23.5,40.9,80.5,54.2,77.8,77.8,65,65,17.6,17.6,50.1,50.1,0,0,25.2,25.2,25.2,25.2,57.2,57.7,57.5,57.9,100,100,6.4,7.8,34.1,39.2,88.3,76.8,92.5,97.1,100,100,100,100,56.6,57.3,61.9,64.4,52.2,52.5,57,58.2,56.5,58.2,56,55.7,86.1,83.4,98.8,98.9,4.6,6.5,33.9,51.3,33.9,51.3,43.4,39.4,74.2,66.7,34.9,92.6,12.9,28.5,19.9,79.2,41.9,62.2,NA,NA,35.3,43.5,39.9,48.6,52.9,55.1,85.7,85.7
|
||||
678,STP,Sao Tome and Principe,Sub-Saharan Africa,NA,6205,34.2,35.9,36.2,31.6,33.6,33.6,10.1,10.1,0,0,100,100,NA,NA,0,0,100,100,59.3,59.3,4.4,4.4,82.1,82.1,33.4,33.4,NA,NA,100,100,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,83.5,72.6,15.9,0,99.7,100,86,65.2,90.7,100,50.8,26.9,41.6,20.4,54.4,51.4,NA,NA,4.4,17.7,68.3,17,39.9,31.7,41.4,20.1,98,57.4,28.7,44.8,35.6,35.6,19.8,19.8,81.7,81.7,20.6,20.6,6.7,6.7,6.7,6.7,35.4,39.5,37,40.9,52.7,56.3,6.5,10.7,34.6,20.6,100,100,100,100,74.4,70.2,84.9,88.1,31.4,37.5,24.2,36.1,26.2,38.5,36,38.1,34.8,38.1,27.8,27.8,68.4,68.4,0,0,1,1,30.4,38.6,30.4,38.6,31.8,44,79.2,100,30.3,27.6,23.6,0,12.5,26,45.1,46.4,48.7,49.9,29.2,35.9,32.8,38.6,57.6,57,92.7,92.7
|
||||
682,SAU,Saudi Arabia,Greater Middle East,32264292,65880,33.2,42.6,39.2,50.3,37.7,45.4,50.4,50.4,5.8,5.8,87.9,100,34.1,34.1,13.3,54.9,7.2,29.7,15.6,15.6,72.9,72.9,95.4,95.4,72.6,65.2,98,89.2,47.7,47.3,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,53.4,56,56.4,54.6,52.2,53.6,33,61.1,49.9,55.2,49.7,50.4,17.8,60.5,0,0,2.4,0,4.6,65.4,31.1,79.9,54.2,53.8,10.9,8.9,40.6,41.3,61.2,53.1,100,100,57.4,57.7,30.8,26.8,60.1,61,60.1,61,62.1,62.1,38,40,33.1,34.7,5.4,2.7,59.6,70.2,23.2,23,24.4,31.1,5.3,4.6,58.6,54.4,41.7,40.8,61.7,64,62.4,69.2,57.2,60.6,21.4,26.3,17.2,26.3,37.4,37.4,28.4,28.4,100,100,15,15,20,33.2,20,33.2,33.9,46.5,0.6,17,22.1,35.6,35.9,6.7,23,32.3,0,95.9,100,0,24,36.3,7.9,18.8,0,0,21,21
|
||||
686,SEN,Senegal,Sub-Saharan Africa,18077573,5056,38.6,43.3,46.6,50.9,51.5,56.5,8.6,8.9,14.3,18.4,45.4,44.9,54.3,54.3,48.5,78.2,83.6,86.8,63.8,63.8,16.8,16.8,61.5,61.5,80,78.2,93.9,89.2,7.8,7.1,67.4,63.5,97.4,97,NA,NA,48.8,28.6,46.2,46.2,71.2,71.2,56,58.4,25.2,11.3,56.8,57.5,65.7,55.8,69.3,79.8,71.1,66.2,35.8,39.7,60.9,60.1,59.6,60.7,24.3,44.9,55.5,26.2,53.5,71.1,29.5,43.9,100,86.6,87.6,86.5,65.8,90.6,12.8,12.8,67.9,67.9,4.4,4.4,8.6,8.6,8.6,8.6,40.5,42.9,47.7,49.5,100,100,4.8,6.8,48.9,33.6,50.6,46.5,15.1,14.5,57.4,55.5,29.4,30.2,21.6,27.2,15.6,25.5,17.7,28.3,33.7,35.5,32.6,35.5,24.5,24.5,59.9,59.9,0.6,0.6,1,1,24.9,32,24.9,32,26.9,33.9,63.1,76.8,27.1,33.6,36.7,3.9,34.3,24.3,0,51,0,19.6,24.1,27.8,33.6,34.7,23.3,21.6,82.1,82.1
|
||||
688,SRB,Serbia,Eastern Europe,6773201,30910,54.8,49.3,54.7,56.1,50.5,53.5,NA,NA,NA,NA,NA,NA,34.7,34.7,46.6,55.9,21.5,29.7,48.5,48.5,53.2,53.2,85.4,85.4,75.2,73.8,90.4,84.5,13.4,13.7,72.3,69.3,NA,NA,NA,NA,85.1,78,55.9,55.9,52.8,52.8,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,90,86.3,48.2,46.8,61.3,56.1,89,100,71.9,86.6,66.7,71.4,59.7,78.1,50.6,47.7,58.3,46.3,77.1,77.1,13.9,15.4,34.9,34.9,12.1,15.9,10.1,10.1,14.8,14.8,39.1,43.4,26.6,31.6,16.9,24.2,23.2,30.6,35.5,55.4,32.8,36.4,14.5,24.3,54,60.1,40.7,39.9,79.6,82.6,78.3,83.9,77.7,81.8,50.6,54.1,47,54.1,26.4,26.4,39.4,39.4,52.3,52.3,0.5,0.5,68.1,43.6,68.1,43.6,71.8,47.6,66.1,30.8,50.6,44.9,100,25.7,45.2,95.8,53.5,40.7,53.1,52.7,56.9,42.9,56.4,39.4,41.8,20.5,53.5,53.5
|
||||
690,SYC,Seychelles,Sub-Saharan Africa,127951,41078,52.3,48.2,46.3,48.3,33.1,51.8,47.9,94.7,4.7,50.2,100,50.5,NA,NA,12.1,18.7,73.4,73.4,89.2,89.2,28.3,28.3,95.8,95.8,6.6,0,NA,NA,66.1,64.7,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,75.2,75.8,10.8,16.1,58.7,56.6,100,98,100,100,47.9,51.5,74.6,17.5,71.8,62.1,NA,NA,68.8,5.7,100,20.3,54.9,58,31.4,52.3,39.3,38,77.8,77.8,57.1,57.1,51.5,51.5,34.6,34.6,58,58,49.7,49.7,49.7,49.7,71.9,71.4,82.5,80.2,91.8,92.6,58.4,66.6,91.1,59,95,97.7,94,97.3,87.3,89.1,99.8,100,51.4,53.9,51.8,58,48.2,51.1,53.9,59.6,52.4,59.6,29.6,32,24.2,30.1,95,95,2.3,2.3,43.5,27.3,43.5,27.3,44.4,30.9,25.9,6.3,36.3,33.3,NA,NA,100,29.4,82.4,11,50,50,42.4,25.6,38.9,19.8,53.2,47.2,30.8,30.8
|
||||
694,SLE,Sierra Leone,Sub-Saharan Africa,8460512,3505,34.4,39.7,41.6,38.9,47,46,5.5,5.5,39.1,39.1,75,100,24.6,24.6,59.5,67.8,42.8,42.8,63.3,63.3,85.1,85.1,96.9,96.9,79.3,79.1,76.9,0,58.4,56.7,24.1,17.4,61,34.5,NA,NA,28.2,0,4.9,4.9,27.4,27.4,77.1,75.3,64.1,79.4,52.7,96.4,66.3,38.4,52.6,98.7,17.6,0,41.2,33,56.3,59.6,52.8,48.4,23.5,30.6,64.2,27,45.9,40.1,34.2,29.1,100,100,71.8,52.8,40.7,40.7,10,10,100,100,0,0,0,0,0,0,29.5,33.1,34.4,38.2,73.5,70.3,2.3,4.5,45.2,34.3,51.8,51.8,63.6,67.8,35.1,40.4,11.9,10,13.5,17.7,9,16.9,9.8,18.3,25.9,28.2,23.9,28.2,32.8,32.8,81.1,81.1,0,0,1,1,26.9,46.8,26.9,46.8,20.1,50.3,100,100,22.8,36.4,NA,NA,12.6,49.1,49.5,64,44.9,48.1,24.6,36.2,33.5,46.8,31.8,33.4,96.8,96.8
|
||||
702,SGP,Singapore,Asia-Pacific,5789090,153737,47.5,53.8,59.2,55.9,38.3,36.6,NA,NA,0,0,NA,NA,NA,NA,63.2,63.2,16.5,16.5,14.9,14.9,100,100,91.7,91.7,57.7,48.1,NA,NA,64,65.3,61,28.8,92,37.3,NA,NA,41.9,18.7,40.7,40.7,4.1,4.1,97.9,97.1,NA,NA,NA,NA,100,100,100,100,73.5,62.6,78.6,81.8,30,27.1,28.9,26.9,64.8,85.5,100,100,60.2,61.3,33.6,34.1,0,0,38.6,46,100,100,92.4,92.4,23.7,23.7,100,100,100,100,100,100,56.8,65.8,42.3,53.6,11.3,32.7,77.9,84.7,70.6,59.9,5.3,10,0,6.5,35.7,61.2,25,30.5,97.2,99.9,94.6,100,94.5,99.8,70.3,78.6,63.3,78.6,74.6,75.5,39.3,42,100,100,97.2,96.7,25.5,41.2,25.5,41.2,43.7,51.9,19.5,31,16.1,29.1,37.7,10.6,100,26.2,26.4,100,45.6,42.8,41.2,45.6,28.2,32,17.6,18.1,39.2,39.2
|
||||
703,SVK,Slovakia,Eastern Europe,5518055,47440,66.5,65,77.5,77.8,81.9,81.8,NA,NA,NA,NA,NA,NA,62.4,62.4,94,95.8,90.1,90.1,91.4,91.4,56.5,56.5,70.8,70.8,90.1,89.4,79.2,73.7,18.4,18.2,54.2,53.5,NA,NA,NA,NA,58.7,60.1,42.1,42.1,43.2,43.2,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,94.5,94.1,64.3,60.4,73.6,68.3,100,100,100,100,65.6,67.4,55.3,62.9,76.6,100,82.1,79.6,47.7,64.2,57.1,59.4,26.1,26.1,57.4,57.4,64.5,70.2,57.3,57.3,55,60.5,43.3,50.6,20.2,35.8,59.3,68.7,43.7,51,31.8,32.7,29.5,36.7,51.3,57.9,47.6,48,92.9,93,100,100,89.3,88.4,63,67.1,59,67.1,48.4,53.4,38.1,27.6,98.8,97.6,33.4,57,59.3,48.9,59.3,48.9,66,51.7,58.2,37.3,70.5,48.3,13.8,44.5,46.6,44.3,48.8,82.9,50.8,51,56.3,49.5,50.8,43,29,23.6,59.1,59.1
|
||||
705,SVN,Slovenia,Eastern Europe,2118396,58150,62.6,62.5,68.3,67.7,65.3,64.8,12,12,25.9,27.8,100,100,69.9,69.9,93.9,94,100,100,87.3,87.3,58.7,58.7,54.3,54.3,72.8,71.2,75.7,52.6,42.9,42.2,67.2,58.9,NA,NA,NA,NA,85.8,67.6,47.6,47.6,37.9,37.9,46.7,36.4,NA,NA,32.5,51.9,54.2,29,97.5,32.1,56.3,41.5,93,92.7,53.6,51.7,62.2,60.6,94.6,100,100,100,58.6,56.7,39.6,43.8,32,34.6,74,70.9,67.4,65.5,67.3,72.7,37.9,38,91.7,94,56.5,67.6,42.5,42.5,55.2,59,40.4,45.8,28,35.8,52.3,58.6,44.3,42.4,28.6,33,37.1,45.7,46.6,51.9,39.8,39.2,92.5,91.5,98.1,95.7,93.1,88.7,86.6,92.5,82.3,92.5,58.2,53.6,30,26.7,83.8,77,73.5,68.9,59.9,57.5,59.9,57.5,53.3,57.9,40.4,47.1,75.3,69.6,91.8,59.1,54,50.2,81.1,100,48.8,48.9,53.3,55.7,45.9,48.4,32.1,33.6,68.5,68.5
|
||||
90,SLB,Solomon Islands,Asia-Pacific,800005,2627,40.3,41.8,34,30.2,18.8,13.2,9.5,9.5,7.3,7.3,100,99.6,0,0,0.5,0.8,0.9,1.7,5,5,100,100,99.7,99.7,30,20.4,75.7,0,100,100,51.2,42,71.5,52,50.1,23.3,61.8,44.9,45.8,45.8,72.3,72.3,80.1,84.8,83,84.7,44.1,48.8,100,100,100,100,55,47.5,84.8,83,92.7,98.1,98.7,100,100,90,100,69.7,40.1,44.6,16.5,19.4,100,100,33.6,42.1,66.2,66.2,9.7,9.7,83,83,3.5,3.5,0,0,0,0,49.9,50.6,59.9,60.1,100,100,1.2,1.6,99.2,100,97.2,98.3,94.5,96.6,97.3,95.6,31.8,33.4,31.1,33.6,27.8,31.7,30.7,34.8,27.2,28.6,26.7,28.6,19.4,19.4,43.8,43.8,0,0,4.7,4.7,42,52.8,42,52.8,37.2,59.7,100,100,16.9,25.4,NA,NA,35.9,41.5,46.8,73.2,48.9,48.8,29.2,46.1,34.9,54.1,50,54.4,100,100
|
||||
710,ZAF,South Africa,Sub-Saharan Africa,63212384,16010,38.7,42.9,44.8,49.8,38.8,40.1,35,35.2,45.4,54.6,76.8,70.3,16.3,16.3,28.9,34.8,23,29,37.8,37.8,87.3,87.3,81.8,81.8,31.3,24.4,87.7,77.2,59.3,59.9,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,41.1,47.8,0,22.9,54,60.1,52.6,48.1,54.6,50.2,53,54.7,61.1,85.3,65.8,60.7,67.3,62.7,56.7,97.5,60.9,82.6,49,57.2,40.5,45.8,62.7,55,72.9,73.5,57.6,62.1,54,52.4,34,34,58,56,58,56,42.3,42.3,22.5,24.2,19.4,20.4,10.4,10.3,19,25,39.4,33.6,46.6,50.4,4.8,2.8,22.2,13.3,22.5,18.4,21.5,25.3,18.2,24.9,18.8,25.5,44.6,48.6,40.4,48.6,34.5,34.5,39.9,39.9,59.5,59.5,16.5,16.5,42.8,48,42.8,48,47.6,56,30,42.3,43.4,60.2,37.9,10.6,55,42.4,34.8,88.7,47.9,49.8,34.1,43.7,35.4,45,3.4,7.2,62.3,62.3
|
||||
410,KOR,South Korea,Asia-Pacific,51748739,65580,46.2,51,47.8,49.9,28.8,32.8,41.4,41.4,14.4,15.1,20.5,27,19.1,19.1,27.2,54.4,47.6,55.8,29.1,29.1,54,54,65.4,65.4,9,0,48.8,35.4,42,40.5,63.4,57.5,NA,NA,NA,NA,71.1,62,44.9,44.9,60.3,60.3,30.5,34.9,45,31.2,34.4,40,18.2,21.2,29.8,39.5,48.8,61.5,89,87.3,31.9,22.3,36.5,25.2,100,100,97.2,100,62.9,61.8,47.6,43.6,25.9,21.1,41.4,48.3,80.4,89,85.1,86.3,14.9,14.9,92.9,94.4,92.9,94.4,93,93,55.6,57.9,42.3,44.5,9.9,12.6,81.8,89.7,45.7,39.2,6.4,13.9,0,0,10,14.3,21.7,22.2,89.2,91.1,88.9,92.7,87.7,90.1,78.6,85.4,71.6,85.4,67.5,64.7,35.2,31.4,99.9,96.7,83.6,82,36,47,36,47,37.2,52.6,8.3,29.2,48.5,42.2,23.5,41.9,58.5,38.7,100,100,51.6,51.5,30,49.3,19.3,37.6,0,4.1,49.7,49.7
|
||||
724,ESP,Spain,Global West,47911579,56660,62.1,64.2,67.5,68.5,67.2,67.3,91.3,91.4,46.3,47.4,29,33.3,59.5,59.5,70.8,75.1,79.8,93.5,64.3,64.3,49,49,63.5,63.5,57.5,55.3,83.6,67.3,37.8,38.4,50.8,44.5,NA,NA,NA,NA,53.4,42.2,51.3,51.3,42.3,42.3,33,33.7,22.5,21.9,40.4,41.3,39.5,40.3,33.8,27.4,53.3,49.7,82.2,89.3,29.8,33.9,32.3,38.1,100,100,100,100,51.8,54.1,31.3,34.9,42.8,38.5,68.4,67.8,54.3,69,80.7,80.7,25.6,25.6,89.4,89.4,88.3,88.3,71,71,63.3,64.8,55,56.2,55.1,48.8,69.7,74.2,36.3,36.1,18.1,25.5,35.8,45.4,60.7,64.5,45.7,44.3,90.1,91.6,84.7,88.6,91.8,93.6,73,77.8,69.5,77.8,50.2,50.8,29.6,29,100,100,45.9,48.1,52.8,57.2,52.8,57.2,63.7,55.1,59.4,46.3,54.1,45.7,43.3,100,69,47.2,92.6,100,51.4,51.5,61.8,56.6,55.7,50.7,22.8,12.5,72.2,72.2
|
||||
144,LKA,Sri Lanka,Southern Asia,22971617,14255,36.9,38.7,40.9,39.3,37.2,33.7,2.5,2.5,1.5,1.5,75.1,44.8,59.8,59.8,36.1,36.2,82.8,82.8,48.3,48.3,32.2,32.2,81,81,0,0,75.4,30.7,78.1,78.5,66.1,70,81.4,88.7,NA,NA,62,65.4,31,31,58.4,58.4,63.1,63.4,66,68.1,49.8,62.6,51.5,58.7,65.8,67.2,53.5,50.3,47.7,49.1,42,36.2,42.2,30.9,41.7,54.2,63.4,50.2,64.2,62.5,55.1,65.6,61.8,100,55,61.3,68.5,56.9,10.9,10.9,87.3,87.3,4,4,1.1,1.1,1.1,1.1,30.1,30.9,20.2,20.1,8.8,12.3,11.6,20.3,48.9,26.9,44.9,48.1,22.1,20.8,41.8,38.6,25.5,23.6,50.7,53.7,47.9,55.6,47.8,52.5,60.9,65.2,57.7,65.2,32.6,32.6,68.2,68.2,8.9,8.9,8.9,8.9,36.6,44.1,36.6,44.1,38.1,44.2,79.2,91,32.2,46.1,36.7,3.8,43.7,51.1,53.3,61.9,46,48.6,38.3,44.8,38.4,44.8,22.5,23.4,90.4,90.4
|
||||
729,SDN,Sudan,Greater Middle East,50042791,2513,34.7,38.6,35.5,42.3,28.7,39.1,1.9,95.5,26.5,28,50,65.6,11,11,22.5,22.5,6.6,6.6,16.9,16.9,0,0,58.1,58.1,78.4,71.7,78.7,70.2,15.6,14.6,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,96.6,95.8,53.9,83.9,100,100,100,100,100,100,31.7,64,62.9,62.4,56.6,49.3,63.5,52.5,37.6,41.2,19.1,88.3,40.2,48.5,17,26,100,100,83.2,74.7,35.7,55.8,9.4,9.4,75.7,75.7,4.6,4.6,0,0,0,0,32.4,34.6,34.4,35.3,53.6,55.5,7.2,11.7,37.1,28.3,48.5,48.4,69.9,63.1,59.1,58.7,17.4,22.3,32.5,39.2,24.5,36.4,27.7,41,9.7,12,7.6,12,44.5,44.5,84.8,84.8,44.8,44.8,4,4,35.4,36.2,35.4,36.2,30.4,40.3,85.3,100,40.7,41.9,38.4,3.1,42.5,43.7,34.8,33.2,0,0,32.6,32.6,41.4,43.4,14.3,13.9,79.2,79.2
|
||||
740,SUR,Suriname,Latin America & Caribbean,628886,21404,47.9,56.6,55.6,63.9,63.8,64.3,57.9,57.9,43.4,43.4,50,100,100,100,57,58.3,34.1,34.1,32.6,32.6,76.1,76.1,98.7,98.7,97.7,97.7,88.9,74.9,47.6,46.2,78.7,72.9,89.2,82.5,80.7,63.4,84.9,78.4,47.9,47.9,93.9,93.9,44.7,38.9,38.6,19.5,38.9,44.9,38.8,38.3,41.1,44.7,56.4,36.3,14.5,80.3,97,100,85.4,89.9,20.8,72.1,7.7,82.7,58.1,62.8,41.7,47.5,38,100,20.5,28.3,79.9,89.4,44.3,44.3,46.6,46.6,49.5,49.5,39.6,39.6,39.6,39.6,57.2,58.8,67.2,68.3,100,100,30.3,37,100,97.8,33,36.4,85.6,83.1,77.9,76.2,25.5,15.9,40.9,43.4,41.2,46.5,37.7,41.4,34.4,39.7,33.2,39.7,13.7,13.1,31.2,30.3,2.4,2.4,1.9,1.2,28.5,43.6,28.5,43.6,19.2,45.2,0,29.2,22.9,50.7,100,100,28.2,29,44.8,10.5,49.9,49.8,14.5,37.2,11.4,37,33.8,37.2,50.3,50.3
|
||||
752,SWE,Sweden,Global West,10551494,74147,70.3,70.5,67.3,67.3,59.5,59.9,45.1,54.8,45.8,47.5,42.8,48.9,40.2,40.2,68.3,84.9,39.7,42.8,69.3,69.3,97,97,99.4,99.4,97.5,97.5,70.5,3.5,55.8,54.9,56.7,56.2,NA,NA,73.8,83.6,44.3,33.3,32.5,32.5,53.5,53.5,56.3,52.4,82.3,26.6,73.9,48.9,74.5,76.7,41.3,50.5,66.6,35,90.2,90.6,42.2,51.9,29.2,35.4,100,100,100,100,74.4,73.2,44.4,46.6,58.6,54.6,78.3,76.5,100,100,86.3,86.3,35.5,35.5,100,99,87,88,79.8,79.8,83,85.5,78.1,81.2,73,77.1,94,99.9,55.6,66.5,22.4,17.7,68.9,76.6,64.2,69.3,74.5,77.4,96.1,97,93.8,96,96.9,97.7,96.7,100,92.5,100,72,72.7,30.6,32.7,100,99.7,99.4,99.2,64.3,62.9,64.3,62.9,64.2,64.8,69.4,70.4,72.5,96.8,56.2,59.9,53.2,35.7,60,93.3,49.5,49.5,59.1,58.1,52.3,53.1,26.1,25.7,77.1,77.1
|
||||
756,CHE,Switzerland,Global West,8870561,98146,66,68,68.7,69.4,56.9,60,NA,NA,NA,NA,NA,NA,92.9,92.9,32.8,42.9,24.7,32.8,21.7,21.7,87.5,87.5,93.5,93.5,89.7,88.3,77.2,68.7,62.3,62.3,69.8,61.1,NA,NA,NA,NA,83.5,72.3,46.2,46.2,35.2,35.2,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,93.7,92.5,58.8,52.1,69.9,57.5,100,100,100,100,62.4,59.6,45.1,43.1,27.2,27.5,58.6,50.9,84.9,82.5,85.5,85.5,10.1,10.1,93.9,93.9,93.9,93.9,93.9,93.9,72.3,75.6,63.8,67.5,37.2,48.2,96.7,100,43.7,45.7,20.6,25.9,62.1,71.4,50.1,59.8,48.9,49.6,97.1,98,95.6,98.2,96.5,97.9,86.3,92.2,81.1,92.2,65.8,66.8,16.1,16.9,99,100,99,100,56.5,59.4,56.5,59.4,55.8,64.1,53.4,66.3,57.5,45.1,39.1,58,57.1,63.1,100,100,50.7,50.8,53.5,60.8,47.2,53.7,23.2,27.6,78.8,78.8
|
||||
158,TWN,Taiwan,Asia-Pacific,23317145,79031,50.4,50.3,53.2,51.8,41.5,39.4,2.2,2.2,10.5,10.5,100,88.3,24,24,37.4,37.4,65.3,65.4,79.1,79.1,95.1,95.1,98.3,98.3,NA,NA,68.4,27.8,100,100,84.8,85.1,77.3,97.3,NA,NA,80.6,88.5,50.8,50.8,64.1,64.1,47.5,46.4,22,41.3,45.3,45.9,50.9,27.3,72.7,69.1,41,0,89.5,86.5,30.2,18.8,44.8,18.8,100,100,100,100,58.2,60.3,38.9,44.2,14.2,16.2,30,34.8,90.8,90.8,39.2,39.2,31.5,31.5,69.9,69.9,16.2,16.2,16.2,16.2,47,50,36.2,40.1,19,22.2,55.5,61.2,35.2,50.8,13,18.2,10.3,10.4,34.9,44.2,35.2,36.1,69.7,70.9,68.9,72.1,69.5,70.1,68,71.8,65.9,71.8,75.4,69.7,40.8,28.4,99.2,98.5,98.1,96.7,49,48.4,49,48.4,48.7,49.2,23.8,24.4,40.3,70.3,100,49.4,48.2,34.8,63.2,100,NA,NA,53.4,47.9,42,34.8,12.3,8.7,44.4,44.4
|
||||
762,TJK,Tajikistan,Former Soviet States,10389799,5533,36,31.9,45,46.2,54,53.6,NA,NA,NA,NA,NA,NA,29.5,29.5,34.2,34.7,53,53,23.1,23.1,71.3,71.3,88.8,88.8,96.4,96.4,94.4,87.7,57.3,58.7,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,29.5,41,4.3,0,52.2,47.5,14.5,22.7,20.8,66.3,64.8,57,71.6,57.9,74,51.9,82.6,57.2,48.2,56.5,18.6,18.6,64.3,64.3,23.9,23.9,5.2,5.2,5.2,5.2,21.1,21.7,18.1,17.4,21.4,15.1,6.1,10.9,15.8,22.9,37.2,30.9,34,34.3,53.6,54,33.2,34.4,28,31.2,22.5,28.1,26.7,33.3,28.8,33.8,23.5,33.8,22.8,22.8,53.8,53.8,0,0,3.1,3.1,34.5,18.5,34.5,18.5,47.9,0,87.3,0,0,25.4,100,89.6,0,4,18.4,35.1,26.2,31.9,45.9,9.5,53.1,16.2,34.2,22.2,70.4,70.4
|
||||
834,TZA,Tanzania,Sub-Saharan Africa,66617606,4134,37.7,43.1,52.3,59.6,61.5,65.3,67.5,67.5,37.8,37.8,100,100,100,100,45.5,72.1,96.4,98.1,82.1,82.1,56.1,56.1,79.4,79.4,5.9,0,87.7,73.4,24.7,24.8,46,54.4,73,62.6,49,73.6,42.4,40,0,0,71.3,71.3,82.2,71.7,88.6,75.2,70.8,60.7,86.1,77.7,87.2,78.9,43.6,24.1,38.3,77.7,86.9,81.8,93.4,87.6,28.5,52.7,72.4,100,48.6,48.5,39.7,44,100,100,99.7,99.6,22.6,27.4,19.4,16.1,100,100,0.9,0.9,22.7,14.4,0,0,24.5,24.9,24.9,23.9,23.8,26.1,5.1,6.9,62.9,42.2,54.7,53.7,69.8,71.6,57.9,57.9,20.4,19.6,16.7,20.6,12.6,19.4,13.9,21.4,41.6,44.1,39.4,44.1,24.1,24.1,59.2,59.2,0,0,1,1,25.6,32.5,25.6,32.5,19.1,24.2,91.8,100,19.4,31.5,NA,NA,25.7,35.6,26.4,32.2,43.5,44.7,19.6,28.5,33.2,38.1,14.2,13.6,86.3,86.3
|
||||
764,THA,Thailand,Asia-Pacific,71702435,26420,41,45.4,49,50.8,46.9,46.2,57.8,68.3,17.2,28.6,53.8,33,27,27,69.9,70.2,60.5,60.6,69.6,69.6,63.9,63.9,94.2,94.2,30.5,22,41.5,0,30.2,30.2,66.6,70.7,76,89.9,69.7,85.2,41.4,39.8,51.9,51.9,60.1,60.1,47.2,44.2,58.9,38.8,79,79.2,32.7,31.5,34.7,33.3,49,60.9,61.3,75.8,66.3,64.2,58.4,56.6,52.6,57.7,88.9,100,59.8,58.8,46.8,48.9,64.9,60.7,58.1,47.5,76.6,73.2,21.5,21.5,31.3,31.3,23.4,23.4,18.1,18.1,18.1,18.1,33.3,34.9,24.1,25.5,5.7,11.9,27.9,37,38.7,35.7,33.6,32.7,18.7,16.2,28.1,31.4,10.5,10.4,49.1,51.2,54.1,61.2,42.3,44.6,72.1,75.4,68.7,75.4,32.6,33.6,35.2,38,41.8,40.1,25.3,26,35,46,35,46,39.5,50,29.5,46.1,27.1,70.7,36,6.4,9.6,57.8,31.8,55.9,46.2,48.1,31.7,45,30.9,43.2,3,6,62.3,62.3
|
||||
626,TLS,Timor-Leste,Asia-Pacific,1384286,4697,40.2,49.7,43.9,47.6,42.9,45.3,59.7,59.9,6.5,17.7,50,100,14.8,14.8,27.3,32.2,42.8,53.5,56.2,56.2,80.2,80.2,93.1,93.1,58.1,47.6,81.6,69.3,72.1,70.7,63.3,62.6,NA,NA,NA,NA,65.6,66.1,49.5,49.5,71,71,95.5,95.5,100,100,NA,NA,NA,NA,100,100,45.3,50,50.3,67,78.5,74,94.2,89.4,36,57.9,100,70.2,50.5,48.8,26.1,18.9,54.3,45.9,95,97.1,58.9,58.9,18.9,18.9,71.5,71.5,18.5,18.5,8.7,8.7,8.7,8.7,36,36.1,38.9,38.3,65.1,62.2,8.2,8.1,50.8,38.1,44.3,44.9,86.2,90.7,76.3,75,15.4,16.9,30.3,33.1,25.8,31.5,28.7,34.1,23.6,23.8,24.1,23.8,39.7,39.7,94.3,94.3,0,0,5,5,37.9,65.2,37.9,65.2,30.4,46.2,83,100,0,100,NA,NA,31.7,39.8,44.8,45.5,46.2,47.1,0,65.7,3.5,71.8,33,100,100,100
|
||||
768,TGO,Togo,Sub-Saharan Africa,9304337,3290,36.4,35.2,45,45.9,55.3,54.7,NA,NA,0,0,NA,NA,45.7,45.7,62.4,62.6,82.6,83.1,85.4,85.4,30,30,26.3,26.3,58.9,57.7,90.1,81,9.3,8.6,50.6,42.4,83.6,61,NA,NA,49.9,25.2,20.7,20.7,59.6,59.6,56.3,58.9,NA,NA,86.3,87.7,22.4,24.3,65.6,66,45,67.4,32.9,45.3,75.3,75.5,78,76.8,0,0,38.1,78.3,41,40.3,28.7,31.9,100,99.5,82,76.1,26.4,28.8,10,10,100,100,0,0,0,0,0,0,22.8,25.3,24.9,26.8,50.8,41.6,3.4,5.5,34.6,21.1,56.9,58.8,61.5,59.1,42.4,39.8,25.2,20.4,13.2,17.8,9,17.1,9.8,18.2,28.1,30.4,26.1,30.4,26.4,26.4,64.1,64.1,1.2,1.2,1.2,1.2,35.6,28.5,35.6,28.5,35.8,28.4,100,100,19,23,36.8,3.7,14.3,30.4,8.3,21.7,43.3,47.2,22.1,23.4,33.2,32.1,30.5,28.4,88.1,88.1
|
||||
776,TON,Tonga,Asia-Pacific,104597,7811,47.5,40.2,37.3,34,15.1,15.3,0.2,0.2,3.7,3.7,100,100,NA,NA,2.9,7.9,33.1,33.1,0.5,0.5,100,100,98.1,98.1,15,9.9,NA,NA,0,0.4,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,95.2,95.7,94.9,98.2,100,100,100,100,100,100,28.3,18.8,96.5,70.4,71.4,63,NA,NA,100,74.7,100,67.5,42,49.9,23.8,53.7,100,53.9,0,0,66.6,66.6,34.8,34.8,51.9,51.9,39.6,39.6,27.6,27.6,27.6,27.6,57.6,58.2,59.8,60.3,100,100,10.7,13.4,40.1,46.1,80.5,68.8,98.2,100,100,100,100,100,49.4,50.2,49.3,50.9,49,49.7,71.4,74,69.1,74,32,32,60.5,60.5,28.4,28.4,5.3,5.3,53.4,32.5,53.4,32.5,54,23.7,76.2,23.3,46.3,44.4,NA,NA,54,48.3,60.1,60.8,NA,NA,45.4,24.5,50.4,30.4,60.7,53.8,65.6,65.6
|
||||
780,TTO,Trinidad and Tobago,Latin America & Caribbean,1502932,34987,50.9,52.1,47.6,48.9,48.1,49.5,0,0,3.4,3.4,79.8,100,100,100,15.4,32.9,97.3,97.3,70.5,70.5,84.9,84.9,93.4,93.4,60.6,57.3,54.1,20.8,51.5,49.1,70.9,72.6,82.7,86.5,NA,NA,56.3,72.5,34.1,34.1,66.3,66.3,57.3,58.1,40.9,42,28.3,26.5,70.6,65.6,76.6,78.8,48.7,49.8,74.8,72.5,48.9,44.3,48,42,43.6,66.3,100,90.4,13.5,22.5,4,5.4,23.4,20.7,22.7,29.1,27.9,36.9,13.2,13.2,9.8,9.8,25.2,25.2,4.2,4.2,4.2,4.2,75,77,85,87.2,100,100,75,82.4,89.6,94.6,32.2,46.4,75,82.5,78.6,81.2,48.5,53.1,58.5,60.2,58.7,63,55.6,58.4,62.2,65.2,59.4,65.2,11.8,11.8,27.6,27.6,2.4,2.4,0.7,0.7,36,36.1,36,36.1,38.3,52.2,4.8,22.8,25.9,55.4,36.7,3.7,49.1,40.1,85.3,54.7,51.2,50.8,8.9,27.6,0,21.3,16.3,23.2,36.8,36.8
|
||||
788,TUN,Tunisia,Greater Middle East,12200431,14720,45.2,45.7,47.5,48.1,38.5,38.3,15.7,15.7,25.7,25.7,100,100,10.7,10.7,15.4,15.4,21,21.1,59.6,59.6,61.8,61.8,95.8,95.8,83.6,83.5,78.1,71.9,29.1,28.6,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,49.5,50.3,42.5,45.5,44.5,44.8,42.5,51.1,56.7,54.8,54.9,51.6,69.3,70,17.4,16.3,28,24.6,53.7,59.7,100,100,31.5,40.2,22.6,24.3,65.4,63.7,55,59.7,47.5,45.9,75,75,58.8,58.8,80.7,80.7,73.7,73.7,73.7,73.7,46.9,46.5,45.9,44.3,43.5,33,50.6,61.6,34.6,32.8,31.5,35.4,23.8,19.2,52.2,46.3,47.6,43.3,60.5,62.4,59.5,64.3,58.6,61.1,29.8,33.2,27,33.2,30.8,30.8,50.2,50.2,41.8,41.8,5.9,5.9,40.3,41.4,40.3,41.4,38.2,43.6,34.2,43,40.2,65.3,36.8,4,42.7,38.2,47.2,45.3,41.2,48.5,34.4,39.2,35.9,41,20,20.1,67.4,67.4
|
||||
792,TUR,Turkiye,Eastern Europe,87270501,41910,36,37.6,40.8,35.6,21.1,20.1,2.1,2.1,21,21,70.9,61.5,5.4,5.4,0.8,0.8,0.6,0.6,1,1,46.2,46.2,18.7,18.7,68.7,67.7,81,64,29.4,30.4,65.4,54.7,NA,NA,NA,NA,70.7,53.4,53.3,53.3,63.8,63.8,40.1,49.6,48.6,24.4,54.9,56.2,37.2,51.3,41.5,54.2,53.1,57.4,84.2,50,32.7,32.9,42.5,44.7,86.4,69.7,67.6,34.7,61.2,59.2,50.2,49.8,63.7,52.1,57.9,42.9,63.9,76,65.9,69.1,38.7,38.7,69.9,74,69.9,74,60.7,60.7,38.5,41.8,31.8,34.8,16.9,16,41.8,57.2,19.9,21.3,14.9,13.1,32.5,38.8,57.5,62.4,41,40.8,59,63.7,55.6,66.9,53.6,61.6,49.2,52.2,47.2,52.2,28,29.7,32.7,33.1,56.4,57.8,9.2,12.3,26.5,37,26.5,37,35.2,40.9,16.5,25,0,28,0,30.2,5.2,16.9,26,100,51.5,51.9,27,36.6,23.2,30.8,1,0.7,44.2,44.2
|
||||
795,TKM,Turkmenistan,Former Soviet States,7364438,26881,35.5,40.7,36.9,40.8,39.7,39.5,72.8,72.8,12.5,12.5,50,50,2.3,2.3,17.9,18.2,10.7,10.7,24.1,24.1,64.1,64.1,65.6,65.6,92.2,91.9,93,89.2,42,42.7,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,16.6,43.5,30.7,32.2,37.5,38.8,33.4,15.7,25.4,74.6,49.9,48.1,31.8,27,69.7,43.5,86.6,72.3,59.6,59.6,39.2,39.2,43.2,43.2,44.7,44.7,34.1,34.1,34.1,34.1,51.6,53.8,53.3,54.1,48.5,45.5,51.4,67.8,48.1,43.1,36,34.1,57,56.3,62.8,64.2,48.3,48,51.3,58.5,40.2,54.2,45.7,61.4,39.8,41.9,38.7,41.9,48.7,48.7,79.8,79.8,75.3,75.3,4.3,4.3,20.1,29.6,20.1,29.6,34.5,49.5,5.1,25.7,42.9,37.7,36.8,7.6,19.9,28.3,0,11.5,0,0,4.8,23.4,14.9,26.4,12.4,14.7,32.3,32.3
|
||||
800,UGA,Uganda,Sub-Saharan Africa,48656601,3642,31.3,35.4,43.8,44.5,54.6,51.9,NA,NA,NA,NA,NA,NA,39.1,39.1,69.5,72,59,59,77.5,77.5,17.6,17.6,62.2,62.2,24.9,15.7,89.8,63.7,0,0,31.3,34.1,40.7,46.2,31.2,35.5,44.8,29.7,0,0,43.5,43.5,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,44.7,54.5,83.4,76.4,83.2,77.2,9.3,30.7,46.6,69.4,47.8,48.3,36.4,40.9,100,100,97.7,92.7,31.6,32.9,12.8,12.8,96,96,8.1,8.1,0,0,0,0,17.7,18.3,14.4,14,4.5,7.7,5.5,7.5,48.9,29.2,60.5,64.7,22.8,25.4,27.1,28.9,3.5,5.9,20.5,23.6,16.3,22.1,18.1,24.6,35.9,38.3,33.7,38.3,24.3,24.3,57.3,57.3,2.6,2.6,2.2,2.2,22.8,35.7,22.8,35.7,13.4,29.5,100,100,0,33,NA,NA,0,37.1,13,24.5,46.6,48.1,12.2,33.2,21.9,40.4,17.1,18.7,92.9,92.9
|
||||
804,UKR,Ukraine,Former Soviet States,37732836,20760,47,54.6,49.4,58.5,44.8,53.8,81.5,81.5,34.2,34.2,48.4,44.1,22.4,22.4,8,64.9,43.8,43.8,54.5,54.5,42.5,42.5,0,0,79.3,79.8,73.1,71.1,0,0,58.4,54.8,NA,NA,NA,NA,58.5,53.1,70.4,70.4,32.2,32.2,33.6,33.4,79.4,18.8,37.4,27.7,29.7,40,42.1,34.8,60.7,57.6,67.5,92.9,54,54.7,56.2,59.7,70.7,100,49.6,100,69.8,76.4,56.1,71.1,100,100,63,64.7,56.6,84.5,41.4,41.7,19.5,22,55.9,55.9,34.2,34.2,34.2,34.2,43.6,48.1,34.1,40,25.1,37.9,28.8,35.6,40.8,58.8,29.3,31,30.4,35.9,59.9,64.2,63.3,64.4,74.9,76,69.9,72.2,76.3,78.5,56.2,60.7,52.9,60.7,22.6,22.2,39.7,37.5,30.2,33.3,1.8,1.3,46.3,53.9,46.3,53.9,52.5,62.6,50,65.9,53.8,73.4,0,0,28.1,41.6,55.1,62.6,50,49.8,41.3,51.7,43.1,55.3,8.1,23.9,84.9,84.9
|
||||
784,ARE,United Arab Emirates,Greater Middle East,10642081,82000,43.3,52,54.3,63.5,49.2,59.3,90.2,90.2,20.6,31.1,100,100,42.5,42.5,23.1,37.3,2.6,55.1,95.3,95.3,88,88,99.3,99.3,55.8,48.4,88,78.7,41,41.2,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,79.4,80,45,37.1,89.8,89.4,100,100,77.5,82.8,44.7,50.6,46.2,65.1,0,0,0,0,12.5,88.9,100,67.3,34.5,37.5,11.7,13.8,33.7,29.2,31.5,36.7,62.1,62.1,91.2,91.2,36.7,36.7,93.9,93.9,100,100,100,100,49.3,50.6,46,46.2,16.9,10.3,93.2,99.3,11.9,24.2,2.3,7.1,16.3,12.4,42.8,34.8,14.9,12.6,69.5,71.9,76,80.6,63.2,66.1,36.6,49.9,33.5,49.9,29.5,20,23,23.3,53,41.6,24.2,5.9,21.5,35.6,21.5,35.6,17.2,45.9,0,14,22.2,42.7,36.1,8,6.9,35.9,60.1,89.9,100,100,7.2,36.5,0,11.3,3.4,6.5,14.4,14.4
|
||||
826,GBR,United Kingdom,Global West,68682962,64384,71.4,72.7,72.8,73.3,70.4,71.9,78.1,80,44.5,54.2,66.2,70.4,60,60,56.9,57,87.6,87.9,83.5,83.5,72,72,24.5,24.5,91.3,91.4,89.2,88,47.1,49.3,46,46.4,NA,NA,NA,NA,42.3,45.6,63.6,63.6,16.1,16.1,43.2,38.1,20.9,14.9,49.2,58.4,29.2,31.7,37.1,40.3,57.5,44.1,92.1,92,38.9,43,62.2,60.5,100,100,100,100,78.6,76.9,57.4,56,50.1,48.6,83.6,77,81.6,100,79.8,79.8,25.7,25.7,85.8,85.8,85.8,85.8,85.8,85.8,74.5,77.4,67.2,69.9,43.1,52.1,93.9,98.8,59.7,66.5,4.1,12.7,38.8,51.6,57.7,66.8,68.8,71.7,95.8,98.2,94.5,100,91.9,97,89.9,95.7,85.2,95.7,61.9,65.4,28.4,29.4,97.6,97.7,77.5,85.2,66.6,67.8,66.6,67.8,65,74.3,63.1,77.3,100,58.6,46.8,56.8,68.6,52.5,100,86.5,46.9,47,62.4,67.1,54.1,61.6,18.2,100,91.6,91.6
|
||||
840,USA,United States of America,Global West,343477335,89685,57.3,57.3,54.1,54.1,41.6,41,58.7,58.7,46.1,46.1,69.6,76.9,14.6,14.6,27,39.9,37.2,37.8,36.9,36.9,71.5,71.5,89.4,89.4,47.7,45.5,68.1,20.8,46.8,46.2,53.6,51.9,92.2,87.6,24,18.1,50.3,49.9,43.9,43.9,66.5,66.5,42.5,46.5,38.4,38,37,45.1,36,46.4,41,50.6,51.5,49.1,89,89.1,28.6,31.7,35.5,36.9,100,100,100,100,78.5,83,68,76.6,62.8,80.7,56.9,57.8,77.6,100,65.7,65.7,5.6,5.6,78.2,78.2,67.7,67.7,67.7,67.7,69.7,72,63,65.8,56.3,61.5,88.3,91.6,27.1,33.8,0,6.6,29.1,35.7,53.5,60.3,38.5,35.5,95.1,96.4,84.5,90.9,98.6,100,75.4,78.6,73.6,78.6,45.3,41.7,15.6,13.3,100,93.9,47.7,44,51.6,50.1,51.6,50.1,60.8,57.7,37.4,33.3,60.7,50.5,38,46.7,53.8,55.2,100,100,50.5,50.2,52.6,52.5,35.3,35.5,0,0,50.1,50.1
|
||||
858,URY,Uruguay,Latin America & Caribbean,3388081,36010,43.2,43.9,39.7,39.1,29.8,29.4,15.1,15.1,22.1,22.1,73.4,54.2,6.3,6.3,17.4,18.3,9.7,11.6,16.7,16.7,42.6,42.6,89.3,89.3,70.4,71.3,80.1,69.9,23.5,25.9,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,44.1,34.4,61.2,51.6,55.1,53.7,16.8,26,20.6,21.1,47.5,40.1,68.2,75.8,82.4,78.9,96.7,92.6,16.4,55.5,41,92.2,72,58.2,59.1,58.6,36.1,32.5,73.4,73.8,82.3,53.4,34.1,34.1,59,59,37.7,37.7,26.3,26.3,26.3,26.3,54.8,56.5,51.1,52.3,48.4,48.6,46.7,57.7,57.8,52.3,18.7,27,68,68.6,79.3,78.4,33.9,38.8,69.3,72.5,69.1,75.6,64.9,70.4,62.1,64.7,60,64.7,30.9,30.9,36.3,36.3,66.2,66.2,7.8,7.8,38.9,40.6,38.9,40.6,34.8,46.1,34.7,53.8,44.7,38.9,94.8,50.4,39.9,46.5,0,53.3,46.3,48.2,36,37.6,31.2,31.4,21.8,21.4,38.4,38.4
|
||||
860,UZB,Uzbekistan,Former Soviet States,35652307,11596,44.3,42.9,48.2,49.3,37.7,44.4,NA,NA,NA,NA,NA,NA,10.8,10.8,19.8,36.6,13.4,32.3,26.8,26.8,75.3,75.3,75.3,75.3,91.1,90,76.9,66.1,36,36.1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,61.9,49.2,40.3,41.5,60.8,57.1,73.6,42.8,68,55.6,64.9,57.4,59.6,49.6,42.4,35.6,70.6,45.7,72,72,60.8,62.2,54.2,53.6,39,39,93.5,97.2,23.5,23.5,35.4,37.7,26.2,27.5,25.8,23.9,13.7,23.2,46.6,45.8,35.9,29.6,28.3,30.1,56,56,38.2,40.1,66.4,71.5,55.6,65.4,64.6,75.5,39.9,44.3,36,44.3,28.7,28.7,68.3,68.3,0,0,3.5,3.5,45.8,37.5,45.8,37.5,59.2,46.8,63.5,43.6,32.6,35.6,0,21.7,4.1,11.8,53.4,47.2,54,55,32.3,32.1,45.2,38.6,13,10,57.8,57.8
|
||||
548,VUT,Vanuatu,Asia-Pacific,320409,2878,35.4,44.6,30.5,36.5,17.7,18.1,0.6,0.6,1.8,1.8,100,98.1,1.7,1.7,0.6,3.6,13.7,13.7,2.9,2.9,76.1,76.1,99.1,99.1,0.3,0,98.5,98.8,100,100,77.4,81.9,83.8,81.2,91.7,94.6,86.9,79.6,48.4,48.4,88.7,88.7,78.9,84,73.2,85.6,31.1,36.3,100,100,100,99.2,NA,NA,36.1,73.5,76,80.5,78.4,88.9,42.1,73,1,69.6,40.6,42.7,11.8,13.7,100,100,30.4,42.3,67.2,67.2,17.6,17.6,77.2,77.2,15.7,15.7,7.1,7.1,7.1,7.1,48.3,49.2,57,57.5,100,100,1.4,2.5,64.5,58.5,100,100,76.8,83.7,96.6,97.7,58.3,64.9,30.6,32.4,28.2,31.2,30.2,33.2,32.8,34.5,31.5,34.5,21.9,21.9,48.1,48.1,4.4,4.4,4.4,4.4,31.9,53.7,31.9,53.7,9.3,25.4,31.3,62.8,25.2,100,NA,NA,23.8,100,22.3,61.5,49.3,50.2,16.3,47.4,31.1,57.9,48.4,59,95.1,95.1
|
||||
862,VEN,Venezuela,Latin America & Caribbean,28300854,8404,51.6,53.1,60.2,61,63.2,61.3,10.3,10.3,14.9,14.9,58.1,76.4,100,100,88.5,88.6,96.7,96.7,75.5,75.5,69.9,69.9,91.6,91.6,43.1,37.5,82.2,56.7,54.9,52.2,79.2,71.3,89.1,82.8,84.9,69.6,70.8,69.7,37.6,37.6,87.8,87.8,84.9,82.5,36.8,27.8,75,85.9,100,99,99.7,98.5,79.3,39.3,53.7,76.1,100,100,91,90.5,44.9,72.2,27.8,72.3,47.3,46.1,25.9,18.1,40,42.5,41.2,47.5,83.1,73.9,32.1,32.1,29.1,29.1,33,33,32,32,32,32,48.3,50,51.4,54.2,58.2,62.1,49,51.6,63.3,54.2,24.3,33.3,58.4,61.9,62.6,62.9,11.5,9.4,47.7,48.5,48.5,49.3,47.7,47.9,39.9,38.2,40.5,38.2,14.6,10.3,35.3,24.6,0,0,1.2,1.2,41.4,43.5,41.4,43.5,37.8,50,35,55.1,50.4,51.7,40.7,15.5,44.8,53.6,43.3,57.2,49.3,49.4,32.6,34.4,29.2,45.5,6.4,14.2,67.2,67.2
|
||||
704,VNM,Viet Nam,Asia-Pacific,100352192,17350,28.2,24.5,32.2,27.7,27.4,25.4,27.5,27.5,7,7,76.7,40,25.4,25.4,41.2,41.6,19.7,24.9,44.3,44.3,30,30,82.7,82.7,14.5,3.2,19,0,60.2,59.4,47.4,48.5,45.2,56.8,75.5,71.4,22.4,15.6,34.3,34.3,53.9,53.9,31.4,29.4,100,98.2,36.8,31.8,15.4,9,18,13.3,35.3,29,33.2,7.5,46,43.9,52.8,46.6,36.5,0,44.6,0,73.7,73,58.9,55.2,29.9,31.9,58.1,59.4,98.7,100,14.9,14.9,58.7,58.7,10,10,10,10,10,10,24.7,26.6,13.7,15.5,1.8,8,9.7,15.4,27.3,34.3,28.8,22.9,32.8,32.3,21,24.8,17.2,15.8,51.6,53.7,46.7,52.2,51.2,54.7,40.8,43.3,38.9,43.3,46.1,46.1,74.2,74.2,27.4,27.4,27.4,27.4,25.2,17.9,25.2,17.9,23.9,10.8,6.3,0,36.4,49.7,36.7,0,33.2,35.4,35.4,51.6,45.5,41.7,24.2,10.3,28.2,12,4.8,0,36.5,36.5
|
||||
894,ZMB,Zambia,Sub-Saharan Africa,20723965,4190,42.2,46.1,63.5,65.3,84.7,83.7,NA,NA,NA,NA,NA,NA,99.6,99.6,90.7,91.2,99.2,99.2,79.4,79.4,54,54,92.1,92.1,59.6,59.6,94.2,80.1,54.6,52.6,50.4,40,57.9,45.1,NA,NA,47.4,37.5,13.5,13.5,75.1,75.1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,54.7,75.4,72.1,69.3,86.8,82.6,28.2,50.5,40.6,100,46,44.1,32.8,29.9,100,58.2,74.5,85.9,38.1,39.6,15.3,15.3,94.9,94.9,13.8,13.8,0.5,0.5,0.5,0.5,17.3,18.9,16.4,16.7,15.3,12.7,3.7,7,31.2,30.9,62.1,55.7,42,44,48.2,51.2,11.2,13.1,15.7,21.4,10,20.1,11.3,22.3,24.6,28.2,22.4,28.2,25.2,25.2,61.9,61.9,0,0,1,1,30.3,39.4,30.3,39.4,15.6,16.8,57.5,60,37.7,48.9,76.9,100,41.9,55.4,18.9,31.3,47.7,47.8,30,34.2,41.2,43.4,21.9,21.6,84,84
|
||||
716,ZWE,Zimbabwe,Sub-Saharan Africa,16340822,5071,42.4,51.7,57.1,66.3,68.7,70.5,NA,NA,NA,NA,NA,NA,64.7,64.7,67.6,72.7,92.3,94,95.4,95.4,41.8,41.8,79.4,79.4,32.7,32.7,79.2,85.1,31.8,33.6,41.4,45.7,54.1,51.6,NA,NA,36.1,45.1,20.4,20.4,63.5,63.5,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,41,88.7,76,69.5,90.9,84,37.7,82.1,50.1,100,27.3,35.5,27.5,31.7,65.9,57,83.5,80.8,4.1,18.7,62.5,56.7,76.5,75.1,75.9,69,61.2,53.9,0,0,21.5,22.9,21.9,22.8,27.4,26.8,3,4.9,38.7,33.5,68,68.9,53.7,55.4,49.6,53.1,16.8,17.5,17.2,19.5,14.3,19.2,14.9,19.7,23.9,27.1,22,27.1,31.8,31.8,74.9,74.9,3.3,3.3,3,3,37.1,53.5,37.1,53.5,45.3,69.1,100,100,34.7,54.2,36.8,3.8,35.1,59.8,34,34.1,35.7,43.5,26,46.2,42.3,59,23.3,32.2,96.9,96.9
|
||||
|
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"data": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/epi_results_2024_pop_gdp_v2.csv",
|
||||
"region_col": "region",
|
||||
"response": "EPI.new",
|
||||
"region_a": "Sub-Saharan Africa",
|
||||
"region_b": "Latin America & Caribbean",
|
||||
"predictors": [
|
||||
"gdp",
|
||||
["gdp", "population"]
|
||||
],
|
||||
"knn1": ["AGR.new", "AIR.new", "APO.new"],
|
||||
"knn2": ["BCA.new", "BDH.new", "CBP.new"],
|
||||
"k": 5,
|
||||
"fig_dir": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures",
|
||||
"stats_dir": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/stats",
|
||||
"box_a": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/box_Sub-Saharan_Africa_EPI.new.png",
|
||||
"box_b": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/box_Latin_America_Caribbean_EPI.new.png",
|
||||
"hist_a": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/hist_Sub-Saharan_Africa_EPI.new.png",
|
||||
"hist_b": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/hist_Latin_America_Caribbean_EPI.new.png",
|
||||
"qq_fig": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/qq_EPI.new_Sub-Saharan_Africa_vs_Latin_America_Caribbean.png",
|
||||
"ols": [
|
||||
{
|
||||
"name": "full: EPI.new ~ gdp",
|
||||
"rsq": 0.5224,
|
||||
"aic": 1257.4369,
|
||||
"bic": 1266.999,
|
||||
"nobs": 179,
|
||||
"summary_file": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/stats/ols_full_EPI.new_gdp.txt",
|
||||
"residuals_fig": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/residuals_full_EPI.new_gdp.png",
|
||||
"scatter_fig": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/scatter_full_EPI.new_gdp_gdp.png"
|
||||
},
|
||||
{
|
||||
"name": "full: EPI.new ~ gdp + population",
|
||||
"rsq": 0.5392,
|
||||
"aic": 1246.1592,
|
||||
"bic": 1258.8864,
|
||||
"nobs": 178,
|
||||
"summary_file": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/stats/ols_full_EPI.new_gdp_population.txt",
|
||||
"residuals_fig": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/residuals_full_EPI.new_gdp_population.png",
|
||||
"scatter_fig": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/scatter_full_EPI.new_gdp_population_gdp.png"
|
||||
}
|
||||
],
|
||||
"best_region_note": "on region `Sub-Saharan Africa`, the better model is **region Sub-Saharan Africa: EPI.new ~ gdp + population** (r²=0.361, aic=265.4, bic=272.7).",
|
||||
"knn": [
|
||||
{
|
||||
"tag": "model A",
|
||||
"k": 5,
|
||||
"vars": ["AGR.new", "AIR.new", "APO.new"],
|
||||
"accuracy": 0.5581,
|
||||
"confusion_fig": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/knn_confusion_model_A.png",
|
||||
"n_test": 43
|
||||
},
|
||||
{
|
||||
"tag": "model B",
|
||||
"k": 5,
|
||||
"vars": ["BCA.new", "BDH.new", "CBP.new"],
|
||||
"accuracy": 0.5116,
|
||||
"confusion_fig": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/knn_confusion_model_B.png",
|
||||
"n_test": 43
|
||||
}
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 63 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 63 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 63 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 32 KiB |
@@ -0,0 +1,38 @@
|
||||
# exploratory data analysis and models on the epi dataset
|
||||
date: 2025-10-13
|
||||
|
||||
## dataset and choices
|
||||
- **file**: `epi_results_2024_pop_gdp_v2.csv`
|
||||
- **region column**: `region`
|
||||
- **response var**: `EPI.new`
|
||||
- **regions**: `Sub-Saharan Africa` vs `Latin America & Caribbean`
|
||||
|
||||
## 1) variable distributions
|
||||
### 1.1 boxplots and histograms (with density!)
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
### 1.2 qq plot (two-sample)
|
||||

|
||||
|
||||
## 2) linear models
|
||||
### full: EPI.new ~ gdp
|
||||
|
||||
### full: EPI.new ~ gdp + population
|
||||
|
||||
### 2.2 same models on one region (comparison)
|
||||
on region `Sub-Saharan Africa`, the better model is **region Sub-Saharan Africa: EPI.new ~ gdp + population** (r²=0.361, aic=265.4, bic=272.7).
|
||||
|
||||
## 3) classification (knn, label = region)
|
||||
### model A
|
||||
- **k**: 5 | **accuracy**: 0.5581 | **test n**: 43
|
||||
variables: `c("AGR.new", "AIR.new", "APO.new")`
|
||||

|
||||
|
||||
### model B
|
||||
- **k**: 5 | **accuracy**: 0.5116 | **test n**: 43
|
||||
variables: `c("BCA.new", "BDH.new", "CBP.new")`
|
||||

|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
Call:
|
||||
lm(formula = f, data = d)
|
||||
|
||||
Residuals:
|
||||
Min 1Q Median 3Q Max
|
||||
-22.432 -4.915 0.043 6.222 20.899
|
||||
|
||||
Coefficients:
|
||||
Estimate Std. Error t value Pr(>|t|)
|
||||
(Intercept) -22.3482 5.0070 -4.463 1.43e-05 ***
|
||||
gdp 7.0974 0.5101 13.913 < 2e-16 ***
|
||||
---
|
||||
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
|
||||
|
||||
Residual standard error: 8.023 on 177 degrees of freedom
|
||||
Multiple R-squared: 0.5224, Adjusted R-squared: 0.5197
|
||||
F-statistic: 193.6 on 1 and 177 DF, p-value: < 2.2e-16
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
Call:
|
||||
lm(formula = f, data = d)
|
||||
|
||||
Residuals:
|
||||
Min 1Q Median 3Q Max
|
||||
-21.810 -5.068 -0.027 6.014 19.567
|
||||
|
||||
Coefficients:
|
||||
Estimate Std. Error t value Pr(>|t|)
|
||||
(Intercept) -8.6847 7.0829 -1.226 0.2218
|
||||
gdp 6.9983 0.5047 13.867 <2e-16 ***
|
||||
population -0.7970 0.2995 -2.662 0.0085 **
|
||||
---
|
||||
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
|
||||
|
||||
Residual standard error: 7.905 on 175 degrees of freedom
|
||||
Multiple R-squared: 0.5392, Adjusted R-squared: 0.5339
|
||||
F-statistic: 102.4 on 2 and 175 DF, p-value: < 2.2e-16
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
Call:
|
||||
lm(formula = f, data = d)
|
||||
|
||||
Residuals:
|
||||
Min 1Q Median 3Q Max
|
||||
-8.7004 -2.6329 -0.6432 3.1700 12.7231
|
||||
|
||||
Coefficients:
|
||||
Estimate Std. Error t value Pr(>|t|)
|
||||
(Intercept) 7.9123 6.3944 1.237 0.223
|
||||
gdp 3.6412 0.7453 4.885 1.41e-05 ***
|
||||
---
|
||||
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
|
||||
|
||||
Residual standard error: 4.322 on 44 degrees of freedom
|
||||
Multiple R-squared: 0.3517, Adjusted R-squared: 0.3369
|
||||
F-statistic: 23.87 on 1 and 44 DF, p-value: 1.407e-05
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
Call:
|
||||
lm(formula = f, data = d)
|
||||
|
||||
Residuals:
|
||||
Min 1Q Median 3Q Max
|
||||
-8.4641 -2.8896 -0.5014 3.3435 12.5429
|
||||
|
||||
Coefficients:
|
||||
Estimate Std. Error t value Pr(>|t|)
|
||||
(Intercept) 3.4874 12.1785 0.286 0.776
|
||||
gdp 3.8097 0.8314 4.583 4.08e-05 ***
|
||||
population 0.1907 0.4558 0.418 0.678
|
||||
---
|
||||
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
|
||||
|
||||
Residual standard error: 4.375 on 42 degrees of freedom
|
||||
Multiple R-squared: 0.3611, Adjusted R-squared: 0.3307
|
||||
F-statistic: 11.87 on 2 and 42 DF, p-value: 8.205e-05
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"data": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/epi_results_2024_pop_gdp_v2.csv",
|
||||
"region_col": "region",
|
||||
"response": "EPI.new",
|
||||
"region_a": "Sub-Saharan Africa",
|
||||
"region_b": "Latin America & Caribbean",
|
||||
"predictors": [
|
||||
"gdp",
|
||||
["gdp", "population"]
|
||||
],
|
||||
"knn1": ["AGR.new", "AIR.new", "APO.new"],
|
||||
"knn2": ["BCA.new", "BDH.new", "CBP.new"],
|
||||
"k": 5,
|
||||
"fig_dir": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures",
|
||||
"stats_dir": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/stats",
|
||||
"box_a": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/box_Sub-Saharan_Africa_EPI.new.png",
|
||||
"box_b": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/box_Latin_America_Caribbean_EPI.new.png",
|
||||
"hist_a": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/hist_Sub-Saharan_Africa_EPI.new.png",
|
||||
"hist_b": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/hist_Latin_America_Caribbean_EPI.new.png",
|
||||
"qq_fig": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/qq_EPI.new_Sub-Saharan_Africa_vs_Latin_America_Caribbean.png",
|
||||
"ols": [
|
||||
{
|
||||
"name": "full: EPI.new ~ gdp",
|
||||
"rsq": 0.5224,
|
||||
"aic": 1257.4369,
|
||||
"bic": 1266.999,
|
||||
"nobs": 179,
|
||||
"summary_file": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/stats/ols_full_EPI.new_gdp.txt",
|
||||
"residuals_fig": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/residuals_full_EPI.new_gdp.png",
|
||||
"scatter_fig": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/scatter_full_EPI.new_gdp_gdp.png"
|
||||
},
|
||||
{
|
||||
"name": "full: EPI.new ~ gdp + population",
|
||||
"rsq": 0.5392,
|
||||
"aic": 1246.1592,
|
||||
"bic": 1258.8864,
|
||||
"nobs": 178,
|
||||
"summary_file": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/stats/ols_full_EPI.new_gdp_population.txt",
|
||||
"residuals_fig": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/residuals_full_EPI.new_gdp_population.png",
|
||||
"scatter_fig": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/scatter_full_EPI.new_gdp_population_gdp.png"
|
||||
}
|
||||
],
|
||||
"best_region_note": "on region `Sub-Saharan Africa`, the better model is **region Sub-Saharan Africa: EPI.new ~ gdp + population** (r²=0.361, aic=265.4, bic=272.7).",
|
||||
"knn": [
|
||||
{
|
||||
"tag": "model A",
|
||||
"k": 5,
|
||||
"vars": ["AGR.new", "AIR.new", "APO.new"],
|
||||
"accuracy": 0.5581,
|
||||
"confusion_fig": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/knn_confusion_model_A.png",
|
||||
"n_test": 43
|
||||
},
|
||||
{
|
||||
"tag": "model B",
|
||||
"k": 5,
|
||||
"vars": ["BCA.new", "BDH.new", "CBP.new"],
|
||||
"accuracy": 0.5116,
|
||||
"confusion_fig": "/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures/knn_confusion_model_B.png",
|
||||
"n_test": 43
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
setwd("/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/")
|
||||
|
||||
# yes I am lazy
|
||||
dir.create("/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/stats", recursive = TRUE, showWarnings = FALSE)
|
||||
dir.create("/home/ion606/Desktop/Homework/Data Analytics/Assignments/Assignment II/output/figures", recursive = TRUE, showWarnings = FALSE)
|
||||
|
||||
|
||||
# These functions were chatgpt generated because I was having some issues with sourcing
|
||||
options(
|
||||
warn = 1,
|
||||
keep.source = TRUE,
|
||||
show.error.locations = TRUE
|
||||
)
|
||||
|
||||
safe_source <- function(file) {
|
||||
message("Sourcing: ", file)
|
||||
tryCatch(
|
||||
{
|
||||
# echo=TRUE prints each line before running, aiding pinpointing failures
|
||||
source(file, echo = TRUE, chdir = TRUE, keep.source = TRUE, local = new.env(parent = globalenv()))
|
||||
},
|
||||
error = function(e) {
|
||||
cat("\nError while sourcing: ", file, "\n", sep = "")
|
||||
cat(conditionMessage(e), "\n", sep = "")
|
||||
cat("Calls:\n"); print(sys.calls())
|
||||
stop(e) # rethrow to halt execution with context
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
safe_source("R/01_args_and_load.R")
|
||||
safe_source("R/02_plots.R")
|
||||
safe_source("R/03_ols_full.R")
|
||||
safe_source("R/04_ols_region.R")
|
||||
safe_source("R/05_knn.R")
|
||||
safe_source("R/06_report.R")
|
||||
@@ -0,0 +1,2 @@
|
||||
data/
|
||||
1.json
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"r.linting.lineLength": false,
|
||||
"r.editor.tabSize": 4,
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
# Data Analytics Fall 2025 – Assignment IV
|
||||
|
||||
## Measuring How Generative AI Adoption Reshaped Stack Overflow Participation 2018–2025
|
||||
|
||||
Itamar Oren-Naftalovich
|
||||
|
||||
<!-- **Repository Artifacts:** `analysis.r`, `data/*.csv`, `imgs/*.png`, `out.log` (model console output) -->
|
||||
|
||||
---
|
||||
|
||||
## 1. Abstract and Introduction
|
||||
|
||||
On 30 November 2022, ChatGPT became publicly available. Within days, the Stack Overflow community faced two major shocks: developers suddenly had a new source of code-specific answers, and Stack Overflow introduced a temporary ban on AI-generated content on 5 December 2022 while already struggling with limited (and often terrible) moderation capacity. In this project I will look at whether the combination of generative AI adoption and these policy changes produced a statistically detectable shift in Stack Overflow content creation, and whether developers who say they use ChatGPT still treat Stack Overflow as a daily resource.
|
||||
|
||||
My initial hypothesis was that monthly answer counts would show a break after the ChatGPT launch and AI policy ban, even after controlling for the pre-2022 downward trend. I also expected that respondents who explicitly name ChatGPT as an AI assistant would be less likely to visit Stack Overflow daily. To test these ideas, I built two complementary datasets:
|
||||
1. A Stack Overflow Data Explorer (SEDE) exports of monthly deleted and non-deleted answers from January 2018 through November 2025
|
||||
2. Microdata from the 2023 and 2024 Stack Overflow Developer Surveys, which record both visit frequency and generative AI usage
|
||||
|
||||
If you want to see *how* I did this (the code) see `analysis.r`
|
||||
|
||||
The analysis relies on four modeling strategies: an interrupted time-series (ITS) linear regression, a Poisson regression for counts, a seasonal ARIMA model trained only on pre-ChatGPT data, and a logistic regression relating survey-reported AI usage to daily Stack Overflow visitation. Smashed together, these models indicate that Stack Overflow answer production fell by more than 53% in the post-ChatGPT period (mean 90.5 vs. 193.0 answers per month). At the same time, daily visitors are increasingly concentrated in older age cohorts, and survey respondents who explicitly mention ChatGPT do not differ meaningfully from others in how often they visit the site. The following sections describe the datasets, exploratory patterns, modeling choices, and implications for the community.
|
||||
|
||||
---
|
||||
|
||||
## 2. Data Description and Preliminary Analysis
|
||||
|
||||
### 2.1 Stack Overflow Answer Volume (Dataset 1)
|
||||
|
||||
* **Source and Scope**
|
||||
`data/so_new_answers_per_month_2018_2025.csv` is a SEDE export of every new answer (deleted and non-deleted) by month from January 2018 through November 2025 (95 monthly observations). The script standardizes month formats, aggregates across deletion statuses, and adds indicators for the ChatGPT release (30 Nov 2022), the AI policy ban (5 Dec 2022), and the Stack Exchange moderator strike (5 Jun–7 Aug 2023).
|
||||
|
||||
* **Variables**
|
||||
After cleaning, the main table `answers_monthly` contains `answers_total`, `answers_non_deleted`, `answers_deleted`, calendar year and month, a sequential `time_index`, binary indicators for the events listed above, and a categorical `period` flagging pre- vs. post-ChatGPT months. A 3-month moving average (`answers_ma3`) is computed to smooth short-term noise for exploratory plots.
|
||||
|
||||
* **Quality Checks**
|
||||
Duplicate rows were removed by grouping on `month`, and all transformations are recorded in `out.log`. The only missing values arise in the first two moving-average entries, which plotting functions simply omit. Because SEDE distinguishes deleted from non-deleted answers, the analysis keeps both so that any changes in moderation are visible in the time series.
|
||||
|
||||

|
||||
*Figure 1. Monthly answer counts follow a long downward trend that becomes steeper after November 2022.*
|
||||
|
||||

|
||||
*Figure 2. Box plots highlight the magnitude of the drop between the pre- and post-ChatGPT regimes.*
|
||||
|
||||
**Table 1. Descriptive Statistics by Regime (source: `data/answers_summary_period.csv`)**
|
||||
|
||||
| period | n_months | mean_answers | median_answers | sd_answers | min_answers | max_answers |
|
||||
| ------------ | -------- | ------------ | -------------- | ---------- | ----------- | ----------- |
|
||||
| pre_chatgpt | 59 | 193.0 | 185 | 44.7 | 122 | 313 |
|
||||
| post_chatgpt | 36 | 90.5 | 88 | 38.0 | 11 | 157 |
|
||||
|
||||
A quick comparison of the six months immediately before and after 30 November 2022 shows only a −10.0% change in average answers, suggesting that the full −53% decline in Table 1 unfolded gradually across 2023–2025 rather than occurring instantly. This gradual pattern is one reason for using time-series models instead of treating the policy change as a simple before/after difference.
|
||||
|
||||
### 2.2 Stack Overflow Developer Survey (Dataset 2)
|
||||
|
||||
* **Source and Scope.**
|
||||
The second dataset uses the publicly released 2023 and 2024 Stack Overflow Developer Survey microdata (`stack-overflow-developer-survey-2023.zip` and `stack-overflow-developer-survey-2024.zip`, downloaded 19 November 2025). Combined, these files contain 146,676 responses from professional and hobbyist developers worldwide.
|
||||
|
||||
* **Schema Harmonization!**
|
||||
Column names differ slightly across years (for example, `SOAI` vs. `AISelect`), so helper functions search for the first matching column for each concept. The harmonized frame retains `year`, `main_branch`, `country`, numeric `age`, `gender`, reported Stack Overflow visit frequency (`so_visit`), and free-text AI assistant preferences (`ai_select`).
|
||||
|
||||
* **Feature Engineering**
|
||||
Two binary indicators are constructed: `frequent_so` (1 if the respondent reports visiting Stack Overflow daily or multiple times per day) and `uses_chatgpt` (1 if the string “ChatGPT” appears anywhere in `ai_select`). Age is grouped into buckets (`<25`, `25–34`, `35–44`, `45+`, `unknown`), and gender is collapsed into a simplified label to absorb inconsistent free-text entries.
|
||||
|
||||
* **Sample Considerations**
|
||||
Because the 2024 instrument asks about AI search preferences rather than naming specific tools, only 1,181 respondents in 2023 explicitly mention ChatGPT and almost none do in 2024. This change in wording is treated as a measurement artifact and revisited as a source of bias in Sections 3 and 4.
|
||||
|
||||
---
|
||||
|
||||
## 3. Exploratory Analysis
|
||||
|
||||
### 3.1 Seasonal and Trend Patterns in Answer Volume
|
||||
|
||||
The `answers_monthly` series preserves the familiar seasonal dip every December, but the overall level shifts downward after 2022. As Figure 3 shows, even typically slow months such as July now fall below 60 answers, compared with roughly 150–220 answers in earlier years.
|
||||
|
||||

|
||||
*Figure 3. Post-ChatGPT seasons follow a similar seasonal shape but sit on a much lower baseline.*
|
||||
|
||||
The 3-month moving average in Figure 4 provides additional context. It peaks near 210 answers in mid-2018, drifts below 150 answers by late 2021, crosses under 100 answers in August 2023, and reaches about 23 answers by November 2025. The timing of the Stack Exchange moderator strike (June–August 2023) aligns with the first extended period below 100 answers per month, hinting at compounding effects from generative AI substitution and reduced moderation capacity.
|
||||
|
||||

|
||||
*Figure 4. The smoothed series marks a clear structural break soon after the ChatGPT launch and policy ban.*
|
||||
|
||||
### 3.2 Survey Signals on Engagement and AI Adoption
|
||||
|
||||
A stacked bar chart (Figure 5) summarizes how daily Stack Overflow visitation relates to ChatGPT usage. In 2023, daily visitation rates are essentially identical for explicit ChatGPT users (39.1%) and non-users (also 39.1%), suggesting that early adopters of ChatGPT continued to visit Stack Overflow at similar rates while experimenting with AI. By 2024, daily visitation among respondents who *do not* mention ChatGPT falls to 37.3%. The near-absence of explicit ChatGPT mentions that year, however, is driven by the different survey question wording rather than a real disappearance of the tool. This reinforces the idea that self-reported tool usage is noisy and needs to be combined with behavioral indicators like monthly answer counts.
|
||||
|
||||

|
||||
*Figure 5. Small differences between groups and across years illustrate how limited the AI usage field is for explaining engagement.*
|
||||
|
||||
### 3.3 Sources of Uncertainty and Bias
|
||||
|
||||
Several sources of uncertainty shape the analysis:
|
||||
|
||||
* **Measurement bias.**
|
||||
SEDE relies on Stack Overflow’s internal logging. Deleted answers can be removed retroactively, so counts for the most recent months remain somewhat fluid.
|
||||
|
||||
* **Event alignment.**
|
||||
The interrupted time-series design treats 30 November 2022 as the breakpoint between regimes, but the 2023 moderator strike and evolving AI policies create overlapping shocks that blur a clean “pre vs. post” distinction.
|
||||
|
||||
* **Survey sampling.**
|
||||
The developer survey is voluntary, conducted in English, and heavily skewed toward respondents in North America and India. Age and tool usage are self-reported, and the 2024 wording change likely undercounts ChatGPT adoption.
|
||||
|
||||
* **Missingness.**
|
||||
“Prefer not to say” responses in age and gender are mapped to `NA` or `Unknown`, which softens demographic differences in downstream models.
|
||||
|
||||
These limitations motivated the use of several modeling approaches in Section 4 instead of relying on a single model family.
|
||||
|
||||
---
|
||||
|
||||
## 4. Model Development and Application of Models
|
||||
|
||||
Each model addresses a slightly different question about Stack Overflow activity. All diagnostics and figures are produced directly by `analysis.r` and saved in `imgs/`.
|
||||
|
||||
### 4.1 Interrupted Time-Series Linear Regression
|
||||
|
||||
* **Specification.**
|
||||
The primary linear model is
|
||||
`answers_total ~ time + post_chatgpt + chatgpt_time`,
|
||||
where `time` is the number of months since January 2018 and `chatgpt_time` resets to 1 in December 2022 to allow the post-ChatGPT slope to differ from the pre-ChatGPT trend.
|
||||
|
||||
* **Results.**
|
||||
The model explains 71.7% of the variance (adjusted R² = 0.708, σ = 35.3). Before ChatGPT, monthly answers were already declining by −0.86 answers per month (p = 0.002). After November 2022, the slope becomes steeper by an additional −2.37 answers per month (p < 0.001). The immediate level change of −18 answers at the breakpoint is not statistically significant (p = 0.24).
|
||||
|
||||
* **Interpretation.**
|
||||
Rather than a sudden cliff, the data show an acceleration of an existing decline. The post-ChatGPT trend line loses almost three extra answers each month relative to the pre-2023 trajectory, which accumulates to roughly 108 fewer answers per year.
|
||||
|
||||

|
||||
*Figure 6. The fitted line captures a gradual erosion in answer volume instead of a single large discontinuity.*
|
||||
|
||||
### 4.2 Poisson Regression for Count Data
|
||||
|
||||
* **Specification.**
|
||||
The Poisson model uses the same predictors but applies a log link appropriate for count outcomes.
|
||||
|
||||
* **Results.**
|
||||
The estimated multiplicative time effect before ChatGPT is `exp(time) = 0.996` (p < 0.001), corresponding to a 0.4% monthly contraction. After the release, the effective slope multiplier drops to 0.968 (p ≈ 2.7 × 10⁻⁶⁸), implying a 3.2% shrinkage per month. The residual deviance is 713.8 on 91 degrees of freedom, compared with a null deviance of 2,879.9.
|
||||
|
||||
* **Interpretation.**
|
||||
Expressed in percentage terms, the Poisson model tells a similar story to the linear ITS: by late 2025, the expected answer count decays toward single digits if post-2022 dynamics continue unchanged.
|
||||
|
||||

|
||||
*Figure 7. The Poisson model slightly overestimates the lowest post-2024 points, consistent with some dispersion in the counts.*
|
||||
|
||||
### 4.3 Seasonal ARIMA Forecasting (Pre-ChatGPT Baseline)
|
||||
|
||||
* **Specification.**
|
||||
To estimate what would have happened without ChatGPT and related policy changes, a seasonal ARIMA model, ARIMA(1,1,0)[1,0,0](12), is fit only to data through October 2022 (`train_ts`). The model then generates forecasts for November 2022–November 2025, which are compared to the actual counts.
|
||||
|
||||
* **Results.**
|
||||
On the training window, fit statistics are solid (RMSE = 32.9, MASE = 0.52). Out-of-sample, however, errors grow large: RMSE = 89.3, MAE = 79.3, MAPE ≈ 172%, and Theil’s U = 7.11. Observed counts soon fall below the 80% prediction interval and remain there, indicating that historical seasonality and trends alone cannot explain the post-2022 decline.
|
||||
|
||||
* **Interpretation.**
|
||||
The ARIMA baseline functions as a counterfactual. Its consistent over-prediction of post-ChatGPT activity reinforces the conclusion that a structural break occurred, rather than a continuation of prior dynamics.
|
||||
|
||||

|
||||
*Figure 8. Actual activity diverges from the ARIMA forecast almost immediately and never returns to the predicted band.*
|
||||
|
||||
### 4.4 Logistic Regression on Survey Engagement
|
||||
|
||||
* **Specification.**
|
||||
The survey-based model predicts `frequent_so` (daily or multiple-times-per-day visitor). Predictors that retain more than one level after cleaning are `uses_chatgpt`, `age_group`, and `year`. The harmonized `gender` variable collapses to a single `Unknown` level and is therefore dropped automatically. The data are split 80/20 into training and test sets with a fixed seed (123). The decision threshold is set to the training positive rate (0.384) to reduce the impact of class imbalance.
|
||||
|
||||
* **Results.**
|
||||
Relative to respondents younger than 25, the odds ratio for the 25–34 group is 1.04 (p = 0.008), while the 35–44 and 45+ groups have odds ratios of 0.81 and 0.71, respectively (both p < 10⁻³²). The ChatGPT usage indicator has an odds ratio of 0.99 (p = 0.92), effectively indistinguishable from 1. The 2024 indicator yields an odds ratio of 0.92 (p ≈ 2.2 × 10⁻¹¹), pointing to a modest overall decline in daily visitation from 2023 to 2024.
|
||||
|
||||
On the 29,336-observation test set, the confusion matrix reports 7,560 true negatives, 10,549 false positives, 4,009 false negatives, and 7,218 true positives, giving an accuracy of 50.4%, precision of 40.6%, and recall of 64.3%.
|
||||
|
||||
* **Interpretation.**
|
||||
The weak predictive performance and scarcity of explicit ChatGPT mentions in 2024 both suggest that the current survey instrument is not well suited for isolating the impact of AI usage on Stack Overflow engagement. Age shows a clearer pattern than AI usage: older cohorts are less likely to be daily visitors, while ChatGPT adoption, at least as self-reported in these surveys, does not significantly distinguish frequent users from others.
|
||||
|
||||

|
||||
*Figure 9. Predicted probability distributions overlap heavily, mirroring the non-significant odds ratio for `uses_chatgpt`.*
|
||||
|
||||
---
|
||||
|
||||
## 5. Conclusions and Discussion
|
||||
|
||||
The evidence points to some sort of structural break in Stack Overflow answer production beginning in late 2022. Average monthly answers drop from 193.0 in the 2018–October 2022 period to 90.5 between December 2022 and November 2025. The interrupted time-series model shows the slope of decline by becoming steeper by about −2.37 answers per month after ChatGPT’s release, and the Poisson model implies a post-ChatGPT decay rate of roughly 3.2% per month. ARIMA forecasts trained only on pre-ChatGPT data substantially overestimate post-2022 activity, which reinforces the conclusion that pre-existing seasonal and secular trends cannot account for the observed collapse.
|
||||
|
||||
The survey-based models show more information about *who* remains active. Despite common assumptions that ChatGPT usage directly crowds out Stack Overflow visits, the current survey data do not show a strong link: the odds ratio for reported ChatGPT usage is essentially 1, and differences in daily visitation are driven more by age and year than by AI adoption. Given the 2024 wording change and the limitations of self-reported tool usage, it would be premature to claim that ChatGPT users as a group have already abandoned Stack Overflow.
|
||||
|
||||
Taken together, these findings suggest that any response from Stack Overflow should combine supply-side interventions (such as incentives for high-quality answers and additional moderation support to limit deleted content) with better measurement of how developers actually integrate AI tools and community Q&A into their workflows.
|
||||
|
||||
Future work could extend the time-series models with covariates for major product changes (e.g., Collectives, Discussions), incorporate question volume alongside answers, and revisit the survey analysis once the 2025 instrument becomes available. Causal impact methods, such as Bayesian structural time series using the ARIMA forecast as a prior, could offer a more formal estimate of the counterfactual number of answers that would have been produced without the post-2022 shocks.
|
||||
|
||||
---
|
||||
|
||||
## References
|
||||
|
||||
1. Stack Exchange Data Explorer. “New answers (deleted + non-deleted) per month,” query exported 19 Nov 2025 from the Stack Overflow SEDE interface.
|
||||
2. Stack Overflow. “Stack Overflow Developer Survey 2023” and “Stack Overflow Developer Survey 2024,” datasets accessed 19 Nov 2025 from the Stack Overflow survey site.
|
||||
3. OpenAI. “Introducing ChatGPT,” OpenAI Blog, 30 Nov 2022.
|
||||
4. Stack Overflow Meta. “Temporary policy: ChatGPT is banned,” Meta Stack Overflow, 5 Dec 2022.
|
||||
5. Stack Exchange. “Moderator Strike: Stack Overflow, Stack Exchange Network,” Meta Stack Exchange updates, Jun–Aug 2023.
|
||||
@@ -0,0 +1,683 @@
|
||||
# install.packages(
|
||||
# c("tidyverse", "lubridate", "broom", "forecast", "stringr", "dplyr"),
|
||||
# repos = "http://cran.us.r-project.org"
|
||||
# )
|
||||
|
||||
library(tidyverse)
|
||||
library(lubridate)
|
||||
library(broom)
|
||||
library(forecast)
|
||||
library(stringr)
|
||||
library(dplyr)
|
||||
|
||||
|
||||
# directory for data files (adjust if desired)
|
||||
data_dir <- "data"
|
||||
if (!dir.exists(data_dir)) {
|
||||
dir.create(data_dir, recursive = TRUE)
|
||||
}
|
||||
|
||||
# directory for plots
|
||||
imgs_dir <- "imgs"
|
||||
if (!dir.exists(imgs_dir)) {
|
||||
dir.create(imgs_dir, recursive = TRUE)
|
||||
}
|
||||
|
||||
# constants: key event dates related to chatgpt and so policy
|
||||
|
||||
# chatgpt public research preview launch
|
||||
chatgpt_launch_date <- as.Date("2022-11-30") # openai "introducing chatgpt" blog
|
||||
|
||||
# stack overflow generative ai ban policy (meta so, 5 dec 2022)
|
||||
so_ai_policy_date <- as.Date("2022-12-05")
|
||||
|
||||
# moderation strike on stack exchange (june–aug 2023) from meta posts
|
||||
so_mod_strike_start <- as.Date("2023-06-05")
|
||||
so_mod_strike_end <- as.Date("2023-08-07")
|
||||
|
||||
# helper: safe downloader
|
||||
download_if_missing <- function(url, destfile) {
|
||||
if (!file.exists(destfile)) {
|
||||
message("downloading ", basename(destfile), " ...")
|
||||
download.file(url, destfile, mode = "wb")
|
||||
message("saved to ", destfile)
|
||||
} else {
|
||||
message("file already exists: ", destfile)
|
||||
}
|
||||
}
|
||||
|
||||
coerce_month_to_date <- function(x) {
|
||||
if (inherits(x, "Date")) {
|
||||
return(x)
|
||||
}
|
||||
if (inherits(x, "POSIXct")) {
|
||||
return(lubridate::as_date(x))
|
||||
}
|
||||
if (inherits(x, "POSIXlt")) {
|
||||
return(as.Date(x))
|
||||
}
|
||||
if (is.numeric(x)) {
|
||||
return(as.Date(x, origin = "1970-01-01"))
|
||||
}
|
||||
if (is.character(x)) {
|
||||
parsed <- suppressWarnings(lubridate::ymd_hms(x))
|
||||
if (all(is.na(parsed))) {
|
||||
parsed <- suppressWarnings(lubridate::ymd(x))
|
||||
}
|
||||
if (all(is.na(parsed))) {
|
||||
parsed <- suppressWarnings(as.Date(x))
|
||||
}
|
||||
return(parsed)
|
||||
}
|
||||
suppressWarnings(as.Date(x))
|
||||
}
|
||||
|
||||
# 1) load stack overflow monthly answers (dataset 1)
|
||||
|
||||
answers_csv_path <- file.path(data_dir, "so_new_answers_per_month_2018_2025.csv")
|
||||
|
||||
if (!file.exists(answers_csv_path)) {
|
||||
stop(
|
||||
"missing ", answers_csv_path,
|
||||
"\nrun the sede query in this script and download the csv to that path first."
|
||||
)
|
||||
}
|
||||
|
||||
answers_raw <- readr::read_csv(answers_csv_path, show_col_types = FALSE) |>
|
||||
rename(
|
||||
month = matches("^Date$|Month", ignore.case = TRUE),
|
||||
status = matches("^Status$", ignore.case = TRUE),
|
||||
new_answers = matches("NewAnswers|Count", ignore.case = TRUE)
|
||||
)
|
||||
|
||||
answers_raw <- answers_raw |>
|
||||
mutate(
|
||||
month = coerce_month_to_date(month),
|
||||
status = tolower(status)
|
||||
)
|
||||
|
||||
|
||||
# inspect column names so you can adjust if sede changes them
|
||||
print(names(answers_raw))
|
||||
|
||||
# expected columns: "Month", "Status", "NewAnswers"
|
||||
# normalise to lower snake case just in case
|
||||
|
||||
answers_raw <- answers_raw |>
|
||||
rename(
|
||||
month = matches("Month", ignore.case = TRUE),
|
||||
status = matches("Status", ignore.case = TRUE),
|
||||
new_answers = matches("NewAnswers|Count", ignore.case = TRUE)
|
||||
)
|
||||
|
||||
print(head(answers_raw))
|
||||
|
||||
# aggregate deleted vs non-deleted into separate columns per month
|
||||
answers_monthly <- answers_raw |>
|
||||
mutate(
|
||||
month = as.Date(month),
|
||||
status = tolower(status)
|
||||
) |>
|
||||
group_by(month) |>
|
||||
summarise(
|
||||
answers_total = sum(new_answers, na.rm = TRUE),
|
||||
answers_non_deleted = sum(if_else(status == "non-deleted", new_answers, 0L)),
|
||||
answers_deleted = sum(if_else(status == "deleted", new_answers, 0L)),
|
||||
.groups = "drop"
|
||||
) |>
|
||||
arrange(month) |>
|
||||
mutate(
|
||||
year = year(month),
|
||||
month_num = month(month),
|
||||
time_index = row_number(),
|
||||
post_chatgpt = month >= chatgpt_launch_date,
|
||||
post_ai_policy = month >= so_ai_policy_date,
|
||||
during_mod_strike = month >= so_mod_strike_start & month <= so_mod_strike_end,
|
||||
period = case_when(
|
||||
month < chatgpt_launch_date ~ "pre_chatgpt",
|
||||
TRUE ~ "post_chatgpt"
|
||||
)
|
||||
)
|
||||
|
||||
glimpse(answers_monthly)
|
||||
|
||||
# 2) download and load stack overflow developer survey 2023/2024 (dataset 2)
|
||||
|
||||
# official survey zip files as exposed on survey.stackoverflow.co
|
||||
# these urls are the same ones behind the "download full data set (csv)" links
|
||||
# see: https://survey.stackoverflow.co/
|
||||
survey_2023_url <- "https://survey.stackoverflow.co/datasets/stack-overflow-developer-survey-2023.zip"
|
||||
survey_2024_url <- "https://survey.stackoverflow.co/datasets/stack-overflow-developer-survey-2024.zip"
|
||||
|
||||
survey_2023_zip <- file.path(data_dir, "stack-overflow-developer-survey-2023.zip")
|
||||
survey_2024_zip <- file.path(data_dir, "stack-overflow-developer-survey-2024.zip")
|
||||
|
||||
download_if_missing(survey_2023_url, survey_2023_zip)
|
||||
download_if_missing(survey_2024_url, survey_2024_zip)
|
||||
|
||||
# helper to read the "survey_results_public.csv" inside each zip
|
||||
read_so_survey_from_zip <- function(zip_path, csv_pattern = "survey_results_public.csv") {
|
||||
if (!file.exists(zip_path)) {
|
||||
stop("zip file not found: ", zip_path)
|
||||
}
|
||||
|
||||
# list files inside zip (works even when the CSV is in a subfolder)
|
||||
zlist <- utils::unzip(zip_path, list = TRUE)
|
||||
# try to find the csv by exact name or by pattern
|
||||
csv_name <- zlist$Name[stringr::str_detect(zlist$Name, regex(csv_pattern, ignore_case = TRUE))]
|
||||
if (length(csv_name) == 0) {
|
||||
stop("could not find a csv matching ", csv_pattern, " inside ", zip_path)
|
||||
}
|
||||
csv_name <- csv_name[1] # take first match
|
||||
|
||||
# read it without extracting to disk using unz() connection
|
||||
# optionally supply col_types to speed parsing
|
||||
df <- readr::read_csv(
|
||||
unz(zip_path, csv_name),
|
||||
show_col_types = FALSE,
|
||||
# col_types = cols(.default = col_character()) # uncomment & customize if you want explicit types
|
||||
)
|
||||
df
|
||||
}
|
||||
|
||||
survey2023_raw <- read_so_survey_from_zip(survey_2023_zip)
|
||||
survey2024_raw <- read_so_survey_from_zip(survey_2024_zip)
|
||||
|
||||
# look at column names to locate ai + stackoverflow usage questions
|
||||
names(survey2023_raw)[1:80]
|
||||
|
||||
############################################################
|
||||
# create a harmonised survey subset focusing on:
|
||||
# - so visit frequency (column like SOVisitFreq)
|
||||
# - ai tool usage (column like AISelect or SOAI)
|
||||
############################################################
|
||||
|
||||
find_first_col <- function(df, pattern) {
|
||||
cols <- names(df)[stringr::str_detect(names(df), regex(pattern, ignore_case = TRUE))]
|
||||
if (length(cols) == 0) {
|
||||
return(NA_character_)
|
||||
}
|
||||
cols[1]
|
||||
}
|
||||
|
||||
pull_col_or_default <- function(df, col_name, default = NA_character_) {
|
||||
if (is.na(col_name)) {
|
||||
return(rep(default, nrow(df)))
|
||||
}
|
||||
df[[col_name]]
|
||||
}
|
||||
|
||||
pull_age_numeric <- function(df, col_name) {
|
||||
vec <- pull_col_or_default(df, col_name, default = NA_real_)
|
||||
if (is.numeric(vec)) {
|
||||
return(vec)
|
||||
}
|
||||
if (is.factor(vec)) {
|
||||
vec <- as.character(vec)
|
||||
}
|
||||
if (is.character(vec)) {
|
||||
vec <- stringr::str_trim(vec)
|
||||
vec[vec == ""] <- NA_character_
|
||||
vec[stringr::str_detect(vec, regex("prefer not to say", ignore_case = TRUE))] <- NA_character_
|
||||
# parse_number extracts the leading numeric value (e.g., 25 from "25-34 years old")
|
||||
return(suppressWarnings(readr::parse_number(vec)))
|
||||
}
|
||||
suppressWarnings(as.numeric(vec))
|
||||
}
|
||||
|
||||
main_branch_col_2023 <- find_first_col(survey2023_raw, "^MainBranch$|MainBranch")
|
||||
country_col_2023 <- find_first_col(survey2023_raw, "^Country$|Country")
|
||||
age_col_2023 <- find_first_col(survey2023_raw, "^Age$|Age")
|
||||
gender_col_2023 <- find_first_col(survey2023_raw, "^Gender$|Gender")
|
||||
so_visit_col_2023 <- find_first_col(survey2023_raw, "SOVisitFreq")
|
||||
ai_select_col_2023 <- find_first_col(survey2023_raw, "AISelect|SOAI")
|
||||
|
||||
main_branch_col_2024 <- find_first_col(survey2024_raw, "^MainBranch$|MainBranch")
|
||||
country_col_2024 <- find_first_col(survey2024_raw, "^Country$|Country")
|
||||
age_col_2024 <- find_first_col(survey2024_raw, "^Age$|Age")
|
||||
gender_col_2024 <- find_first_col(survey2024_raw, "^Gender$|Gender")
|
||||
so_visit_col_2024 <- find_first_col(survey2024_raw, "SOVisitFreq")
|
||||
ai_select_col_2024 <- find_first_col(survey2024_raw, "AISelect|SOAI")
|
||||
|
||||
message("2023 so visit col: ", so_visit_col_2023)
|
||||
message("2023 ai col : ", ai_select_col_2023)
|
||||
message("2024 so visit col: ", so_visit_col_2024)
|
||||
message("2024 ai col : ", ai_select_col_2024)
|
||||
|
||||
# build a clean survey frame for 2023
|
||||
|
||||
survey2023 <- survey2023_raw |>
|
||||
transmute(
|
||||
year = 2023L,
|
||||
main_branch = pull_col_or_default(survey2023_raw, main_branch_col_2023),
|
||||
country = pull_col_or_default(survey2023_raw, country_col_2023),
|
||||
age = pull_age_numeric(survey2023_raw, age_col_2023),
|
||||
gender = pull_col_or_default(survey2023_raw, gender_col_2023),
|
||||
so_visit = pull_col_or_default(survey2023_raw, so_visit_col_2023),
|
||||
ai_select = pull_col_or_default(survey2023_raw, ai_select_col_2023)
|
||||
)
|
||||
|
||||
# same idea for 2024 (schema is very similar)
|
||||
|
||||
survey2024 <- survey2024_raw |>
|
||||
transmute(
|
||||
year = 2024L,
|
||||
main_branch = pull_col_or_default(survey2024_raw, main_branch_col_2024),
|
||||
country = pull_col_or_default(survey2024_raw, country_col_2024),
|
||||
age = pull_age_numeric(survey2024_raw, age_col_2024),
|
||||
gender = pull_col_or_default(survey2024_raw, gender_col_2024),
|
||||
so_visit = pull_col_or_default(survey2024_raw, so_visit_col_2024),
|
||||
ai_select = pull_col_or_default(survey2024_raw, ai_select_col_2024)
|
||||
)
|
||||
|
||||
survey_all <- bind_rows(survey2023, survey2024)
|
||||
|
||||
# engineer features:
|
||||
# - binary flag: frequent so visitor
|
||||
# - binary flag: uses chatgpt as ai tool (from ai_select free text / semicolon list)
|
||||
# - coarser age groups
|
||||
|
||||
survey_model <- survey_all |>
|
||||
filter(!is.na(so_visit)) |>
|
||||
mutate(
|
||||
so_visit = as.character(so_visit),
|
||||
ai_select = as.character(ai_select),
|
||||
|
||||
# frequent so visitor: daily or multiple times per day etc.
|
||||
frequent_so = dplyr::case_when(
|
||||
stringr::str_detect(so_visit, regex("multiple times per day", ignore_case = TRUE)) ~ 1L,
|
||||
stringr::str_detect(so_visit, regex("daily|almost every day", ignore_case = TRUE)) ~ 1L,
|
||||
TRUE ~ 0L
|
||||
),
|
||||
uses_chatgpt = dplyr::case_when(
|
||||
is.na(ai_select) ~ 0L,
|
||||
stringr::str_detect(ai_select, regex("chatgpt", ignore_case = TRUE)) ~ 1L,
|
||||
TRUE ~ 0L
|
||||
),
|
||||
age_group = dplyr::case_when(
|
||||
!is.na(age) & age < 25 ~ "<25",
|
||||
!is.na(age) & age >= 25 & age < 35 ~ "25-34",
|
||||
!is.na(age) & age >= 35 & age < 45 ~ "35-44",
|
||||
!is.na(age) & age >= 45 ~ "45+",
|
||||
TRUE ~ "unknown"
|
||||
),
|
||||
gender = if_else(is.na(gender) | gender == "", "Unknown", gender)
|
||||
) |>
|
||||
filter(!is.na(frequent_so)) |>
|
||||
mutate(
|
||||
frequent_so = as.integer(frequent_so),
|
||||
uses_chatgpt = as.integer(uses_chatgpt),
|
||||
age_group = factor(age_group),
|
||||
gender = factor(gender),
|
||||
year = factor(year)
|
||||
)
|
||||
|
||||
glimpse(survey_model)
|
||||
|
||||
# SECTION 2: data description + preliminary plots (dataset 1)
|
||||
# basic time series plot of answers over time (for section 2)
|
||||
|
||||
p_answers_ts <- ggplot(answers_monthly, aes(x = month, y = answers_total)) +
|
||||
geom_line() +
|
||||
geom_vline(xintercept = chatgpt_launch_date, linetype = "dashed") +
|
||||
geom_vline(xintercept = so_ai_policy_date, linetype = "dotted") +
|
||||
labs(
|
||||
title = "monthly new answers on stack overflow",
|
||||
x = "month",
|
||||
y = "number of answers"
|
||||
)
|
||||
|
||||
print(p_answers_ts)
|
||||
ggsave(
|
||||
filename = file.path(imgs_dir, "01_answers_ts.png"),
|
||||
plot = p_answers_ts,
|
||||
width = 10, height = 6, units = "in", dpi = 300
|
||||
)
|
||||
|
||||
# boxplot pre vs post chatgpt
|
||||
|
||||
p_box_pre_post <- ggplot(answers_monthly, aes(x = period, y = answers_total)) +
|
||||
geom_boxplot() +
|
||||
labs(
|
||||
title = "distribution of monthly answers: pre vs post chatgpt launch",
|
||||
x = "period",
|
||||
y = "monthly answers"
|
||||
)
|
||||
|
||||
print(p_box_pre_post)
|
||||
ggsave(file.path(imgs_dir, "02_box_pre_post.png"), plot = p_box_pre_post, width = 8, height = 6, units = "in", dpi = 300)
|
||||
|
||||
# basic summary table
|
||||
|
||||
answers_summary_period <- answers_monthly |>
|
||||
group_by(period) |>
|
||||
summarise(
|
||||
n_months = n(),
|
||||
mean_answers = mean(answers_total),
|
||||
median_answers = median(answers_total),
|
||||
sd_answers = sd(answers_total),
|
||||
min_answers = min(answers_total),
|
||||
max_answers = max(answers_total),
|
||||
.groups = "drop"
|
||||
)
|
||||
|
||||
print(answers_summary_period)
|
||||
|
||||
# SECTION 3: exploratory analysis
|
||||
# seasonal pattern: answers by calendar month across years
|
||||
|
||||
p_seasonal <- answers_monthly |>
|
||||
mutate(month_label = factor(month_num, labels = month.abb)) |>
|
||||
ggplot(aes(x = month_label, y = answers_total, group = year, color = period)) +
|
||||
geom_line(alpha = 0.6) +
|
||||
labs(
|
||||
title = "seasonality of answers by calendar month and year",
|
||||
x = "calendar month",
|
||||
y = "monthly answers"
|
||||
)
|
||||
|
||||
print(p_seasonal)
|
||||
ggsave(file.path(imgs_dir, "03_seasonal.png"), plot = p_seasonal, width = 10, height = 6, units = "in", dpi = 300)
|
||||
|
||||
# rolling 3-month moving average to smooth noise
|
||||
|
||||
answers_monthly <- answers_monthly |>
|
||||
arrange(month) |>
|
||||
mutate(
|
||||
answers_ma3 = zoo::rollmean(answers_total, k = 3, fill = NA, align = "right")
|
||||
)
|
||||
|
||||
p_ma3 <- ggplot(answers_monthly, aes(x = month)) +
|
||||
geom_line(aes(y = answers_total), alpha = 0.3) +
|
||||
geom_line(aes(y = answers_ma3)) +
|
||||
geom_vline(xintercept = chatgpt_launch_date, linetype = "dashed") +
|
||||
labs(
|
||||
title = "monthly answers with 3-month moving average",
|
||||
x = "month",
|
||||
y = "answers"
|
||||
)
|
||||
|
||||
print(p_ma3)
|
||||
ggsave(file.path(imgs_dir, "04_ma3.png"), plot = p_ma3, width = 10, height = 6, units = "in", dpi = 300)
|
||||
|
||||
# simple percentage change around chatgpt launch
|
||||
|
||||
pre_window <- answers_monthly |>
|
||||
filter(
|
||||
month >= chatgpt_launch_date - months(6),
|
||||
month < chatgpt_launch_date
|
||||
)
|
||||
|
||||
post_window <- answers_monthly |>
|
||||
filter(
|
||||
month >= chatgpt_launch_date,
|
||||
month < chatgpt_launch_date + months(6)
|
||||
)
|
||||
|
||||
pre_mean <- mean(pre_window$answers_total)
|
||||
post_mean <- mean(post_window$answers_total)
|
||||
pct_change <- (post_mean - pre_mean) / pre_mean * 100
|
||||
|
||||
pct_change
|
||||
|
||||
# survey exploratory: relation between ai usage and so visit frequency
|
||||
|
||||
survey_counts <- survey_model |>
|
||||
mutate(
|
||||
uses_chatgpt_label = if_else(uses_chatgpt == 1L, "uses chatgpt", "does not use chatgpt"),
|
||||
freq_label = if_else(frequent_so == 1L, "visits so daily", "visits so less often")
|
||||
) |>
|
||||
count(year, uses_chatgpt_label, freq_label) |>
|
||||
group_by(year, uses_chatgpt_label) |>
|
||||
mutate(prop = n / sum(n)) |>
|
||||
ungroup()
|
||||
|
||||
p_survey_bar <- ggplot(survey_counts, aes(x = uses_chatgpt_label, y = prop, fill = freq_label)) +
|
||||
geom_col(position = "fill") +
|
||||
facet_wrap(~year) +
|
||||
scale_y_continuous(labels = scales::percent_format()) +
|
||||
labs(
|
||||
title = "relationship between chatgpt use and stack overflow visit frequency (survey)",
|
||||
x = "ai usage segment",
|
||||
y = "share of respondents",
|
||||
fill = "so visit frequency"
|
||||
)
|
||||
|
||||
print(p_survey_bar)
|
||||
ggsave(file.path(imgs_dir, "08_survey_bar.png"), plot = p_survey_bar, width = 10, height = 6, units = "in", dpi = 300)
|
||||
|
||||
# SECTION 4: model development (four different model types)
|
||||
|
||||
# MODEL 1: interrupted time series linear regression
|
||||
# outcome: monthly answers_total
|
||||
# predictors: time trend, post_chatgpt level change, slope change after chatgpt
|
||||
|
||||
its_data <- answers_monthly |>
|
||||
mutate(
|
||||
time = time_index,
|
||||
chatgpt_time = if_else(month >= chatgpt_launch_date,
|
||||
time_index - min(time_index[month >= chatgpt_launch_date]) + 1L,
|
||||
0L
|
||||
)
|
||||
)
|
||||
|
||||
model_lm <- lm(
|
||||
answers_total ~ time + post_chatgpt + chatgpt_time,
|
||||
data = its_data
|
||||
)
|
||||
|
||||
summary(model_lm)
|
||||
tidy(model_lm)
|
||||
glance(model_lm)
|
||||
|
||||
# predictions and plot
|
||||
|
||||
its_data <- its_data |>
|
||||
mutate(
|
||||
lm_fitted = predict(model_lm)
|
||||
)
|
||||
|
||||
p_lm_fit <- ggplot(its_data, aes(x = month)) +
|
||||
geom_line(aes(y = answers_total), alpha = 0.4) +
|
||||
geom_line(aes(y = lm_fitted), color = "blue") +
|
||||
geom_vline(xintercept = chatgpt_launch_date, linetype = "dashed") +
|
||||
labs(
|
||||
title = "interrupted time series regression: observed vs fitted answers",
|
||||
x = "month",
|
||||
y = "answers"
|
||||
)
|
||||
|
||||
print(p_lm_fit)
|
||||
ggsave(file.path(imgs_dir, "05_lm_fit.png"), plot = p_lm_fit, width = 10, height = 6, units = "in", dpi = 300)
|
||||
|
||||
# MODEL 2: poisson regression for count data
|
||||
|
||||
model_pois <- glm(
|
||||
answers_total ~ time + post_chatgpt + chatgpt_time,
|
||||
data = its_data,
|
||||
family = poisson(link = "log")
|
||||
)
|
||||
|
||||
summary(model_pois)
|
||||
tidy(model_pois, exponentiate = TRUE) # exp(coef) ~ multiplicative effect
|
||||
|
||||
# compare predicted counts
|
||||
|
||||
its_data <- its_data |>
|
||||
mutate(
|
||||
pois_fitted = predict(model_pois, type = "response")
|
||||
)
|
||||
|
||||
p_pois_fit <- ggplot(its_data, aes(x = month)) +
|
||||
geom_line(aes(y = answers_total), alpha = 0.3) +
|
||||
geom_line(aes(y = pois_fitted), color = "red") +
|
||||
geom_vline(xintercept = chatgpt_launch_date, linetype = "dashed") +
|
||||
labs(
|
||||
title = "poisson regression: observed vs predicted monthly answers",
|
||||
x = "month",
|
||||
y = "answers"
|
||||
)
|
||||
|
||||
print(p_pois_fit)
|
||||
ggsave(file.path(imgs_dir, "06_pois_fit.png"), plot = p_pois_fit, width = 10, height = 6, units = "in", dpi = 300)
|
||||
|
||||
# MODEL 3: arima time series forecast (pre-chatgpt vs actual)
|
||||
|
||||
# construct monthly ts object (frequency = 12)
|
||||
start_year <- year(min(answers_monthly$month))
|
||||
start_month <- month(min(answers_monthly$month))
|
||||
|
||||
answers_ts <- ts(
|
||||
answers_monthly$answers_total,
|
||||
start = c(start_year, start_month),
|
||||
frequency = 12
|
||||
)
|
||||
|
||||
# train on pre-chatgpt data (up to oct 2022) and forecast forward
|
||||
train_end <- c(2022, 10) # october 2022
|
||||
train_ts <- window(answers_ts, end = train_end)
|
||||
test_ts <- window(answers_ts, start = c(2022, 11))
|
||||
|
||||
arima_fit <- auto.arima(train_ts)
|
||||
|
||||
summary(arima_fit)
|
||||
|
||||
h <- length(test_ts)
|
||||
fc <- forecast(arima_fit, h = h)
|
||||
|
||||
# compare forecast vs actual on the holdout period
|
||||
|
||||
fc_df <- data.frame(
|
||||
month = answers_monthly$month[answers_monthly$month >= as.Date("2022-11-01")],
|
||||
actual = as.numeric(test_ts),
|
||||
forecast = as.numeric(fc$mean),
|
||||
lower_80 = as.numeric(fc$lower[, "80%"]),
|
||||
upper_80 = as.numeric(fc$upper[, "80%"])
|
||||
)
|
||||
|
||||
p_arima <- ggplot(fc_df, aes(x = month)) +
|
||||
geom_line(aes(y = actual), alpha = 0.6) +
|
||||
geom_line(aes(y = forecast), linetype = "dashed") +
|
||||
geom_ribbon(aes(ymin = lower_80, ymax = upper_80), alpha = 0.2) +
|
||||
labs(
|
||||
title = "arima forecast (trained on pre-chatgpt) vs actual answers",
|
||||
x = "month",
|
||||
y = "answers"
|
||||
)
|
||||
|
||||
print(p_arima)
|
||||
ggsave(file.path(imgs_dir, "07_arima_forecast.png"), plot = p_arima, width = 10, height = 6, units = "in", dpi = 300)
|
||||
|
||||
# simple accuracy metrics on the holdout
|
||||
|
||||
fc_accuracy <- accuracy(fc, test_ts)
|
||||
print(fc_accuracy)
|
||||
|
||||
# MODEL 4: logistic regression – does using chatgpt predict being a frequent stack overflow visitor?
|
||||
|
||||
set.seed(123)
|
||||
|
||||
survey_model_complete <- survey_model |>
|
||||
filter(!is.na(uses_chatgpt), !is.na(frequent_so))
|
||||
|
||||
candidate_predictors <- c("uses_chatgpt", "age_group", "gender", "year")
|
||||
valid_predictors <- candidate_predictors[sapply(
|
||||
candidate_predictors,
|
||||
function(col) dplyr::n_distinct(survey_model_complete[[col]], na.rm = TRUE) > 1
|
||||
)]
|
||||
drop_predictors <- setdiff(candidate_predictors, valid_predictors)
|
||||
if (length(drop_predictors) > 0) {
|
||||
message("dropping predictors with <2 levels: ", paste(drop_predictors, collapse = ", "))
|
||||
}
|
||||
|
||||
logit_formula <- if (length(valid_predictors) == 0) {
|
||||
frequent_so ~ 1
|
||||
} else {
|
||||
as.formula(paste("frequent_so ~", paste(valid_predictors, collapse = " + ")))
|
||||
}
|
||||
|
||||
n <- nrow(survey_model_complete)
|
||||
train_idx <- sample(seq_len(n), size = floor(0.8 * n))
|
||||
|
||||
survey_train <- survey_model_complete[train_idx, ]
|
||||
survey_test <- survey_model_complete[-train_idx, ]
|
||||
|
||||
positive_rate <- mean(survey_train$frequent_so, na.rm = TRUE)
|
||||
classification_threshold <- dplyr::case_when(
|
||||
is.na(positive_rate) ~ 0.5,
|
||||
positive_rate <= 0 ~ 0.5,
|
||||
positive_rate >= 1 ~ 0.5,
|
||||
TRUE ~ positive_rate
|
||||
)
|
||||
|
||||
message(
|
||||
"classification threshold (training frequent_so share): ",
|
||||
round(classification_threshold, 3)
|
||||
)
|
||||
|
||||
logit_model <- glm(
|
||||
formula = logit_formula,
|
||||
family = binomial(link = "logit"),
|
||||
data = survey_train
|
||||
)
|
||||
|
||||
summary(logit_model)
|
||||
tidy(logit_model, exponentiate = TRUE, conf.int = TRUE)
|
||||
|
||||
# predict on test set
|
||||
|
||||
survey_test <- survey_test |>
|
||||
mutate(
|
||||
pred_prob = predict(logit_model, newdata = survey_test, type = "response"),
|
||||
pred_class = if_else(pred_prob >= classification_threshold, 1L, 0L)
|
||||
)
|
||||
|
||||
# confusion matrix and simple metrics
|
||||
|
||||
conf_mat <- table(
|
||||
truth = factor(survey_test$frequent_so, levels = c(0, 1)),
|
||||
pred = factor(survey_test$pred_class, levels = c(0, 1))
|
||||
)
|
||||
|
||||
conf_mat
|
||||
|
||||
tp <- conf_mat["1", "1"]
|
||||
tn <- conf_mat["0", "0"]
|
||||
fp <- conf_mat["0", "1"]
|
||||
fn <- conf_mat["1", "0"]
|
||||
|
||||
accuracy <- (tp + tn) / sum(conf_mat)
|
||||
precision <- if ((tp + fp) > 0) tp / (tp + fp) else NA_real_
|
||||
recall <- if ((tp + fn) > 0) tp / (tp + fn) else NA_real_
|
||||
|
||||
list(
|
||||
accuracy = accuracy,
|
||||
precision = precision,
|
||||
recall = recall
|
||||
)
|
||||
|
||||
# visual: predicted probability vs ai usage
|
||||
|
||||
p_logit_probs <- survey_test |>
|
||||
mutate(uses_chatgpt_label = if_else(uses_chatgpt == 1L, "uses chatgpt", "does not use chatgpt")) |>
|
||||
ggplot(aes(x = uses_chatgpt_label, y = pred_prob)) +
|
||||
geom_boxplot() +
|
||||
labs(
|
||||
title = "predicted probability of being a frequent so visitor by chatgpt use",
|
||||
x = "ai usage segment",
|
||||
y = "predicted probability (logistic model)"
|
||||
)
|
||||
|
||||
print(p_logit_probs)
|
||||
ggsave(file.path(imgs_dir, "09_logit_probs.png"), plot = p_logit_probs, width = 8, height = 6, units = "in", dpi = 300)
|
||||
|
||||
# save key tables and model outputs to disk for report
|
||||
|
||||
write_csv(answers_monthly, file.path(data_dir, "answers_monthly_clean.csv"))
|
||||
write_csv(answers_summary_period, file.path(data_dir, "answers_summary_period.csv"))
|
||||
write_csv(survey_counts, file.path(data_dir, "survey_ai_vs_so_visit.csv"))
|
||||
|
||||
saveRDS(model_lm, file.path(data_dir, "model_lm_its.rds"))
|
||||
saveRDS(model_pois, file.path(data_dir, "model_pois.rds"))
|
||||
saveRDS(arima_fit, file.path(data_dir, "model_arima_prechatgpt.rds"))
|
||||
saveRDS(logit_model, file.path(data_dir, "model_logit_survey.rds"))
|
||||
|
After Width: | Height: | Size: 176 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 327 KiB |
|
After Width: | Height: | Size: 217 KiB |
|
After Width: | Height: | Size: 189 KiB |
|
After Width: | Height: | Size: 184 KiB |
|
After Width: | Height: | Size: 135 KiB |
|
After Width: | Height: | Size: 91 KiB |
|
After Width: | Height: | Size: 74 KiB |
@@ -0,0 +1,245 @@
|
||||
[Running] Rscript "/home/ion606/Desktop/Homework/Data Analytics/Assignment IV/analysis.r"
|
||||
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
|
||||
✔ dplyr 1.1.4 ✔ readr 2.1.5
|
||||
✔ forcats 1.0.1 ✔ stringr 1.6.0
|
||||
✔ ggplot2 4.0.0 ✔ tibble 3.3.0
|
||||
✔ lubridate 1.9.4 ✔ tidyr 1.3.1
|
||||
✔ purrr 1.1.0
|
||||
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
|
||||
✖ dplyr::filter() masks stats::filter()
|
||||
✖ dplyr::lag() masks stats::lag()
|
||||
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
|
||||
Registered S3 method overwritten by 'quantmod':
|
||||
method from
|
||||
as.zoo.data.frame zoo
|
||||
[1] "month" "status" "new_answers"
|
||||
# A tibble: 6 × 3
|
||||
month status new_answers
|
||||
<date> <chr> <dbl>
|
||||
1 2018-01-01 deleted 26
|
||||
2 2018-01-01 non-deleted 159
|
||||
3 2018-02-01 deleted 20
|
||||
4 2018-02-01 non-deleted 175
|
||||
5 2018-03-01 deleted 18
|
||||
6 2018-03-01 non-deleted 193
|
||||
Rows: 95
|
||||
Columns: 11
|
||||
$ month <date> 2018-01-01, 2018-02-01, 2018-03-01, 2018-04-01, 2…
|
||||
$ answers_total <dbl> 185, 195, 211, 221, 227, 189, 149, 179, 198, 232, …
|
||||
$ answers_non_deleted <dbl> 159, 175, 193, 191, 203, 172, 133, 154, 170, 198, …
|
||||
$ answers_deleted <dbl> 26, 20, 18, 30, 24, 17, 16, 25, 28, 34, 20, 45, 33…
|
||||
$ year <dbl> 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 20…
|
||||
$ month_num <dbl> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4,…
|
||||
$ time_index <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,…
|
||||
$ post_chatgpt <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, F…
|
||||
$ post_ai_policy <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, F…
|
||||
$ during_mod_strike <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, F…
|
||||
$ period <chr> "pre_chatgpt", "pre_chatgpt", "pre_chatgpt", "pre_…
|
||||
file already exists: data/stack-overflow-developer-survey-2023.zip
|
||||
file already exists: data/stack-overflow-developer-survey-2024.zip
|
||||
[1] "ResponseId" "Q120"
|
||||
[3] "MainBranch" "Age"
|
||||
[5] "Employment" "RemoteWork"
|
||||
[7] "CodingActivities" "EdLevel"
|
||||
[9] "LearnCode" "LearnCodeOnline"
|
||||
[11] "LearnCodeCoursesCert" "YearsCode"
|
||||
[13] "YearsCodePro" "DevType"
|
||||
[15] "OrgSize" "PurchaseInfluence"
|
||||
[17] "TechList" "BuyNewTool"
|
||||
[19] "Country" "Currency"
|
||||
[21] "CompTotal" "LanguageHaveWorkedWith"
|
||||
[23] "LanguageWantToWorkWith" "DatabaseHaveWorkedWith"
|
||||
[25] "DatabaseWantToWorkWith" "PlatformHaveWorkedWith"
|
||||
[27] "PlatformWantToWorkWith" "WebframeHaveWorkedWith"
|
||||
[29] "WebframeWantToWorkWith" "MiscTechHaveWorkedWith"
|
||||
[31] "MiscTechWantToWorkWith" "ToolsTechHaveWorkedWith"
|
||||
[33] "ToolsTechWantToWorkWith" "NEWCollabToolsHaveWorkedWith"
|
||||
[35] "NEWCollabToolsWantToWorkWith" "OpSysPersonal use"
|
||||
[37] "OpSysProfessional use" "OfficeStackAsyncHaveWorkedWith"
|
||||
[39] "OfficeStackAsyncWantToWorkWith" "OfficeStackSyncHaveWorkedWith"
|
||||
[41] "OfficeStackSyncWantToWorkWith" "AISearchHaveWorkedWith"
|
||||
[43] "AISearchWantToWorkWith" "AIDevHaveWorkedWith"
|
||||
[45] "AIDevWantToWorkWith" "NEWSOSites"
|
||||
[47] "SOVisitFreq" "SOAccount"
|
||||
[49] "SOPartFreq" "SOComm"
|
||||
[51] "SOAI" "AISelect"
|
||||
[53] "AISent" "AIAcc"
|
||||
[55] "AIBen" "AIToolInterested in Using"
|
||||
[57] "AIToolCurrently Using" "AIToolNot interested in Using"
|
||||
[59] "AINextVery different" "AINextNeither different nor similar"
|
||||
[61] "AINextSomewhat similar" "AINextVery similar"
|
||||
[63] "AINextSomewhat different" "TBranch"
|
||||
[65] "ICorPM" "WorkExp"
|
||||
[67] "Knowledge_1" "Knowledge_2"
|
||||
[69] "Knowledge_3" "Knowledge_4"
|
||||
[71] "Knowledge_5" "Knowledge_6"
|
||||
[73] "Knowledge_7" "Knowledge_8"
|
||||
[75] "Frequency_1" "Frequency_2"
|
||||
[77] "Frequency_3" "TimeSearching"
|
||||
[79] "TimeAnswering" "ProfessionalTech"
|
||||
2023 so visit col: SOVisitFreq
|
||||
2023 ai col : SOAI
|
||||
2024 so visit col: SOVisitFreq
|
||||
2024 ai col : AISelect
|
||||
Rows: 146,676
|
||||
Columns: 10
|
||||
$ year <fct> 2023, 2023, 2023, 2023, 2023, 2023, 2023, 2023, 2023, 202…
|
||||
$ main_branch <chr> "I am a developer by profession", "I am a developer by pr…
|
||||
$ country <chr> "United States of America", "United States of America", "…
|
||||
$ age <dbl> 25, 45, 25, 25, 35, 35, 25, 45, 25, 25, 25, 25, 35, 25, 3…
|
||||
$ gender <fct> Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unk…
|
||||
$ so_visit <chr> "Daily or almost daily", "A few times per month or weekly…
|
||||
$ ai_select <chr> "I don't think it's super necessary, but I think improvin…
|
||||
$ frequent_so <int> 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, …
|
||||
$ uses_chatgpt <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, …
|
||||
$ age_group <fct> 25-34, 45+, 25-34, 25-34, 35-44, 35-44, 25-34, 45+, 25-34…
|
||||
# A tibble: 2 × 7
|
||||
period n_months mean_answers median_answers sd_answers min_answers max_answers
|
||||
<chr> <int> <dbl> <dbl> <dbl> <dbl> <dbl>
|
||||
1 post_… 36 90.5 88 38.0 11 157
|
||||
2 pre_c… 59 193. 185 44.7 122 313
|
||||
Warning message:
|
||||
Removed 2 rows containing missing values or values outside the scale range
|
||||
(`geom_line()`).
|
||||
Warning message:
|
||||
Removed 2 rows containing missing values or values outside the scale range
|
||||
(`geom_line()`).
|
||||
[1] -10.02227
|
||||
|
||||
Call:
|
||||
lm(formula = answers_total ~ time + post_chatgpt + chatgpt_time,
|
||||
data = its_data)
|
||||
|
||||
Residuals:
|
||||
Min 1Q Median 3Q Max
|
||||
-76.623 -22.914 -3.868 13.431 123.402
|
||||
|
||||
Coefficients:
|
||||
Estimate Std. Error t value Pr(>|t|)
|
||||
(Intercept) 218.8013 9.3214 23.473 < 2e-16 ***
|
||||
time -0.8589 0.2702 -3.179 0.002022 **
|
||||
post_chatgptTRUE -17.9635 15.0779 -1.191 0.236601
|
||||
chatgpt_time -2.3661 0.6282 -3.767 0.000293 ***
|
||||
---
|
||||
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
|
||||
|
||||
Residual standard error: 35.35 on 91 degrees of freedom
|
||||
Multiple R-squared: 0.717, Adjusted R-squared: 0.7077
|
||||
F-statistic: 76.86 on 3 and 91 DF, p-value: < 2.2e-16
|
||||
|
||||
# A tibble: 4 × 5
|
||||
term estimate std.error statistic p.value
|
||||
<chr> <dbl> <dbl> <dbl> <dbl>
|
||||
1 (Intercept) 219. 9.32 23.5 2.23e-40
|
||||
2 time -0.859 0.270 -3.18 2.02e- 3
|
||||
3 post_chatgptTRUE -18.0 15.1 -1.19 2.37e- 1
|
||||
4 chatgpt_time -2.37 0.628 -3.77 2.93e- 4
|
||||
# A tibble: 1 × 12
|
||||
r.squared adj.r.squared sigma statistic p.value df logLik AIC BIC
|
||||
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
|
||||
1 0.717 0.708 35.3 76.9 7.39e-25 3 -471. 953. 966.
|
||||
# ℹ 3 more variables: deviance <dbl>, df.residual <int>, nobs <int>
|
||||
|
||||
Call:
|
||||
glm(formula = answers_total ~ time + post_chatgpt + chatgpt_time,
|
||||
family = poisson(link = "log"), data = its_data)
|
||||
|
||||
Coefficients:
|
||||
Estimate Std. Error z value Pr(>|z|)
|
||||
(Intercept) 5.3936301 0.0183909 293.277 < 2e-16 ***
|
||||
time -0.0044547 0.0005512 -8.082 6.38e-16 ***
|
||||
post_chatgptTRUE -0.0187737 0.0365851 -0.513 0.608
|
||||
chatgpt_time -0.0322028 0.0018440 -17.464 < 2e-16 ***
|
||||
---
|
||||
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
|
||||
|
||||
(Dispersion parameter for poisson family taken to be 1)
|
||||
|
||||
Null deviance: 2879.9 on 94 degrees of freedom
|
||||
Residual deviance: 713.8 on 91 degrees of freedom
|
||||
AIC: 1363
|
||||
|
||||
Number of Fisher Scoring iterations: 4
|
||||
|
||||
# A tibble: 4 × 5
|
||||
term estimate std.error statistic p.value
|
||||
<chr> <dbl> <dbl> <dbl> <dbl>
|
||||
1 (Intercept) 220. 0.0184 293. 0
|
||||
2 time 0.996 0.000551 -8.08 6.38e-16
|
||||
3 post_chatgptTRUE 0.981 0.0366 -0.513 6.08e- 1
|
||||
4 chatgpt_time 0.968 0.00184 -17.5 2.71e-68
|
||||
Series: train_ts
|
||||
ARIMA(1,1,0)(1,0,0)[12]
|
||||
|
||||
Coefficients:
|
||||
ar1 sar1
|
||||
-0.3956 0.3016
|
||||
s.e. 0.1360 0.1381
|
||||
|
||||
sigma^2 = 1142: log likelihood = -281.17
|
||||
AIC=568.34 AICc=568.8 BIC=574.47
|
||||
|
||||
Training set error measures:
|
||||
ME RMSE MAE MPE MAPE MASE
|
||||
Training set -0.1691686 32.90678 26.65938 -1.989033 14.30025 0.5170032
|
||||
ACF1
|
||||
Training set 0.03124461
|
||||
ME RMSE MAE MPE MAPE MASE
|
||||
Training set -0.1691686 32.90678 26.65938 -1.989033 14.30025 0.5170032
|
||||
Test set -78.4100374 89.26691 79.26493 -171.518981 171.98870 1.5371782
|
||||
ACF1 Theil's U
|
||||
Training set 0.03124461 NA
|
||||
Test set 0.73383075 7.11443
|
||||
dropping predictors with <2 levels: gender
|
||||
classification threshold (training frequent_so share): 0.384
|
||||
|
||||
Call:
|
||||
glm(formula = logit_formula, family = binomial(link = "logit"),
|
||||
data = survey_train)
|
||||
|
||||
Coefficients:
|
||||
Estimate Std. Error z value Pr(>|z|)
|
||||
(Intercept) -0.358743 0.013009 -27.577 < 2e-16 ***
|
||||
uses_chatgpt -0.006783 0.066977 -0.101 0.91933
|
||||
age_group25-34 0.040677 0.015439 2.635 0.00842 **
|
||||
age_group35-44 -0.207571 0.017478 -11.876 < 2e-16 ***
|
||||
age_group45+ -0.345739 0.020289 -17.041 < 2e-16 ***
|
||||
age_groupunknown -0.222739 0.096177 -2.316 0.02056 *
|
||||
year2024 -0.082452 0.012319 -6.693 2.18e-11 ***
|
||||
---
|
||||
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
|
||||
|
||||
(Dispersion parameter for binomial family taken to be 1)
|
||||
|
||||
Null deviance: 156271 on 117339 degrees of freedom
|
||||
Residual deviance: 155647 on 117333 degrees of freedom
|
||||
AIC: 155661
|
||||
|
||||
Number of Fisher Scoring iterations: 4
|
||||
|
||||
# A tibble: 7 × 7
|
||||
term estimate std.error statistic p.value conf.low conf.high
|
||||
<chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
|
||||
1 (Intercept) 0.699 0.0130 -27.6 2.10e-167 0.681 0.717
|
||||
2 uses_chatgpt 0.993 0.0670 -0.101 9.19e- 1 0.870 1.13
|
||||
3 age_group25-34 1.04 0.0154 2.63 8.42e- 3 1.01 1.07
|
||||
4 age_group35-44 0.813 0.0175 -11.9 1.57e- 32 0.785 0.841
|
||||
5 age_group45+ 0.708 0.0203 -17.0 4.09e- 65 0.680 0.736
|
||||
6 age_groupunknown 0.800 0.0962 -2.32 2.06e- 2 0.662 0.965
|
||||
7 year2024 0.921 0.0123 -6.69 2.18e- 11 0.899 0.943
|
||||
pred
|
||||
truth 0 1
|
||||
0 7560 10549
|
||||
1 4009 7218
|
||||
$accuracy
|
||||
[1] 0.5037497
|
||||
|
||||
$precision
|
||||
[1] 0.4062588
|
||||
|
||||
$recall
|
||||
[1] 0.6429144
|
||||
|
||||
|
||||
[Done] exited with code=0 in 12.272 seconds
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
6. Oral Presentation (5%). Plan for a ~5 minute presentation; slides must cover the
|
||||
following:
|
||||
a). Title (with your name)
|
||||
b). Problem area – what you wanted to explore/ solve/ predict and why, and what you
|
||||
wanted to predict?
|
||||
c). The data – where it came from, why it was applicable and the preliminary assessments
|
||||
you made.
|
||||
d). How you conducted your analysis: distribution, pattern/ relationship and model
|
||||
construction. What techniques did you use/ not use and why? What worked? What did not
|
||||
work? How did you apply the model? How did you optimize, account for uncertainties?
|
||||
f). What did you predict and what decisions (prescriptions) were possible. What was the
|
||||
outcome, conclusions?
|
||||
@@ -0,0 +1,41 @@
|
||||
##########################################
|
||||
### Principal Component Analysis (PCA) ###
|
||||
##########################################
|
||||
|
||||
## load libraries
|
||||
library(ggplot2)
|
||||
library(ggfortify)
|
||||
library(GGally)
|
||||
library(e1071)
|
||||
library(class)
|
||||
library(psych)
|
||||
library(readr)
|
||||
|
||||
## set working directory so that files can be referenced without the full path
|
||||
setwd("/home/ion606/Desktop/Data Analytics/Lab 4")
|
||||
|
||||
## read dataset
|
||||
wine <- read_csv("wine.data", col_names = FALSE)
|
||||
|
||||
## set column names
|
||||
names(wine) <- c("Type","Alcohol","Malic acid","Ash","Alcalinity of ash","Magnesium","Total phenols","Flavanoids","Nonflavanoid Phenols","Proanthocyanins","Color Intensity","Hue","Od280/od315 of diluted wines","Proline")
|
||||
|
||||
## inspect data frame
|
||||
head(wine)
|
||||
|
||||
## change the data type of the "Type" column from character to factor
|
||||
####
|
||||
# Factors look like regular strings (characters) but with factors R knows
|
||||
# that the column is a categorical variable with finite possible values
|
||||
# e.g. "Type" in the Wine dataset can only be 1, 2, or 3
|
||||
####
|
||||
|
||||
wine$Type <- as.factor(wine$Type)
|
||||
|
||||
|
||||
## visualize variables
|
||||
pairs.panels(wine[,-1],gap = 0,bg = c("red", "yellow", "blue")[wine$Type],pch=21)
|
||||
|
||||
ggpairs(wine, ggplot2::aes(colour = Type))
|
||||
|
||||
###
|
||||
@@ -0,0 +1,366 @@
|
||||
has_pkg <- function(pkg) requireNamespace(pkg, quietly = TRUE)
|
||||
|
||||
has_ggplot2 <- has_pkg("ggplot2")
|
||||
has_GGally <- has_pkg("GGally")
|
||||
has_e1071 <- has_pkg("e1071")
|
||||
has_class <- has_pkg("class")
|
||||
has_psych <- has_pkg("psych")
|
||||
has_readr <- has_pkg("readr")
|
||||
|
||||
# WHY IS THIS HERE YOU MIGHT ASK???? WELL LET ME TELL YOU I SPENT TWO HOURS ON STUPID PACKAGE IMPORTS
|
||||
# OOOOOOHHH PSYCH IS IN A DIFFERENT REPO??? OH IT ISN'T??? I have a fever of 103 I DO NOT CARE
|
||||
if (has_ggplot2) { library(ggplot2) } else { warning("ggplot2 not available; plots will be skipped") }
|
||||
if (has_GGally) { library(GGally) } else { message("GGally not available; skipping ggpairs plot") }
|
||||
if (has_e1071) { library(e1071) }
|
||||
if (has_class) { library(class) } else { stop("class package not available for kNN") }
|
||||
if (!has_psych) { message("psych not available; skipping pairs.panels plot") }
|
||||
if (has_readr) { library(readr) }
|
||||
library(grid) # unit() for arrows in plots
|
||||
suppressWarnings(RNGkind(sample.kind = "Rounding"))
|
||||
|
||||
# set a reproducible seed
|
||||
set.seed(4600)
|
||||
|
||||
# 178 rows
|
||||
# col 1 is class label (1,2,3)
|
||||
# other 13 columns continuous predictors
|
||||
|
||||
possible_paths <- c(
|
||||
"wine.data",
|
||||
"./wine.data",
|
||||
"../wine.data",
|
||||
"DAN/wine.data",
|
||||
"./DAN/wine.data"
|
||||
)
|
||||
data_path <- NA
|
||||
for (p in possible_paths) { if (file.exists(p)) { data_path <- p; break } }
|
||||
if (is.na(data_path)) stop("could not find wine.data; place this script in the DAN folder or given/ and re-run")
|
||||
|
||||
if (has_readr) {
|
||||
wine <- readr::read_csv(
|
||||
file = data_path,
|
||||
col_names = FALSE,
|
||||
show_col_types = FALSE,
|
||||
progress = FALSE
|
||||
)
|
||||
} else {
|
||||
wine <- read.csv(file = data_path, header = FALSE)
|
||||
}
|
||||
|
||||
colnames(wine) <- c(
|
||||
"Type",
|
||||
"Alcohol",
|
||||
"Malic_acid",
|
||||
"Ash",
|
||||
"Alcalinity_of_ash",
|
||||
"Magnesium",
|
||||
"Total_phenols",
|
||||
"Flavanoids",
|
||||
"Nonflavanoid_phenols",
|
||||
"Proanthocyanins",
|
||||
"Color_intensity",
|
||||
"Hue",
|
||||
"OD280_OD315",
|
||||
"Proline"
|
||||
)
|
||||
|
||||
wine$Type <- as.factor(wine$Type)
|
||||
|
||||
# put here from when I accidentally read in the wrong file repeatedly
|
||||
# left because it makes it more, "robust"
|
||||
stopifnot(nrow(wine) == 178, ncol(wine) == 14)
|
||||
print(summary(wine$Type))
|
||||
|
||||
# exploratory plots (because I went down a rabbit hole and by god I'm using it)
|
||||
|
||||
if (has_psych) {
|
||||
# pairs panel (psych) – colors by class
|
||||
psych::pairs.panels(
|
||||
wine[,-1],
|
||||
gap = 0,
|
||||
bg = c("red","gold","royalblue")[wine$Type],
|
||||
pch = 21,
|
||||
main = "wine (uci) – scatterplot matrix by class"
|
||||
)
|
||||
}
|
||||
|
||||
if (has_GGally && has_ggplot2) {
|
||||
# ggpairs for nice matrix <3
|
||||
GGally::ggpairs(wine, ggplot2::aes(colour = Type), columns = 2:ncol(wine))
|
||||
}
|
||||
|
||||
# split into train/test BEFORE!!!!!!!!!!!!!!!!!!!!!! any preprocessing to avoid leakage
|
||||
|
||||
set.seed(4600)
|
||||
n <- nrow(wine)
|
||||
train_idx <- sample.int(n, size = floor(0.7 * n))
|
||||
wine_train <- wine[train_idx, , drop = FALSE]
|
||||
wine_test <- wine[-train_idx, , drop = FALSE]
|
||||
|
||||
X_train <- wine_train[, -1]
|
||||
y_train <- wine_train$Type
|
||||
X_test <- wine_test[, -1]
|
||||
y_test <- wine_test$Type
|
||||
|
||||
# yes
|
||||
if (any(sapply(X_train, function(x) var(x, na.rm = TRUE) == 0))) {
|
||||
warning("one or more predictors have zero variance in the training set; scale() would fail")
|
||||
}
|
||||
if (anyNA(X_train) | anyNA(X_test)) {
|
||||
stop("found NA values in predictors; handle missingness before PCA")
|
||||
}
|
||||
|
||||
# project both train and test using the train-fitted pca
|
||||
pca_tr <- prcomp(X_train, center = TRUE, scale. = TRUE)
|
||||
|
||||
pve_tr <- (pca_tr$sdev^2) / sum(pca_tr$sdev^2)
|
||||
pve_df <- data.frame(
|
||||
PC = paste0("PC", seq_along(pve_tr)),
|
||||
PVE = pve_tr,
|
||||
CumPVE = cumsum(pve_tr)
|
||||
)
|
||||
|
||||
print("variance explained (training pca):")
|
||||
print(pve_df)
|
||||
|
||||
# scree plot from training pca
|
||||
p_scree <- ggplot(pve_df, aes(x = seq_along(PVE), y = PVE)) +
|
||||
geom_line() + geom_point() +
|
||||
scale_x_continuous(breaks = 1:length(pve_df$PC), labels = pve_df$PC) +
|
||||
labs(title = "scree plot – variance explained by principal components (training pca)",
|
||||
x = "principal component", y = "proportion of variance explained") +
|
||||
theme_minimal()
|
||||
|
||||
# cumulative variance plot from training pca
|
||||
p_cumvar <- ggplot(pve_df, aes(x = seq_along(CumPVE), y = CumPVE)) +
|
||||
geom_line() + geom_point() +
|
||||
scale_x_continuous(breaks = 1:length(pve_df$PC), labels = pve_df$PC) +
|
||||
labs(title = "cumulative variance explained (training pca)",
|
||||
x = "principal component", y = "cumulative proportion of variance") +
|
||||
theme_minimal()
|
||||
|
||||
# ========================================================================================================
|
||||
|
||||
# choose number of pcs: default to the smallest k with >= thresh cum variance
|
||||
# you can change thresh to 0.90 or 0.99 if you prefer
|
||||
|
||||
pc_variance_threshold <- 0.95
|
||||
k_pcs <- which(cumsum(pve_tr) >= pc_variance_threshold)[1]
|
||||
if (is.na(k_pcs)) k_pcs <- ncol(X_train) # crashes if fails so...
|
||||
cat("chosen number of pcs (threshold =", pc_variance_threshold, "):", k_pcs, "\n")
|
||||
|
||||
# project train/test into the pca space
|
||||
Z_train_full <- as.data.frame(predict(pca_tr, newdata = X_train))
|
||||
Z_test_full <- as.data.frame(predict(pca_tr, newdata = X_test))
|
||||
|
||||
# for downstream modeling
|
||||
Z_train <- Z_train_full[, seq_len(k_pcs), drop = FALSE]
|
||||
Z_test <- Z_test_full[, seq_len(k_pcs), drop = FALSE]
|
||||
|
||||
scores_all <- as.data.frame(predict(pca_tr, newdata = wine[,-1]))
|
||||
scores_all$Type <- wine$Type
|
||||
|
||||
# loadings from training pca
|
||||
loadings <- as.data.frame(pca_tr$rotation)
|
||||
loadings$Variable <- rownames(loadings)
|
||||
top_pc1 <- loadings[order(abs(loadings$PC1), decreasing = TRUE), c("Variable","PC1")][1:5, ]
|
||||
top_pc2 <- loadings[order(abs(loadings$PC2), decreasing = TRUE), c("Variable","PC2")][1:5, ]
|
||||
print("top contributors to pc1 (training pca):"); print(top_pc1)
|
||||
print("top contributors to pc2 (training pca):"); print(top_pc2)
|
||||
|
||||
|
||||
# function to make convex hull data for each group
|
||||
scores <- scores_all
|
||||
hull_df <- do.call(rbind, lapply(split(scores, scores$Type), function(df) {
|
||||
pts <- df[chull(df$PC1, df$PC2), c("PC1","PC2")]
|
||||
pts$Type <- unique(df$Type)
|
||||
pts
|
||||
}))
|
||||
p_pc12 <- ggplot(scores, aes(PC1, PC2, color = Type)) +
|
||||
geom_point(size = 2, alpha = 0.85) +
|
||||
geom_polygon(data = hull_df, aes(fill = Type, group = Type), color = NA, alpha = 0.15) +
|
||||
guides(fill = "none") +
|
||||
theme_minimal() +
|
||||
labs(title = "pc1 vs pc2 by class (projected with training pca)")
|
||||
|
||||
# arrow arrow arrow arrow arrow arrow arrow arrow arrow
|
||||
loading_scalefactor <- 3 * max(abs(scores$PC1), abs(scores$PC2)) # heuristic
|
||||
load_plot_df <- loadings
|
||||
load_plot_df$PC1s <- load_plot_df$PC1 * loading_scalefactor
|
||||
load_plot_df$PC2s <- load_plot_df$PC2 * loading_scalefactor
|
||||
|
||||
p_biplot <- ggplot(scores, aes(PC1, PC2, color = Type)) +
|
||||
geom_point(size = 2, alpha = 0.85) +
|
||||
geom_segment(
|
||||
data = load_plot_df,
|
||||
mapping = aes(x = 0, y = 0, xend = PC1s, yend = PC2s),
|
||||
inherit.aes = FALSE,
|
||||
arrow = arrow(length = unit(0.02, "npc")),
|
||||
color = "black",
|
||||
alpha = 0.8
|
||||
) +
|
||||
geom_text(
|
||||
data = load_plot_df,
|
||||
mapping = aes(x = PC1s, y = PC2s, label = Variable),
|
||||
inherit.aes = FALSE,
|
||||
hjust = 0,
|
||||
vjust = 0
|
||||
) +
|
||||
theme_minimal() +
|
||||
labs(title = "pc1 vs pc2 with variable loadings (training pca projection)")
|
||||
|
||||
# 1) kNN on original variables with standardization
|
||||
# 2) kNN on first 2 principal components only
|
||||
|
||||
# helper to create metrics from a confusion matrix (rows=true, cols=pred)
|
||||
compute_metrics <- function(cm) {
|
||||
lv <- rownames(cm)
|
||||
if (is.null(lv)) lv <- as.character(1:nrow(cm))
|
||||
TP <- diag(cm)
|
||||
FP <- colSums(cm) - TP
|
||||
FN <- rowSums(cm) - TP
|
||||
precision <- TP / (TP + FP)
|
||||
recall <- TP / (TP + FN)
|
||||
f1 <- 2 * precision * recall / (precision + recall)
|
||||
acc <- sum(TP) / sum(cm)
|
||||
macro_precision <- mean(precision, na.rm = TRUE)
|
||||
macro_recall <- mean(recall, na.rm = TRUE)
|
||||
macro_f1 <- mean(f1, na.rm = TRUE)
|
||||
per_class <- data.frame(
|
||||
class = lv,
|
||||
precision = precision,
|
||||
recall = recall,
|
||||
f1 = f1,
|
||||
row.names = NULL
|
||||
)
|
||||
summary <- data.frame(
|
||||
accuracy = acc,
|
||||
macro_precision = macro_precision,
|
||||
macro_recall = macro_recall,
|
||||
macro_f1 = macro_f1
|
||||
)
|
||||
list(per_class = per_class, summary = summary)
|
||||
}
|
||||
|
||||
set.seed(4600)
|
||||
ks <- seq(1, 15, by = 2)
|
||||
Kfolds <- 5
|
||||
|
||||
# kNN on original vars
|
||||
X_train_scaled <- scale(X_train, center = TRUE, scale = TRUE)
|
||||
scale_center <- attr(X_train_scaled, "scaled:center")
|
||||
scale_scale <- attr(X_train_scaled, "scaled:scale")
|
||||
X_test_scaled <- scale(X_test, center = scale_center, scale = scale_scale)
|
||||
|
||||
n_train_orig <- nrow(X_train_scaled)
|
||||
folds_orig <- sample(rep(1:Kfolds, length.out = n_train_orig))
|
||||
cv_acc_orig <- sapply(ks, function(k) {
|
||||
mean(sapply(1:Kfolds, function(f) {
|
||||
tr <- which(folds_orig != f)
|
||||
va <- which(folds_orig == f)
|
||||
pred_cv <- knn(train = X_train_scaled[tr, , drop = FALSE],
|
||||
test = X_train_scaled[va, , drop = FALSE],
|
||||
cl = y_train[tr], k = k)
|
||||
mean(pred_cv == y_train[va])
|
||||
}))
|
||||
})
|
||||
|
||||
best_k_orig <- ks[which.max(cv_acc_orig)]
|
||||
cat("[Original vars] best k:", best_k_orig, "cv acc:", max(cv_acc_orig), "\n")
|
||||
|
||||
pred_orig <- knn(train = X_train_scaled, test = X_test_scaled, cl = y_train, k = best_k_orig)
|
||||
acc_orig <- mean(pred_orig == y_test)
|
||||
cm_orig <- table(truth = y_test, pred = pred_orig)
|
||||
|
||||
cat("[Original vars] held-out accuracy:", round(acc_orig, 4), "\n")
|
||||
print(cm_orig)
|
||||
|
||||
metrics_orig <- compute_metrics(cm_orig)
|
||||
print(metrics_orig$summary)
|
||||
print(metrics_orig$per_class)
|
||||
|
||||
# kNN on first 2 PCs only
|
||||
Z2_train <- Z_train_full[, 1:2, drop = FALSE]
|
||||
Z2_test <- Z_test_full[, 1:2, drop = FALSE]
|
||||
n_train_2pc <- nrow(Z2_train)
|
||||
|
||||
folds_2pc <- sample(rep(1:Kfolds, length.out = n_train_2pc))
|
||||
cv_acc_2pc <- sapply(ks, function(k) {
|
||||
mean(sapply(1:Kfolds, function(f) {
|
||||
tr <- which(folds_2pc != f)
|
||||
va <- which(folds_2pc == f)
|
||||
pred_cv <- knn(train = Z2_train[tr, , drop = FALSE],
|
||||
test = Z2_train[va, , drop = FALSE],
|
||||
cl = y_train[tr], k = k)
|
||||
mean(pred_cv == y_train[va])
|
||||
}))
|
||||
})
|
||||
|
||||
best_k_2pc <- ks[which.max(cv_acc_2pc)]
|
||||
cat("[First 2 PCs] best k:", best_k_2pc, "cv acc:", max(cv_acc_2pc), "\n")
|
||||
|
||||
pred_2pc <- knn(train = Z2_train, test = Z2_test, cl = y_train, k = best_k_2pc)
|
||||
acc_2pc <- mean(pred_2pc == y_test)
|
||||
cm_2pc <- table(truth = y_test, pred = pred_2pc)
|
||||
|
||||
cat("[First 2 PCs] held-out accuracy:", round(acc_2pc, 4), "\n")
|
||||
print(cm_2pc)
|
||||
|
||||
metrics_2pc <- compute_metrics(cm_2pc)
|
||||
print(metrics_2pc$summary)
|
||||
print(metrics_2pc$per_class)
|
||||
|
||||
# ===========================================================================================
|
||||
outputs_dir <- "outputs"
|
||||
if (!dir.exists(outputs_dir)) dir.create(outputs_dir, recursive = TRUE, showWarnings = FALSE)
|
||||
|
||||
# plots
|
||||
if (exists("p_pc12") && inherits(p_pc12, "ggplot")) ggsave(filename = file.path(outputs_dir, "pc12_scatter.png"), plot = p_pc12, width = 8, height = 6, dpi = 300)
|
||||
if (exists("p_biplot") && inherits(p_biplot, "ggplot")) ggsave(filename = file.path(outputs_dir, "pc12_biplot.png"), plot = p_biplot, width = 8, height = 6, dpi = 300)
|
||||
if (exists("p_scree") && inherits(p_scree, "ggplot")) ggsave(filename = file.path(outputs_dir, "pca_scree.png"), plot = p_scree, width = 8, height = 6, dpi = 300)
|
||||
if (exists("p_cumvar") && inherits(p_cumvar, "ggplot")) ggsave(filename = file.path(outputs_dir, "pca_cumvar.png"), plot = p_cumvar, width = 8, height = 6, dpi = 300)
|
||||
|
||||
# top contributors/vars to PC1 and PC2
|
||||
write.csv(top_pc1, file = file.path(outputs_dir, "top_contributors_pc1.csv"), row.names = FALSE)
|
||||
write.csv(top_pc2, file = file.path(outputs_dir, "top_contributors_pc2.csv"), row.names = FALSE)
|
||||
|
||||
# confusion matrices as wide CSV and pretty text
|
||||
write.csv(as.matrix(cm_orig), file = file.path(outputs_dir, "confusion_original_wide.csv"))
|
||||
writeLines(capture.output(cm_orig), con = file.path(outputs_dir, "confusion_original.txt"))
|
||||
|
||||
write.csv(as.matrix(cm_2pc), file = file.path(outputs_dir, "confusion_2pc_wide.csv"))
|
||||
writeLines(capture.output(cm_2pc), con = file.path(outputs_dir, "confusion_2pc.txt"))
|
||||
|
||||
# metrics
|
||||
write.csv(metrics_orig$per_class, file = file.path(outputs_dir, "metrics_original_per_class.csv"), row.names = FALSE)
|
||||
write.csv(metrics_orig$summary, file = file.path(outputs_dir, "metrics_original_summary.csv"), row.names = FALSE)
|
||||
write.csv(metrics_2pc$per_class, file = file.path(outputs_dir, "metrics_2pc_per_class.csv"), row.names = FALSE)
|
||||
write.csv(metrics_2pc$summary, file = file.path(outputs_dir, "metrics_2pc_summary.csv"), row.names = FALSE)
|
||||
|
||||
# summary
|
||||
metrics_compare <- data.frame(
|
||||
model = c("original_variables", "first_2_pcs"),
|
||||
accuracy = c(metrics_orig$summary$accuracy, metrics_2pc$summary$accuracy),
|
||||
macro_precision = c(metrics_orig$summary$macro_precision, metrics_2pc$summary$macro_precision),
|
||||
macro_recall = c(metrics_orig$summary$macro_recall, metrics_2pc$summary$macro_recall),
|
||||
macro_f1 = c(metrics_orig$summary$macro_f1, metrics_2pc$summary$macro_f1)
|
||||
)
|
||||
write.csv(metrics_compare, file = file.path(outputs_dir, "metrics_comparison.csv"), row.names = FALSE)
|
||||
|
||||
# The below was made with help from ChatGPT because the psych package is confusing
|
||||
if (!interactive() && has_ggplot2) {
|
||||
pdf("Rplots_pca_fixed.pdf", width = 8, height = 6)
|
||||
if (has_psych) {
|
||||
psych::pairs.panels(
|
||||
wine[,-1],
|
||||
gap = 0,
|
||||
bg = c("red","gold","royalblue")[wine$Type],
|
||||
pch = 21,
|
||||
main = "wine (uci) – scatterplot matrix by class"
|
||||
)
|
||||
}
|
||||
|
||||
if (exists("p_scree") && inherits(p_scree, "ggplot")) print(p_scree)
|
||||
if (exists("p_pc12") && inherits(p_pc12, "ggplot")) print(p_pc12)
|
||||
dev.off()
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
pred
|
||||
truth 1 2 3
|
||||
1 15 2 0
|
||||
2 1 19 1
|
||||
3 0 1 15
|
||||
@@ -0,0 +1,4 @@
|
||||
"","1","2","3"
|
||||
"1",15,2,0
|
||||
"2",1,19,1
|
||||
"3",0,1,15
|
||||
|
@@ -0,0 +1,5 @@
|
||||
pred
|
||||
truth 1 2 3
|
||||
1 17 0 0
|
||||
2 1 18 2
|
||||
3 0 0 16
|
||||
@@ -0,0 +1,4 @@
|
||||
"","1","2","3"
|
||||
"1",17,0,0
|
||||
"2",1,18,2
|
||||
"3",0,0,16
|
||||
|
@@ -0,0 +1,4 @@
|
||||
"class","precision","recall","f1"
|
||||
"1",0.9375,0.882352941176471,0.909090909090909
|
||||
"2",0.863636363636364,0.904761904761905,0.883720930232558
|
||||
"3",0.9375,0.9375,0.9375
|
||||
|
@@ -0,0 +1,2 @@
|
||||
"accuracy","macro_precision","macro_recall","macro_f1"
|
||||
0.907407407407407,0.912878787878788,0.908204948646125,0.910103946441156
|
||||
|
@@ -0,0 +1,3 @@
|
||||
"model","accuracy","macro_precision","macro_recall","macro_f1"
|
||||
"original_variables",0.944444444444444,0.944444444444444,0.952380952380952,0.94522732169791
|
||||
"first_2_pcs",0.907407407407407,0.912878787878788,0.908204948646125,0.910103946441156
|
||||
|
@@ -0,0 +1,4 @@
|
||||
"class","precision","recall","f1"
|
||||
"1",0.944444444444444,1,0.971428571428571
|
||||
"2",1,0.857142857142857,0.923076923076923
|
||||
"3",0.888888888888889,1,0.941176470588235
|
||||
|
@@ -0,0 +1,2 @@
|
||||
"accuracy","macro_precision","macro_recall","macro_f1"
|
||||
0.944444444444444,0.944444444444444,0.952380952380952,0.94522732169791
|
||||
|
|
After Width: | Height: | Size: 344 KiB |
|
After Width: | Height: | Size: 227 KiB |
|
After Width: | Height: | Size: 101 KiB |
|
After Width: | Height: | Size: 105 KiB |
@@ -0,0 +1,6 @@
|
||||
"Variable","PC1"
|
||||
"Flavanoids",0.430570697054093
|
||||
"Total_phenols",0.388556731445086
|
||||
"OD280_OD315",0.379238757892512
|
||||
"Proanthocyanins",0.318149910146199
|
||||
"Nonflavanoid_phenols",-0.292569052362651
|
||||
|
@@ -0,0 +1,6 @@
|
||||
"Variable","PC2"
|
||||
"Color_intensity",-0.504116493512561
|
||||
"Alcohol",-0.480328824227057
|
||||
"Ash",-0.369020648548877
|
||||
"Proline",-0.3555672525193
|
||||
"Hue",0.300324646690879
|
||||
|
@@ -0,0 +1,178 @@
|
||||
1,14.23,1.71,2.43,15.6,127,2.8,3.06,.28,2.29,5.64,1.04,3.92,1065
|
||||
1,13.2,1.78,2.14,11.2,100,2.65,2.76,.26,1.28,4.38,1.05,3.4,1050
|
||||
1,13.16,2.36,2.67,18.6,101,2.8,3.24,.3,2.81,5.68,1.03,3.17,1185
|
||||
1,14.37,1.95,2.5,16.8,113,3.85,3.49,.24,2.18,7.8,.86,3.45,1480
|
||||
1,13.24,2.59,2.87,21,118,2.8,2.69,.39,1.82,4.32,1.04,2.93,735
|
||||
1,14.2,1.76,2.45,15.2,112,3.27,3.39,.34,1.97,6.75,1.05,2.85,1450
|
||||
1,14.39,1.87,2.45,14.6,96,2.5,2.52,.3,1.98,5.25,1.02,3.58,1290
|
||||
1,14.06,2.15,2.61,17.6,121,2.6,2.51,.31,1.25,5.05,1.06,3.58,1295
|
||||
1,14.83,1.64,2.17,14,97,2.8,2.98,.29,1.98,5.2,1.08,2.85,1045
|
||||
1,13.86,1.35,2.27,16,98,2.98,3.15,.22,1.85,7.22,1.01,3.55,1045
|
||||
1,14.1,2.16,2.3,18,105,2.95,3.32,.22,2.38,5.75,1.25,3.17,1510
|
||||
1,14.12,1.48,2.32,16.8,95,2.2,2.43,.26,1.57,5,1.17,2.82,1280
|
||||
1,13.75,1.73,2.41,16,89,2.6,2.76,.29,1.81,5.6,1.15,2.9,1320
|
||||
1,14.75,1.73,2.39,11.4,91,3.1,3.69,.43,2.81,5.4,1.25,2.73,1150
|
||||
1,14.38,1.87,2.38,12,102,3.3,3.64,.29,2.96,7.5,1.2,3,1547
|
||||
1,13.63,1.81,2.7,17.2,112,2.85,2.91,.3,1.46,7.3,1.28,2.88,1310
|
||||
1,14.3,1.92,2.72,20,120,2.8,3.14,.33,1.97,6.2,1.07,2.65,1280
|
||||
1,13.83,1.57,2.62,20,115,2.95,3.4,.4,1.72,6.6,1.13,2.57,1130
|
||||
1,14.19,1.59,2.48,16.5,108,3.3,3.93,.32,1.86,8.7,1.23,2.82,1680
|
||||
1,13.64,3.1,2.56,15.2,116,2.7,3.03,.17,1.66,5.1,.96,3.36,845
|
||||
1,14.06,1.63,2.28,16,126,3,3.17,.24,2.1,5.65,1.09,3.71,780
|
||||
1,12.93,3.8,2.65,18.6,102,2.41,2.41,.25,1.98,4.5,1.03,3.52,770
|
||||
1,13.71,1.86,2.36,16.6,101,2.61,2.88,.27,1.69,3.8,1.11,4,1035
|
||||
1,12.85,1.6,2.52,17.8,95,2.48,2.37,.26,1.46,3.93,1.09,3.63,1015
|
||||
1,13.5,1.81,2.61,20,96,2.53,2.61,.28,1.66,3.52,1.12,3.82,845
|
||||
1,13.05,2.05,3.22,25,124,2.63,2.68,.47,1.92,3.58,1.13,3.2,830
|
||||
1,13.39,1.77,2.62,16.1,93,2.85,2.94,.34,1.45,4.8,.92,3.22,1195
|
||||
1,13.3,1.72,2.14,17,94,2.4,2.19,.27,1.35,3.95,1.02,2.77,1285
|
||||
1,13.87,1.9,2.8,19.4,107,2.95,2.97,.37,1.76,4.5,1.25,3.4,915
|
||||
1,14.02,1.68,2.21,16,96,2.65,2.33,.26,1.98,4.7,1.04,3.59,1035
|
||||
1,13.73,1.5,2.7,22.5,101,3,3.25,.29,2.38,5.7,1.19,2.71,1285
|
||||
1,13.58,1.66,2.36,19.1,106,2.86,3.19,.22,1.95,6.9,1.09,2.88,1515
|
||||
1,13.68,1.83,2.36,17.2,104,2.42,2.69,.42,1.97,3.84,1.23,2.87,990
|
||||
1,13.76,1.53,2.7,19.5,132,2.95,2.74,.5,1.35,5.4,1.25,3,1235
|
||||
1,13.51,1.8,2.65,19,110,2.35,2.53,.29,1.54,4.2,1.1,2.87,1095
|
||||
1,13.48,1.81,2.41,20.5,100,2.7,2.98,.26,1.86,5.1,1.04,3.47,920
|
||||
1,13.28,1.64,2.84,15.5,110,2.6,2.68,.34,1.36,4.6,1.09,2.78,880
|
||||
1,13.05,1.65,2.55,18,98,2.45,2.43,.29,1.44,4.25,1.12,2.51,1105
|
||||
1,13.07,1.5,2.1,15.5,98,2.4,2.64,.28,1.37,3.7,1.18,2.69,1020
|
||||
1,14.22,3.99,2.51,13.2,128,3,3.04,.2,2.08,5.1,.89,3.53,760
|
||||
1,13.56,1.71,2.31,16.2,117,3.15,3.29,.34,2.34,6.13,.95,3.38,795
|
||||
1,13.41,3.84,2.12,18.8,90,2.45,2.68,.27,1.48,4.28,.91,3,1035
|
||||
1,13.88,1.89,2.59,15,101,3.25,3.56,.17,1.7,5.43,.88,3.56,1095
|
||||
1,13.24,3.98,2.29,17.5,103,2.64,2.63,.32,1.66,4.36,.82,3,680
|
||||
1,13.05,1.77,2.1,17,107,3,3,.28,2.03,5.04,.88,3.35,885
|
||||
1,14.21,4.04,2.44,18.9,111,2.85,2.65,.3,1.25,5.24,.87,3.33,1080
|
||||
1,14.38,3.59,2.28,16,102,3.25,3.17,.27,2.19,4.9,1.04,3.44,1065
|
||||
1,13.9,1.68,2.12,16,101,3.1,3.39,.21,2.14,6.1,.91,3.33,985
|
||||
1,14.1,2.02,2.4,18.8,103,2.75,2.92,.32,2.38,6.2,1.07,2.75,1060
|
||||
1,13.94,1.73,2.27,17.4,108,2.88,3.54,.32,2.08,8.90,1.12,3.1,1260
|
||||
1,13.05,1.73,2.04,12.4,92,2.72,3.27,.17,2.91,7.2,1.12,2.91,1150
|
||||
1,13.83,1.65,2.6,17.2,94,2.45,2.99,.22,2.29,5.6,1.24,3.37,1265
|
||||
1,13.82,1.75,2.42,14,111,3.88,3.74,.32,1.87,7.05,1.01,3.26,1190
|
||||
1,13.77,1.9,2.68,17.1,115,3,2.79,.39,1.68,6.3,1.13,2.93,1375
|
||||
1,13.74,1.67,2.25,16.4,118,2.6,2.9,.21,1.62,5.85,.92,3.2,1060
|
||||
1,13.56,1.73,2.46,20.5,116,2.96,2.78,.2,2.45,6.25,.98,3.03,1120
|
||||
1,14.22,1.7,2.3,16.3,118,3.2,3,.26,2.03,6.38,.94,3.31,970
|
||||
1,13.29,1.97,2.68,16.8,102,3,3.23,.31,1.66,6,1.07,2.84,1270
|
||||
1,13.72,1.43,2.5,16.7,108,3.4,3.67,.19,2.04,6.8,.89,2.87,1285
|
||||
2,12.37,.94,1.36,10.6,88,1.98,.57,.28,.42,1.95,1.05,1.82,520
|
||||
2,12.33,1.1,2.28,16,101,2.05,1.09,.63,.41,3.27,1.25,1.67,680
|
||||
2,12.64,1.36,2.02,16.8,100,2.02,1.41,.53,.62,5.75,.98,1.59,450
|
||||
2,13.67,1.25,1.92,18,94,2.1,1.79,.32,.73,3.8,1.23,2.46,630
|
||||
2,12.37,1.13,2.16,19,87,3.5,3.1,.19,1.87,4.45,1.22,2.87,420
|
||||
2,12.17,1.45,2.53,19,104,1.89,1.75,.45,1.03,2.95,1.45,2.23,355
|
||||
2,12.37,1.21,2.56,18.1,98,2.42,2.65,.37,2.08,4.6,1.19,2.3,678
|
||||
2,13.11,1.01,1.7,15,78,2.98,3.18,.26,2.28,5.3,1.12,3.18,502
|
||||
2,12.37,1.17,1.92,19.6,78,2.11,2,.27,1.04,4.68,1.12,3.48,510
|
||||
2,13.34,.94,2.36,17,110,2.53,1.3,.55,.42,3.17,1.02,1.93,750
|
||||
2,12.21,1.19,1.75,16.8,151,1.85,1.28,.14,2.5,2.85,1.28,3.07,718
|
||||
2,12.29,1.61,2.21,20.4,103,1.1,1.02,.37,1.46,3.05,.906,1.82,870
|
||||
2,13.86,1.51,2.67,25,86,2.95,2.86,.21,1.87,3.38,1.36,3.16,410
|
||||
2,13.49,1.66,2.24,24,87,1.88,1.84,.27,1.03,3.74,.98,2.78,472
|
||||
2,12.99,1.67,2.6,30,139,3.3,2.89,.21,1.96,3.35,1.31,3.5,985
|
||||
2,11.96,1.09,2.3,21,101,3.38,2.14,.13,1.65,3.21,.99,3.13,886
|
||||
2,11.66,1.88,1.92,16,97,1.61,1.57,.34,1.15,3.8,1.23,2.14,428
|
||||
2,13.03,.9,1.71,16,86,1.95,2.03,.24,1.46,4.6,1.19,2.48,392
|
||||
2,11.84,2.89,2.23,18,112,1.72,1.32,.43,.95,2.65,.96,2.52,500
|
||||
2,12.33,.99,1.95,14.8,136,1.9,1.85,.35,2.76,3.4,1.06,2.31,750
|
||||
2,12.7,3.87,2.4,23,101,2.83,2.55,.43,1.95,2.57,1.19,3.13,463
|
||||
2,12,.92,2,19,86,2.42,2.26,.3,1.43,2.5,1.38,3.12,278
|
||||
2,12.72,1.81,2.2,18.8,86,2.2,2.53,.26,1.77,3.9,1.16,3.14,714
|
||||
2,12.08,1.13,2.51,24,78,2,1.58,.4,1.4,2.2,1.31,2.72,630
|
||||
2,13.05,3.86,2.32,22.5,85,1.65,1.59,.61,1.62,4.8,.84,2.01,515
|
||||
2,11.84,.89,2.58,18,94,2.2,2.21,.22,2.35,3.05,.79,3.08,520
|
||||
2,12.67,.98,2.24,18,99,2.2,1.94,.3,1.46,2.62,1.23,3.16,450
|
||||
2,12.16,1.61,2.31,22.8,90,1.78,1.69,.43,1.56,2.45,1.33,2.26,495
|
||||
2,11.65,1.67,2.62,26,88,1.92,1.61,.4,1.34,2.6,1.36,3.21,562
|
||||
2,11.64,2.06,2.46,21.6,84,1.95,1.69,.48,1.35,2.8,1,2.75,680
|
||||
2,12.08,1.33,2.3,23.6,70,2.2,1.59,.42,1.38,1.74,1.07,3.21,625
|
||||
2,12.08,1.83,2.32,18.5,81,1.6,1.5,.52,1.64,2.4,1.08,2.27,480
|
||||
2,12,1.51,2.42,22,86,1.45,1.25,.5,1.63,3.6,1.05,2.65,450
|
||||
2,12.69,1.53,2.26,20.7,80,1.38,1.46,.58,1.62,3.05,.96,2.06,495
|
||||
2,12.29,2.83,2.22,18,88,2.45,2.25,.25,1.99,2.15,1.15,3.3,290
|
||||
2,11.62,1.99,2.28,18,98,3.02,2.26,.17,1.35,3.25,1.16,2.96,345
|
||||
2,12.47,1.52,2.2,19,162,2.5,2.27,.32,3.28,2.6,1.16,2.63,937
|
||||
2,11.81,2.12,2.74,21.5,134,1.6,.99,.14,1.56,2.5,.95,2.26,625
|
||||
2,12.29,1.41,1.98,16,85,2.55,2.5,.29,1.77,2.9,1.23,2.74,428
|
||||
2,12.37,1.07,2.1,18.5,88,3.52,3.75,.24,1.95,4.5,1.04,2.77,660
|
||||
2,12.29,3.17,2.21,18,88,2.85,2.99,.45,2.81,2.3,1.42,2.83,406
|
||||
2,12.08,2.08,1.7,17.5,97,2.23,2.17,.26,1.4,3.3,1.27,2.96,710
|
||||
2,12.6,1.34,1.9,18.5,88,1.45,1.36,.29,1.35,2.45,1.04,2.77,562
|
||||
2,12.34,2.45,2.46,21,98,2.56,2.11,.34,1.31,2.8,.8,3.38,438
|
||||
2,11.82,1.72,1.88,19.5,86,2.5,1.64,.37,1.42,2.06,.94,2.44,415
|
||||
2,12.51,1.73,1.98,20.5,85,2.2,1.92,.32,1.48,2.94,1.04,3.57,672
|
||||
2,12.42,2.55,2.27,22,90,1.68,1.84,.66,1.42,2.7,.86,3.3,315
|
||||
2,12.25,1.73,2.12,19,80,1.65,2.03,.37,1.63,3.4,1,3.17,510
|
||||
2,12.72,1.75,2.28,22.5,84,1.38,1.76,.48,1.63,3.3,.88,2.42,488
|
||||
2,12.22,1.29,1.94,19,92,2.36,2.04,.39,2.08,2.7,.86,3.02,312
|
||||
2,11.61,1.35,2.7,20,94,2.74,2.92,.29,2.49,2.65,.96,3.26,680
|
||||
2,11.46,3.74,1.82,19.5,107,3.18,2.58,.24,3.58,2.9,.75,2.81,562
|
||||
2,12.52,2.43,2.17,21,88,2.55,2.27,.26,1.22,2,.9,2.78,325
|
||||
2,11.76,2.68,2.92,20,103,1.75,2.03,.6,1.05,3.8,1.23,2.5,607
|
||||
2,11.41,.74,2.5,21,88,2.48,2.01,.42,1.44,3.08,1.1,2.31,434
|
||||
2,12.08,1.39,2.5,22.5,84,2.56,2.29,.43,1.04,2.9,.93,3.19,385
|
||||
2,11.03,1.51,2.2,21.5,85,2.46,2.17,.52,2.01,1.9,1.71,2.87,407
|
||||
2,11.82,1.47,1.99,20.8,86,1.98,1.6,.3,1.53,1.95,.95,3.33,495
|
||||
2,12.42,1.61,2.19,22.5,108,2,2.09,.34,1.61,2.06,1.06,2.96,345
|
||||
2,12.77,3.43,1.98,16,80,1.63,1.25,.43,.83,3.4,.7,2.12,372
|
||||
2,12,3.43,2,19,87,2,1.64,.37,1.87,1.28,.93,3.05,564
|
||||
2,11.45,2.4,2.42,20,96,2.9,2.79,.32,1.83,3.25,.8,3.39,625
|
||||
2,11.56,2.05,3.23,28.5,119,3.18,5.08,.47,1.87,6,.93,3.69,465
|
||||
2,12.42,4.43,2.73,26.5,102,2.2,2.13,.43,1.71,2.08,.92,3.12,365
|
||||
2,13.05,5.8,2.13,21.5,86,2.62,2.65,.3,2.01,2.6,.73,3.1,380
|
||||
2,11.87,4.31,2.39,21,82,2.86,3.03,.21,2.91,2.8,.75,3.64,380
|
||||
2,12.07,2.16,2.17,21,85,2.6,2.65,.37,1.35,2.76,.86,3.28,378
|
||||
2,12.43,1.53,2.29,21.5,86,2.74,3.15,.39,1.77,3.94,.69,2.84,352
|
||||
2,11.79,2.13,2.78,28.5,92,2.13,2.24,.58,1.76,3,.97,2.44,466
|
||||
2,12.37,1.63,2.3,24.5,88,2.22,2.45,.4,1.9,2.12,.89,2.78,342
|
||||
2,12.04,4.3,2.38,22,80,2.1,1.75,.42,1.35,2.6,.79,2.57,580
|
||||
3,12.86,1.35,2.32,18,122,1.51,1.25,.21,.94,4.1,.76,1.29,630
|
||||
3,12.88,2.99,2.4,20,104,1.3,1.22,.24,.83,5.4,.74,1.42,530
|
||||
3,12.81,2.31,2.4,24,98,1.15,1.09,.27,.83,5.7,.66,1.36,560
|
||||
3,12.7,3.55,2.36,21.5,106,1.7,1.2,.17,.84,5,.78,1.29,600
|
||||
3,12.51,1.24,2.25,17.5,85,2,.58,.6,1.25,5.45,.75,1.51,650
|
||||
3,12.6,2.46,2.2,18.5,94,1.62,.66,.63,.94,7.1,.73,1.58,695
|
||||
3,12.25,4.72,2.54,21,89,1.38,.47,.53,.8,3.85,.75,1.27,720
|
||||
3,12.53,5.51,2.64,25,96,1.79,.6,.63,1.1,5,.82,1.69,515
|
||||
3,13.49,3.59,2.19,19.5,88,1.62,.48,.58,.88,5.7,.81,1.82,580
|
||||
3,12.84,2.96,2.61,24,101,2.32,.6,.53,.81,4.92,.89,2.15,590
|
||||
3,12.93,2.81,2.7,21,96,1.54,.5,.53,.75,4.6,.77,2.31,600
|
||||
3,13.36,2.56,2.35,20,89,1.4,.5,.37,.64,5.6,.7,2.47,780
|
||||
3,13.52,3.17,2.72,23.5,97,1.55,.52,.5,.55,4.35,.89,2.06,520
|
||||
3,13.62,4.95,2.35,20,92,2,.8,.47,1.02,4.4,.91,2.05,550
|
||||
3,12.25,3.88,2.2,18.5,112,1.38,.78,.29,1.14,8.21,.65,2,855
|
||||
3,13.16,3.57,2.15,21,102,1.5,.55,.43,1.3,4,.6,1.68,830
|
||||
3,13.88,5.04,2.23,20,80,.98,.34,.4,.68,4.9,.58,1.33,415
|
||||
3,12.87,4.61,2.48,21.5,86,1.7,.65,.47,.86,7.65,.54,1.86,625
|
||||
3,13.32,3.24,2.38,21.5,92,1.93,.76,.45,1.25,8.42,.55,1.62,650
|
||||
3,13.08,3.9,2.36,21.5,113,1.41,1.39,.34,1.14,9.40,.57,1.33,550
|
||||
3,13.5,3.12,2.62,24,123,1.4,1.57,.22,1.25,8.60,.59,1.3,500
|
||||
3,12.79,2.67,2.48,22,112,1.48,1.36,.24,1.26,10.8,.48,1.47,480
|
||||
3,13.11,1.9,2.75,25.5,116,2.2,1.28,.26,1.56,7.1,.61,1.33,425
|
||||
3,13.23,3.3,2.28,18.5,98,1.8,.83,.61,1.87,10.52,.56,1.51,675
|
||||
3,12.58,1.29,2.1,20,103,1.48,.58,.53,1.4,7.6,.58,1.55,640
|
||||
3,13.17,5.19,2.32,22,93,1.74,.63,.61,1.55,7.9,.6,1.48,725
|
||||
3,13.84,4.12,2.38,19.5,89,1.8,.83,.48,1.56,9.01,.57,1.64,480
|
||||
3,12.45,3.03,2.64,27,97,1.9,.58,.63,1.14,7.5,.67,1.73,880
|
||||
3,14.34,1.68,2.7,25,98,2.8,1.31,.53,2.7,13,.57,1.96,660
|
||||
3,13.48,1.67,2.64,22.5,89,2.6,1.1,.52,2.29,11.75,.57,1.78,620
|
||||
3,12.36,3.83,2.38,21,88,2.3,.92,.5,1.04,7.65,.56,1.58,520
|
||||
3,13.69,3.26,2.54,20,107,1.83,.56,.5,.8,5.88,.96,1.82,680
|
||||
3,12.85,3.27,2.58,22,106,1.65,.6,.6,.96,5.58,.87,2.11,570
|
||||
3,12.96,3.45,2.35,18.5,106,1.39,.7,.4,.94,5.28,.68,1.75,675
|
||||
3,13.78,2.76,2.3,22,90,1.35,.68,.41,1.03,9.58,.7,1.68,615
|
||||
3,13.73,4.36,2.26,22.5,88,1.28,.47,.52,1.15,6.62,.78,1.75,520
|
||||
3,13.45,3.7,2.6,23,111,1.7,.92,.43,1.46,10.68,.85,1.56,695
|
||||
3,12.82,3.37,2.3,19.5,88,1.48,.66,.4,.97,10.26,.72,1.75,685
|
||||
3,13.58,2.58,2.69,24.5,105,1.55,.84,.39,1.54,8.66,.74,1.8,750
|
||||
3,13.4,4.6,2.86,25,112,1.98,.96,.27,1.11,8.5,.67,1.92,630
|
||||
3,12.2,3.03,2.32,19,96,1.25,.49,.4,.73,5.5,.66,1.83,510
|
||||
3,12.77,2.39,2.28,19.5,86,1.39,.51,.48,.64,9.899999,.57,1.63,470
|
||||
3,14.16,2.51,2.48,20,91,1.68,.7,.44,1.24,9.7,.62,1.71,660
|
||||
3,13.71,5.65,2.45,20.5,95,1.68,.61,.52,1.06,7.7,.64,1.74,740
|
||||
3,13.4,3.91,2.48,23,102,1.8,.75,.43,1.41,7.3,.7,1.56,750
|
||||
3,13.27,4.28,2.26,20,120,1.59,.69,.43,1.35,10.2,.59,1.56,835
|
||||
3,13.17,2.59,2.37,20,120,1.65,.68,.53,1.46,9.3,.6,1.62,840
|
||||
3,14.13,4.1,2.74,24.5,96,2.05,.76,.56,1.35,9.2,.61,1.6,560
|
||||
@@ -0,0 +1,100 @@
|
||||
1. Title of Database: Wine recognition data
|
||||
Updated Sept 21, 1998 by C.Blake : Added attribute information
|
||||
|
||||
2. Sources:
|
||||
(a) Forina, M. et al, PARVUS - An Extendible Package for Data
|
||||
Exploration, Classification and Correlation. Institute of Pharmaceutical
|
||||
and Food Analysis and Technologies, Via Brigata Salerno,
|
||||
16147 Genoa, Italy.
|
||||
|
||||
(b) Stefan Aeberhard, email: stefan@coral.cs.jcu.edu.au
|
||||
(c) July 1991
|
||||
3. Past Usage:
|
||||
|
||||
(1)
|
||||
S. Aeberhard, D. Coomans and O. de Vel,
|
||||
Comparison of Classifiers in High Dimensional Settings,
|
||||
Tech. Rep. no. 92-02, (1992), Dept. of Computer Science and Dept. of
|
||||
Mathematics and Statistics, James Cook University of North Queensland.
|
||||
(Also submitted to Technometrics).
|
||||
|
||||
The data was used with many others for comparing various
|
||||
classifiers. The classes are separable, though only RDA
|
||||
has achieved 100% correct classification.
|
||||
(RDA : 100%, QDA 99.4%, LDA 98.9%, 1NN 96.1% (z-transformed data))
|
||||
(All results using the leave-one-out technique)
|
||||
|
||||
In a classification context, this is a well posed problem
|
||||
with "well behaved" class structures. A good data set
|
||||
for first testing of a new classifier, but not very
|
||||
challenging.
|
||||
|
||||
(2)
|
||||
S. Aeberhard, D. Coomans and O. de Vel,
|
||||
"THE CLASSIFICATION PERFORMANCE OF RDA"
|
||||
Tech. Rep. no. 92-01, (1992), Dept. of Computer Science and Dept. of
|
||||
Mathematics and Statistics, James Cook University of North Queensland.
|
||||
(Also submitted to Journal of Chemometrics).
|
||||
|
||||
Here, the data was used to illustrate the superior performance of
|
||||
the use of a new appreciation function with RDA.
|
||||
|
||||
4. Relevant Information:
|
||||
|
||||
-- These data are the results of a chemical analysis of
|
||||
wines grown in the same region in Italy but derived from three
|
||||
different cultivars.
|
||||
The analysis determined the quantities of 13 constituents
|
||||
found in each of the three types of wines.
|
||||
|
||||
-- I think that the initial data set had around 30 variables, but
|
||||
for some reason I only have the 13 dimensional version.
|
||||
I had a list of what the 30 or so variables were, but a.)
|
||||
I lost it, and b.), I would not know which 13 variables
|
||||
are included in the set.
|
||||
|
||||
-- The attributes are (dontated by Riccardo Leardi,
|
||||
riclea@anchem.unige.it )
|
||||
1) Alcohol
|
||||
2) Malic acid
|
||||
3) Ash
|
||||
4) Alcalinity of ash
|
||||
5) Magnesium
|
||||
6) Total phenols
|
||||
7) Flavanoids
|
||||
8) Nonflavanoid phenols
|
||||
9) Proanthocyanins
|
||||
10)Color intensity
|
||||
11)Hue
|
||||
12)OD280/OD315 of diluted wines
|
||||
13)Proline
|
||||
|
||||
5. Number of Instances
|
||||
|
||||
class 1 59
|
||||
class 2 71
|
||||
class 3 48
|
||||
|
||||
6. Number of Attributes
|
||||
|
||||
13
|
||||
|
||||
7. For Each Attribute:
|
||||
|
||||
All attributes are continuous
|
||||
|
||||
No statistics available, but suggest to standardise
|
||||
variables for certain uses (e.g. for us with classifiers
|
||||
which are NOT scale invariant)
|
||||
|
||||
NOTE: 1st attribute is class identifier (1-3)
|
||||
|
||||
8. Missing Attribute Values:
|
||||
|
||||
None
|
||||
|
||||
9. Class Distribution: number of instances per class
|
||||
|
||||
class 1 59
|
||||
class 2 71
|
||||
class 3 48
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"[r]": {
|
||||
// generated automatically? What even....
|
||||
"editor.wordSeparators": "`~!@#$%^&*()-=+[{]}\\|;:'\",<>/",
|
||||
"editor.indentSize": "tabSize",
|
||||
"editor.useTabStops": true,
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
##########################################
|
||||
### Principal Component Analysis (PCA) ###
|
||||
##########################################
|
||||
|
||||
## load libraries
|
||||
library(ggplot2)
|
||||
library(ggfortify)
|
||||
library(GGally)
|
||||
library(e1071)
|
||||
library(class)
|
||||
library(psych)
|
||||
library(readr)
|
||||
|
||||
## set working directory so that files can be referenced without the full path
|
||||
setwd("~/Courses/Data Analytics/Fall25/labs/lab 4/")
|
||||
|
||||
## read dataset
|
||||
wine <- read_csv("wine.data", col_names = FALSE)
|
||||
|
||||
## set column names
|
||||
names(wine) <- c("Type","Alcohol","Malic acid","Ash","Alcalinity of ash","Magnesium","Total phenols","Flavanoids","Nonflavanoid Phenols","Proanthocyanins","Color Intensity","Hue","Od280/od315 of diluted wines","Proline")
|
||||
|
||||
## inspect data frame
|
||||
head(wine)
|
||||
|
||||
## change the data type of the "Type" column from character to factor
|
||||
####
|
||||
# Factors look like regular strings (characters) but with factors R knows
|
||||
# that the column is a categorical variable with finite possible values
|
||||
# e.g. "Type" in the Wine dataset can only be 1, 2, or 3
|
||||
####
|
||||
|
||||
wine$Type <- as.factor(wine$Type)
|
||||
|
||||
|
||||
## visualize variables
|
||||
pairs.panels(wine[,-1],gap = 0,bg = c("red", "yellow", "blue")[wine$Type],pch=21)
|
||||
|
||||
ggpairs(wine, ggplot2::aes(colour = Type))
|
||||
|
||||
###
|
||||
@@ -0,0 +1,128 @@
|
||||
install.packages(
|
||||
c("e1071", "caret", "randomForest", "ggplot2", "pROC"),
|
||||
repos = c("https://cloud.r-project.org/"),
|
||||
dependencies = TRUE
|
||||
)
|
||||
|
||||
suppressPackageStartupMessages({
|
||||
library(e1071) # for svm/tune.svm
|
||||
library(caret) # for metrics
|
||||
library(randomForest) # alternative classifier
|
||||
library(ggplot2)
|
||||
})
|
||||
|
||||
set.seed(42)
|
||||
|
||||
read_wine <- function() {
|
||||
df <- read.csv("wine.data", header = FALSE)
|
||||
colnames(df) <- c(
|
||||
"Class",
|
||||
"Alcohol", "Malic.acid", "Ash", "Alcalinity.of.ash", "Magnesium",
|
||||
"Total.phenols", "Flavanoids", "Nonflavanoid.phenols", "Proanthocyanins",
|
||||
"Color.intensity", "Hue", "OD280.OD315", "Proline"
|
||||
)
|
||||
df$Class <- factor(df$Class)
|
||||
df
|
||||
}
|
||||
|
||||
df <- read_wine()
|
||||
|
||||
# split into train/test
|
||||
idx <- createDataPartition(df$Class, p = 0.8, list = FALSE)
|
||||
train <- df[idx, ]
|
||||
test <- df[-idx, ]
|
||||
|
||||
# choose a subset of features based on ANOVA F-test
|
||||
# I picked this sbuset before the runs:
|
||||
# alcohol, flavanoids, color intensity, od280/od315, proline, total phenols
|
||||
features <- c("Alcohol", "Flavanoids", "Color.intensity", "OD280.OD315", "Proline", "Total.phenols")
|
||||
x_train <- train[, features]
|
||||
y_train <- train$Class
|
||||
x_test <- test[, features]
|
||||
y_test <- test$Class
|
||||
|
||||
# scale features
|
||||
pp <- preProcess(x_train, method = c("center", "scale"))
|
||||
x_train_s <- predict(pp, x_train)
|
||||
x_test_s <- predict(pp, x_test)
|
||||
|
||||
# linear kernel svm with hyperparameter tuning (C)
|
||||
set.seed(42)
|
||||
lin_grid <- data.frame(cost = c(0.1, 1, 10, 100))
|
||||
tune_lin <- tune.svm(
|
||||
x = x_train_s, y = y_train,
|
||||
kernel = "linear",
|
||||
cost = lin_grid$cost,
|
||||
tunecontrol = tune.control(cross = 5)
|
||||
)
|
||||
lin_best <- tune_lin$best.model
|
||||
|
||||
# rbf kernel svm with tuning (C, gamma)
|
||||
set.seed(42)
|
||||
rbf_grid_cost <- c(0.1, 1, 10, 100, 1000)
|
||||
rbf_grid_gamma <- c(0.001, 0.01, 0.1, 1)
|
||||
tune_rbf <- tune.svm(
|
||||
x = x_train_s, y = y_train,
|
||||
kernel = "radial",
|
||||
cost = rbf_grid_cost,
|
||||
gamma = rbf_grid_gamma,
|
||||
tunecontrol = tune.control(cross = 5)
|
||||
)
|
||||
rbf_best <- tune_rbf$best.model
|
||||
|
||||
# alt classifier: random forest (same features)
|
||||
set.seed(42)
|
||||
rf_fit <- randomForest(x = x_train, y = y_train, ntree = 500, mtry = 2, importance = TRUE)
|
||||
|
||||
# evaluation helper
|
||||
eval_model <- function(model, x_test_s, y_test, name) {
|
||||
pred <- predict(model, x_test_s)
|
||||
cm <- confusionMatrix(pred, y_test)
|
||||
pr <- data.frame(
|
||||
model = name,
|
||||
accuracy = cm$overall["Accuracy"],
|
||||
precision_macro = mean(cm$byClass[, "Precision"], na.rm = TRUE),
|
||||
recall_macro = mean(cm$byClass[, "Recall"], na.rm = TRUE),
|
||||
f1_macro = mean(cm$byClass[, "F1"], na.rm = TRUE)
|
||||
)
|
||||
list(cm = cm, pr = pr)
|
||||
}
|
||||
|
||||
# eval svm models (use scaled features)
|
||||
lin_eval <- eval_model(lin_best, x_test_s, y_test, "svm_linear")
|
||||
rbf_eval <- eval_model(rbf_best, x_test_s, y_test, "svm_rbf")
|
||||
|
||||
# evaluate random forest (no scaling)
|
||||
rf_pred <- predict(rf_fit, x_test)
|
||||
rf_cm <- confusionMatrix(rf_pred, y_test)
|
||||
|
||||
rf_pr <- data.frame(
|
||||
model = "random_forest",
|
||||
accuracy = rf_cm$overall["Accuracy"],
|
||||
precision_macro = mean(rf_cm$byClass[, "Precision"], na.rm = TRUE),
|
||||
recall_macro = mean(rf_cm$byClass[, "Recall"], na.rm = TRUE),
|
||||
f1_macro = mean(rf_cm$byClass[, "F1"], na.rm = TRUE)
|
||||
)
|
||||
|
||||
perf <- rbind(lin_eval$pr, rbf_eval$pr, rf_pr)
|
||||
|
||||
# print
|
||||
cat("best params (linear svm): C =", lin_best$cost, "\n")
|
||||
cat("best params (rbf svm): C =", rbf_best$cost, " gamma =", rbf_best$gamma, "\n\n")
|
||||
print(perf)
|
||||
|
||||
# macro-f1 comparison
|
||||
ggplot(perf, aes(x = model, y = f1_macro)) +
|
||||
geom_col() +
|
||||
labs(title = "macro-F1 by model (wine test set)")
|
||||
|
||||
# save outputs
|
||||
write.table(perf, file = "lab5_performance_table.txt", sep = "\t", row.names = FALSE, quote = FALSE)
|
||||
sink("lab5_confusion_matrices.txt")
|
||||
cat("=== svm linear ===\n")
|
||||
print(lin_eval$cm)
|
||||
cat("\n=== svm rbf ===\n")
|
||||
print(rbf_eval$cm)
|
||||
cat("\n=== random forest ===\n")
|
||||
print(rf_cm)
|
||||
sink()
|
||||
@@ -0,0 +1,95 @@
|
||||
=== svm linear ===
|
||||
Confusion Matrix and Statistics
|
||||
|
||||
Reference
|
||||
Prediction 1 2 3
|
||||
1 11 1 0
|
||||
2 0 13 0
|
||||
3 0 0 9
|
||||
|
||||
Overall Statistics
|
||||
|
||||
Accuracy : 0.9706
|
||||
95% CI : (0.8467, 0.9993)
|
||||
No Information Rate : 0.4118
|
||||
P-Value [Acc > NIR] : 3.92e-12
|
||||
|
||||
Kappa : 0.9553
|
||||
|
||||
Mcnemar's Test P-Value : NA
|
||||
|
||||
Statistics by Class:
|
||||
|
||||
Class: 1 Class: 2 Class: 3
|
||||
Sensitivity 1.0000 0.9286 1.0000
|
||||
Specificity 0.9565 1.0000 1.0000
|
||||
Pos Pred Value 0.9167 1.0000 1.0000
|
||||
Neg Pred Value 1.0000 0.9524 1.0000
|
||||
Prevalence 0.3235 0.4118 0.2647
|
||||
Detection Rate 0.3235 0.3824 0.2647
|
||||
Detection Prevalence 0.3529 0.3824 0.2647
|
||||
Balanced Accuracy 0.9783 0.9643 1.0000
|
||||
|
||||
=== svm rbf ===
|
||||
Confusion Matrix and Statistics
|
||||
|
||||
Reference
|
||||
Prediction 1 2 3
|
||||
1 11 1 0
|
||||
2 0 13 0
|
||||
3 0 0 9
|
||||
|
||||
Overall Statistics
|
||||
|
||||
Accuracy : 0.9706
|
||||
95% CI : (0.8467, 0.9993)
|
||||
No Information Rate : 0.4118
|
||||
P-Value [Acc > NIR] : 3.92e-12
|
||||
|
||||
Kappa : 0.9553
|
||||
|
||||
Mcnemar's Test P-Value : NA
|
||||
|
||||
Statistics by Class:
|
||||
|
||||
Class: 1 Class: 2 Class: 3
|
||||
Sensitivity 1.0000 0.9286 1.0000
|
||||
Specificity 0.9565 1.0000 1.0000
|
||||
Pos Pred Value 0.9167 1.0000 1.0000
|
||||
Neg Pred Value 1.0000 0.9524 1.0000
|
||||
Prevalence 0.3235 0.4118 0.2647
|
||||
Detection Rate 0.3235 0.3824 0.2647
|
||||
Detection Prevalence 0.3529 0.3824 0.2647
|
||||
Balanced Accuracy 0.9783 0.9643 1.0000
|
||||
|
||||
=== random forest ===
|
||||
Confusion Matrix and Statistics
|
||||
|
||||
Reference
|
||||
Prediction 1 2 3
|
||||
1 11 1 0
|
||||
2 0 13 0
|
||||
3 0 0 9
|
||||
|
||||
Overall Statistics
|
||||
|
||||
Accuracy : 0.9706
|
||||
95% CI : (0.8467, 0.9993)
|
||||
No Information Rate : 0.4118
|
||||
P-Value [Acc > NIR] : 3.92e-12
|
||||
|
||||
Kappa : 0.9553
|
||||
|
||||
Mcnemar's Test P-Value : NA
|
||||
|
||||
Statistics by Class:
|
||||
|
||||
Class: 1 Class: 2 Class: 3
|
||||
Sensitivity 1.0000 0.9286 1.0000
|
||||
Specificity 0.9565 1.0000 1.0000
|
||||
Pos Pred Value 0.9167 1.0000 1.0000
|
||||
Neg Pred Value 1.0000 0.9524 1.0000
|
||||
Prevalence 0.3235 0.4118 0.2647
|
||||
Detection Rate 0.3235 0.3824 0.2647
|
||||
Detection Prevalence 0.3529 0.3824 0.2647
|
||||
Balanced Accuracy 0.9783 0.9643 1.0000
|
||||
@@ -0,0 +1,4 @@
|
||||
model accuracy precision_macro recall_macro f1_macro
|
||||
svm_linear 0.970588235294118 0.972222222222222 0.976190476190476 0.973161567364466
|
||||
svm_rbf 0.970588235294118 0.972222222222222 0.976190476190476 0.973161567364466
|
||||
random_forest 0.970588235294118 0.972222222222222 0.976190476190476 0.973161567364466
|
||||
@@ -0,0 +1,178 @@
|
||||
1,14.23,1.71,2.43,15.6,127,2.8,3.06,.28,2.29,5.64,1.04,3.92,1065
|
||||
1,13.2,1.78,2.14,11.2,100,2.65,2.76,.26,1.28,4.38,1.05,3.4,1050
|
||||
1,13.16,2.36,2.67,18.6,101,2.8,3.24,.3,2.81,5.68,1.03,3.17,1185
|
||||
1,14.37,1.95,2.5,16.8,113,3.85,3.49,.24,2.18,7.8,.86,3.45,1480
|
||||
1,13.24,2.59,2.87,21,118,2.8,2.69,.39,1.82,4.32,1.04,2.93,735
|
||||
1,14.2,1.76,2.45,15.2,112,3.27,3.39,.34,1.97,6.75,1.05,2.85,1450
|
||||
1,14.39,1.87,2.45,14.6,96,2.5,2.52,.3,1.98,5.25,1.02,3.58,1290
|
||||
1,14.06,2.15,2.61,17.6,121,2.6,2.51,.31,1.25,5.05,1.06,3.58,1295
|
||||
1,14.83,1.64,2.17,14,97,2.8,2.98,.29,1.98,5.2,1.08,2.85,1045
|
||||
1,13.86,1.35,2.27,16,98,2.98,3.15,.22,1.85,7.22,1.01,3.55,1045
|
||||
1,14.1,2.16,2.3,18,105,2.95,3.32,.22,2.38,5.75,1.25,3.17,1510
|
||||
1,14.12,1.48,2.32,16.8,95,2.2,2.43,.26,1.57,5,1.17,2.82,1280
|
||||
1,13.75,1.73,2.41,16,89,2.6,2.76,.29,1.81,5.6,1.15,2.9,1320
|
||||
1,14.75,1.73,2.39,11.4,91,3.1,3.69,.43,2.81,5.4,1.25,2.73,1150
|
||||
1,14.38,1.87,2.38,12,102,3.3,3.64,.29,2.96,7.5,1.2,3,1547
|
||||
1,13.63,1.81,2.7,17.2,112,2.85,2.91,.3,1.46,7.3,1.28,2.88,1310
|
||||
1,14.3,1.92,2.72,20,120,2.8,3.14,.33,1.97,6.2,1.07,2.65,1280
|
||||
1,13.83,1.57,2.62,20,115,2.95,3.4,.4,1.72,6.6,1.13,2.57,1130
|
||||
1,14.19,1.59,2.48,16.5,108,3.3,3.93,.32,1.86,8.7,1.23,2.82,1680
|
||||
1,13.64,3.1,2.56,15.2,116,2.7,3.03,.17,1.66,5.1,.96,3.36,845
|
||||
1,14.06,1.63,2.28,16,126,3,3.17,.24,2.1,5.65,1.09,3.71,780
|
||||
1,12.93,3.8,2.65,18.6,102,2.41,2.41,.25,1.98,4.5,1.03,3.52,770
|
||||
1,13.71,1.86,2.36,16.6,101,2.61,2.88,.27,1.69,3.8,1.11,4,1035
|
||||
1,12.85,1.6,2.52,17.8,95,2.48,2.37,.26,1.46,3.93,1.09,3.63,1015
|
||||
1,13.5,1.81,2.61,20,96,2.53,2.61,.28,1.66,3.52,1.12,3.82,845
|
||||
1,13.05,2.05,3.22,25,124,2.63,2.68,.47,1.92,3.58,1.13,3.2,830
|
||||
1,13.39,1.77,2.62,16.1,93,2.85,2.94,.34,1.45,4.8,.92,3.22,1195
|
||||
1,13.3,1.72,2.14,17,94,2.4,2.19,.27,1.35,3.95,1.02,2.77,1285
|
||||
1,13.87,1.9,2.8,19.4,107,2.95,2.97,.37,1.76,4.5,1.25,3.4,915
|
||||
1,14.02,1.68,2.21,16,96,2.65,2.33,.26,1.98,4.7,1.04,3.59,1035
|
||||
1,13.73,1.5,2.7,22.5,101,3,3.25,.29,2.38,5.7,1.19,2.71,1285
|
||||
1,13.58,1.66,2.36,19.1,106,2.86,3.19,.22,1.95,6.9,1.09,2.88,1515
|
||||
1,13.68,1.83,2.36,17.2,104,2.42,2.69,.42,1.97,3.84,1.23,2.87,990
|
||||
1,13.76,1.53,2.7,19.5,132,2.95,2.74,.5,1.35,5.4,1.25,3,1235
|
||||
1,13.51,1.8,2.65,19,110,2.35,2.53,.29,1.54,4.2,1.1,2.87,1095
|
||||
1,13.48,1.81,2.41,20.5,100,2.7,2.98,.26,1.86,5.1,1.04,3.47,920
|
||||
1,13.28,1.64,2.84,15.5,110,2.6,2.68,.34,1.36,4.6,1.09,2.78,880
|
||||
1,13.05,1.65,2.55,18,98,2.45,2.43,.29,1.44,4.25,1.12,2.51,1105
|
||||
1,13.07,1.5,2.1,15.5,98,2.4,2.64,.28,1.37,3.7,1.18,2.69,1020
|
||||
1,14.22,3.99,2.51,13.2,128,3,3.04,.2,2.08,5.1,.89,3.53,760
|
||||
1,13.56,1.71,2.31,16.2,117,3.15,3.29,.34,2.34,6.13,.95,3.38,795
|
||||
1,13.41,3.84,2.12,18.8,90,2.45,2.68,.27,1.48,4.28,.91,3,1035
|
||||
1,13.88,1.89,2.59,15,101,3.25,3.56,.17,1.7,5.43,.88,3.56,1095
|
||||
1,13.24,3.98,2.29,17.5,103,2.64,2.63,.32,1.66,4.36,.82,3,680
|
||||
1,13.05,1.77,2.1,17,107,3,3,.28,2.03,5.04,.88,3.35,885
|
||||
1,14.21,4.04,2.44,18.9,111,2.85,2.65,.3,1.25,5.24,.87,3.33,1080
|
||||
1,14.38,3.59,2.28,16,102,3.25,3.17,.27,2.19,4.9,1.04,3.44,1065
|
||||
1,13.9,1.68,2.12,16,101,3.1,3.39,.21,2.14,6.1,.91,3.33,985
|
||||
1,14.1,2.02,2.4,18.8,103,2.75,2.92,.32,2.38,6.2,1.07,2.75,1060
|
||||
1,13.94,1.73,2.27,17.4,108,2.88,3.54,.32,2.08,8.90,1.12,3.1,1260
|
||||
1,13.05,1.73,2.04,12.4,92,2.72,3.27,.17,2.91,7.2,1.12,2.91,1150
|
||||
1,13.83,1.65,2.6,17.2,94,2.45,2.99,.22,2.29,5.6,1.24,3.37,1265
|
||||
1,13.82,1.75,2.42,14,111,3.88,3.74,.32,1.87,7.05,1.01,3.26,1190
|
||||
1,13.77,1.9,2.68,17.1,115,3,2.79,.39,1.68,6.3,1.13,2.93,1375
|
||||
1,13.74,1.67,2.25,16.4,118,2.6,2.9,.21,1.62,5.85,.92,3.2,1060
|
||||
1,13.56,1.73,2.46,20.5,116,2.96,2.78,.2,2.45,6.25,.98,3.03,1120
|
||||
1,14.22,1.7,2.3,16.3,118,3.2,3,.26,2.03,6.38,.94,3.31,970
|
||||
1,13.29,1.97,2.68,16.8,102,3,3.23,.31,1.66,6,1.07,2.84,1270
|
||||
1,13.72,1.43,2.5,16.7,108,3.4,3.67,.19,2.04,6.8,.89,2.87,1285
|
||||
2,12.37,.94,1.36,10.6,88,1.98,.57,.28,.42,1.95,1.05,1.82,520
|
||||
2,12.33,1.1,2.28,16,101,2.05,1.09,.63,.41,3.27,1.25,1.67,680
|
||||
2,12.64,1.36,2.02,16.8,100,2.02,1.41,.53,.62,5.75,.98,1.59,450
|
||||
2,13.67,1.25,1.92,18,94,2.1,1.79,.32,.73,3.8,1.23,2.46,630
|
||||
2,12.37,1.13,2.16,19,87,3.5,3.1,.19,1.87,4.45,1.22,2.87,420
|
||||
2,12.17,1.45,2.53,19,104,1.89,1.75,.45,1.03,2.95,1.45,2.23,355
|
||||
2,12.37,1.21,2.56,18.1,98,2.42,2.65,.37,2.08,4.6,1.19,2.3,678
|
||||
2,13.11,1.01,1.7,15,78,2.98,3.18,.26,2.28,5.3,1.12,3.18,502
|
||||
2,12.37,1.17,1.92,19.6,78,2.11,2,.27,1.04,4.68,1.12,3.48,510
|
||||
2,13.34,.94,2.36,17,110,2.53,1.3,.55,.42,3.17,1.02,1.93,750
|
||||
2,12.21,1.19,1.75,16.8,151,1.85,1.28,.14,2.5,2.85,1.28,3.07,718
|
||||
2,12.29,1.61,2.21,20.4,103,1.1,1.02,.37,1.46,3.05,.906,1.82,870
|
||||
2,13.86,1.51,2.67,25,86,2.95,2.86,.21,1.87,3.38,1.36,3.16,410
|
||||
2,13.49,1.66,2.24,24,87,1.88,1.84,.27,1.03,3.74,.98,2.78,472
|
||||
2,12.99,1.67,2.6,30,139,3.3,2.89,.21,1.96,3.35,1.31,3.5,985
|
||||
2,11.96,1.09,2.3,21,101,3.38,2.14,.13,1.65,3.21,.99,3.13,886
|
||||
2,11.66,1.88,1.92,16,97,1.61,1.57,.34,1.15,3.8,1.23,2.14,428
|
||||
2,13.03,.9,1.71,16,86,1.95,2.03,.24,1.46,4.6,1.19,2.48,392
|
||||
2,11.84,2.89,2.23,18,112,1.72,1.32,.43,.95,2.65,.96,2.52,500
|
||||
2,12.33,.99,1.95,14.8,136,1.9,1.85,.35,2.76,3.4,1.06,2.31,750
|
||||
2,12.7,3.87,2.4,23,101,2.83,2.55,.43,1.95,2.57,1.19,3.13,463
|
||||
2,12,.92,2,19,86,2.42,2.26,.3,1.43,2.5,1.38,3.12,278
|
||||
2,12.72,1.81,2.2,18.8,86,2.2,2.53,.26,1.77,3.9,1.16,3.14,714
|
||||
2,12.08,1.13,2.51,24,78,2,1.58,.4,1.4,2.2,1.31,2.72,630
|
||||
2,13.05,3.86,2.32,22.5,85,1.65,1.59,.61,1.62,4.8,.84,2.01,515
|
||||
2,11.84,.89,2.58,18,94,2.2,2.21,.22,2.35,3.05,.79,3.08,520
|
||||
2,12.67,.98,2.24,18,99,2.2,1.94,.3,1.46,2.62,1.23,3.16,450
|
||||
2,12.16,1.61,2.31,22.8,90,1.78,1.69,.43,1.56,2.45,1.33,2.26,495
|
||||
2,11.65,1.67,2.62,26,88,1.92,1.61,.4,1.34,2.6,1.36,3.21,562
|
||||
2,11.64,2.06,2.46,21.6,84,1.95,1.69,.48,1.35,2.8,1,2.75,680
|
||||
2,12.08,1.33,2.3,23.6,70,2.2,1.59,.42,1.38,1.74,1.07,3.21,625
|
||||
2,12.08,1.83,2.32,18.5,81,1.6,1.5,.52,1.64,2.4,1.08,2.27,480
|
||||
2,12,1.51,2.42,22,86,1.45,1.25,.5,1.63,3.6,1.05,2.65,450
|
||||
2,12.69,1.53,2.26,20.7,80,1.38,1.46,.58,1.62,3.05,.96,2.06,495
|
||||
2,12.29,2.83,2.22,18,88,2.45,2.25,.25,1.99,2.15,1.15,3.3,290
|
||||
2,11.62,1.99,2.28,18,98,3.02,2.26,.17,1.35,3.25,1.16,2.96,345
|
||||
2,12.47,1.52,2.2,19,162,2.5,2.27,.32,3.28,2.6,1.16,2.63,937
|
||||
2,11.81,2.12,2.74,21.5,134,1.6,.99,.14,1.56,2.5,.95,2.26,625
|
||||
2,12.29,1.41,1.98,16,85,2.55,2.5,.29,1.77,2.9,1.23,2.74,428
|
||||
2,12.37,1.07,2.1,18.5,88,3.52,3.75,.24,1.95,4.5,1.04,2.77,660
|
||||
2,12.29,3.17,2.21,18,88,2.85,2.99,.45,2.81,2.3,1.42,2.83,406
|
||||
2,12.08,2.08,1.7,17.5,97,2.23,2.17,.26,1.4,3.3,1.27,2.96,710
|
||||
2,12.6,1.34,1.9,18.5,88,1.45,1.36,.29,1.35,2.45,1.04,2.77,562
|
||||
2,12.34,2.45,2.46,21,98,2.56,2.11,.34,1.31,2.8,.8,3.38,438
|
||||
2,11.82,1.72,1.88,19.5,86,2.5,1.64,.37,1.42,2.06,.94,2.44,415
|
||||
2,12.51,1.73,1.98,20.5,85,2.2,1.92,.32,1.48,2.94,1.04,3.57,672
|
||||
2,12.42,2.55,2.27,22,90,1.68,1.84,.66,1.42,2.7,.86,3.3,315
|
||||
2,12.25,1.73,2.12,19,80,1.65,2.03,.37,1.63,3.4,1,3.17,510
|
||||
2,12.72,1.75,2.28,22.5,84,1.38,1.76,.48,1.63,3.3,.88,2.42,488
|
||||
2,12.22,1.29,1.94,19,92,2.36,2.04,.39,2.08,2.7,.86,3.02,312
|
||||
2,11.61,1.35,2.7,20,94,2.74,2.92,.29,2.49,2.65,.96,3.26,680
|
||||
2,11.46,3.74,1.82,19.5,107,3.18,2.58,.24,3.58,2.9,.75,2.81,562
|
||||
2,12.52,2.43,2.17,21,88,2.55,2.27,.26,1.22,2,.9,2.78,325
|
||||
2,11.76,2.68,2.92,20,103,1.75,2.03,.6,1.05,3.8,1.23,2.5,607
|
||||
2,11.41,.74,2.5,21,88,2.48,2.01,.42,1.44,3.08,1.1,2.31,434
|
||||
2,12.08,1.39,2.5,22.5,84,2.56,2.29,.43,1.04,2.9,.93,3.19,385
|
||||
2,11.03,1.51,2.2,21.5,85,2.46,2.17,.52,2.01,1.9,1.71,2.87,407
|
||||
2,11.82,1.47,1.99,20.8,86,1.98,1.6,.3,1.53,1.95,.95,3.33,495
|
||||
2,12.42,1.61,2.19,22.5,108,2,2.09,.34,1.61,2.06,1.06,2.96,345
|
||||
2,12.77,3.43,1.98,16,80,1.63,1.25,.43,.83,3.4,.7,2.12,372
|
||||
2,12,3.43,2,19,87,2,1.64,.37,1.87,1.28,.93,3.05,564
|
||||
2,11.45,2.4,2.42,20,96,2.9,2.79,.32,1.83,3.25,.8,3.39,625
|
||||
2,11.56,2.05,3.23,28.5,119,3.18,5.08,.47,1.87,6,.93,3.69,465
|
||||
2,12.42,4.43,2.73,26.5,102,2.2,2.13,.43,1.71,2.08,.92,3.12,365
|
||||
2,13.05,5.8,2.13,21.5,86,2.62,2.65,.3,2.01,2.6,.73,3.1,380
|
||||
2,11.87,4.31,2.39,21,82,2.86,3.03,.21,2.91,2.8,.75,3.64,380
|
||||
2,12.07,2.16,2.17,21,85,2.6,2.65,.37,1.35,2.76,.86,3.28,378
|
||||
2,12.43,1.53,2.29,21.5,86,2.74,3.15,.39,1.77,3.94,.69,2.84,352
|
||||
2,11.79,2.13,2.78,28.5,92,2.13,2.24,.58,1.76,3,.97,2.44,466
|
||||
2,12.37,1.63,2.3,24.5,88,2.22,2.45,.4,1.9,2.12,.89,2.78,342
|
||||
2,12.04,4.3,2.38,22,80,2.1,1.75,.42,1.35,2.6,.79,2.57,580
|
||||
3,12.86,1.35,2.32,18,122,1.51,1.25,.21,.94,4.1,.76,1.29,630
|
||||
3,12.88,2.99,2.4,20,104,1.3,1.22,.24,.83,5.4,.74,1.42,530
|
||||
3,12.81,2.31,2.4,24,98,1.15,1.09,.27,.83,5.7,.66,1.36,560
|
||||
3,12.7,3.55,2.36,21.5,106,1.7,1.2,.17,.84,5,.78,1.29,600
|
||||
3,12.51,1.24,2.25,17.5,85,2,.58,.6,1.25,5.45,.75,1.51,650
|
||||
3,12.6,2.46,2.2,18.5,94,1.62,.66,.63,.94,7.1,.73,1.58,695
|
||||
3,12.25,4.72,2.54,21,89,1.38,.47,.53,.8,3.85,.75,1.27,720
|
||||
3,12.53,5.51,2.64,25,96,1.79,.6,.63,1.1,5,.82,1.69,515
|
||||
3,13.49,3.59,2.19,19.5,88,1.62,.48,.58,.88,5.7,.81,1.82,580
|
||||
3,12.84,2.96,2.61,24,101,2.32,.6,.53,.81,4.92,.89,2.15,590
|
||||
3,12.93,2.81,2.7,21,96,1.54,.5,.53,.75,4.6,.77,2.31,600
|
||||
3,13.36,2.56,2.35,20,89,1.4,.5,.37,.64,5.6,.7,2.47,780
|
||||
3,13.52,3.17,2.72,23.5,97,1.55,.52,.5,.55,4.35,.89,2.06,520
|
||||
3,13.62,4.95,2.35,20,92,2,.8,.47,1.02,4.4,.91,2.05,550
|
||||
3,12.25,3.88,2.2,18.5,112,1.38,.78,.29,1.14,8.21,.65,2,855
|
||||
3,13.16,3.57,2.15,21,102,1.5,.55,.43,1.3,4,.6,1.68,830
|
||||
3,13.88,5.04,2.23,20,80,.98,.34,.4,.68,4.9,.58,1.33,415
|
||||
3,12.87,4.61,2.48,21.5,86,1.7,.65,.47,.86,7.65,.54,1.86,625
|
||||
3,13.32,3.24,2.38,21.5,92,1.93,.76,.45,1.25,8.42,.55,1.62,650
|
||||
3,13.08,3.9,2.36,21.5,113,1.41,1.39,.34,1.14,9.40,.57,1.33,550
|
||||
3,13.5,3.12,2.62,24,123,1.4,1.57,.22,1.25,8.60,.59,1.3,500
|
||||
3,12.79,2.67,2.48,22,112,1.48,1.36,.24,1.26,10.8,.48,1.47,480
|
||||
3,13.11,1.9,2.75,25.5,116,2.2,1.28,.26,1.56,7.1,.61,1.33,425
|
||||
3,13.23,3.3,2.28,18.5,98,1.8,.83,.61,1.87,10.52,.56,1.51,675
|
||||
3,12.58,1.29,2.1,20,103,1.48,.58,.53,1.4,7.6,.58,1.55,640
|
||||
3,13.17,5.19,2.32,22,93,1.74,.63,.61,1.55,7.9,.6,1.48,725
|
||||
3,13.84,4.12,2.38,19.5,89,1.8,.83,.48,1.56,9.01,.57,1.64,480
|
||||
3,12.45,3.03,2.64,27,97,1.9,.58,.63,1.14,7.5,.67,1.73,880
|
||||
3,14.34,1.68,2.7,25,98,2.8,1.31,.53,2.7,13,.57,1.96,660
|
||||
3,13.48,1.67,2.64,22.5,89,2.6,1.1,.52,2.29,11.75,.57,1.78,620
|
||||
3,12.36,3.83,2.38,21,88,2.3,.92,.5,1.04,7.65,.56,1.58,520
|
||||
3,13.69,3.26,2.54,20,107,1.83,.56,.5,.8,5.88,.96,1.82,680
|
||||
3,12.85,3.27,2.58,22,106,1.65,.6,.6,.96,5.58,.87,2.11,570
|
||||
3,12.96,3.45,2.35,18.5,106,1.39,.7,.4,.94,5.28,.68,1.75,675
|
||||
3,13.78,2.76,2.3,22,90,1.35,.68,.41,1.03,9.58,.7,1.68,615
|
||||
3,13.73,4.36,2.26,22.5,88,1.28,.47,.52,1.15,6.62,.78,1.75,520
|
||||
3,13.45,3.7,2.6,23,111,1.7,.92,.43,1.46,10.68,.85,1.56,695
|
||||
3,12.82,3.37,2.3,19.5,88,1.48,.66,.4,.97,10.26,.72,1.75,685
|
||||
3,13.58,2.58,2.69,24.5,105,1.55,.84,.39,1.54,8.66,.74,1.8,750
|
||||
3,13.4,4.6,2.86,25,112,1.98,.96,.27,1.11,8.5,.67,1.92,630
|
||||
3,12.2,3.03,2.32,19,96,1.25,.49,.4,.73,5.5,.66,1.83,510
|
||||
3,12.77,2.39,2.28,19.5,86,1.39,.51,.48,.64,9.899999,.57,1.63,470
|
||||
3,14.16,2.51,2.48,20,91,1.68,.7,.44,1.24,9.7,.62,1.71,660
|
||||
3,13.71,5.65,2.45,20.5,95,1.68,.61,.52,1.06,7.7,.64,1.74,740
|
||||
3,13.4,3.91,2.48,23,102,1.8,.75,.43,1.41,7.3,.7,1.56,750
|
||||
3,13.27,4.28,2.26,20,120,1.59,.69,.43,1.35,10.2,.59,1.56,835
|
||||
3,13.17,2.59,2.37,20,120,1.65,.68,.53,1.46,9.3,.6,1.62,840
|
||||
3,14.13,4.1,2.74,24.5,96,2.05,.76,.56,1.35,9.2,.61,1.6,560
|
||||
@@ -0,0 +1,100 @@
|
||||
1. Title of Database: Wine recognition data
|
||||
Updated Sept 21, 1998 by C.Blake : Added attribute information
|
||||
|
||||
2. Sources:
|
||||
(a) Forina, M. et al, PARVUS - An Extendible Package for Data
|
||||
Exploration, Classification and Correlation. Institute of Pharmaceutical
|
||||
and Food Analysis and Technologies, Via Brigata Salerno,
|
||||
16147 Genoa, Italy.
|
||||
|
||||
(b) Stefan Aeberhard, email: stefan@coral.cs.jcu.edu.au
|
||||
(c) July 1991
|
||||
3. Past Usage:
|
||||
|
||||
(1)
|
||||
S. Aeberhard, D. Coomans and O. de Vel,
|
||||
Comparison of Classifiers in High Dimensional Settings,
|
||||
Tech. Rep. no. 92-02, (1992), Dept. of Computer Science and Dept. of
|
||||
Mathematics and Statistics, James Cook University of North Queensland.
|
||||
(Also submitted to Technometrics).
|
||||
|
||||
The data was used with many others for comparing various
|
||||
classifiers. The classes are separable, though only RDA
|
||||
has achieved 100% correct classification.
|
||||
(RDA : 100%, QDA 99.4%, LDA 98.9%, 1NN 96.1% (z-transformed data))
|
||||
(All results using the leave-one-out technique)
|
||||
|
||||
In a classification context, this is a well posed problem
|
||||
with "well behaved" class structures. A good data set
|
||||
for first testing of a new classifier, but not very
|
||||
challenging.
|
||||
|
||||
(2)
|
||||
S. Aeberhard, D. Coomans and O. de Vel,
|
||||
"THE CLASSIFICATION PERFORMANCE OF RDA"
|
||||
Tech. Rep. no. 92-01, (1992), Dept. of Computer Science and Dept. of
|
||||
Mathematics and Statistics, James Cook University of North Queensland.
|
||||
(Also submitted to Journal of Chemometrics).
|
||||
|
||||
Here, the data was used to illustrate the superior performance of
|
||||
the use of a new appreciation function with RDA.
|
||||
|
||||
4. Relevant Information:
|
||||
|
||||
-- These data are the results of a chemical analysis of
|
||||
wines grown in the same region in Italy but derived from three
|
||||
different cultivars.
|
||||
The analysis determined the quantities of 13 constituents
|
||||
found in each of the three types of wines.
|
||||
|
||||
-- I think that the initial data set had around 30 variables, but
|
||||
for some reason I only have the 13 dimensional version.
|
||||
I had a list of what the 30 or so variables were, but a.)
|
||||
I lost it, and b.), I would not know which 13 variables
|
||||
are included in the set.
|
||||
|
||||
-- The attributes are (dontated by Riccardo Leardi,
|
||||
riclea@anchem.unige.it )
|
||||
1) Alcohol
|
||||
2) Malic acid
|
||||
3) Ash
|
||||
4) Alcalinity of ash
|
||||
5) Magnesium
|
||||
6) Total phenols
|
||||
7) Flavanoids
|
||||
8) Nonflavanoid phenols
|
||||
9) Proanthocyanins
|
||||
10)Color intensity
|
||||
11)Hue
|
||||
12)OD280/OD315 of diluted wines
|
||||
13)Proline
|
||||
|
||||
5. Number of Instances
|
||||
|
||||
class 1 59
|
||||
class 2 71
|
||||
class 3 48
|
||||
|
||||
6. Number of Attributes
|
||||
|
||||
13
|
||||
|
||||
7. For Each Attribute:
|
||||
|
||||
All attributes are continuous
|
||||
|
||||
No statistics available, but suggest to standardise
|
||||
variables for certain uses (e.g. for us with classifiers
|
||||
which are NOT scale invariant)
|
||||
|
||||
NOTE: 1st attribute is class identifier (1-3)
|
||||
|
||||
8. Missing Attribute Values:
|
||||
|
||||
None
|
||||
|
||||
9. Class Distribution: number of instances per class
|
||||
|
||||
class 1 59
|
||||
class 2 71
|
||||
class 3 48
|
||||