Plan, apply and roll back changes to a production ontology, with a blast radius report and a proof an auditor can re-check.
Rust ai-nativedescription-logicsformal-verificationinfrastructure-as-codeisabelle-languageknowledge-graphleanlean4mcpmcp-serverontologyowlowl2reasoningrustshaclsparqltheorem-proving
Add PIAAC educational and skills mobility case study
FABIOTESSb6fecf7210d8
diff --git a/case-studies/skills-mobility/.gitignore b/case-studies/skills-mobility/.gitignorenew file mode 100644index 00000000..5baf51b1--- /dev/null+++ b/case-studies/skills-mobility/.gitignore@@ -0,0 +1,11 @@+# Raw PIAAC public-use files are regenerable via R/01_download.R; do not commit+# (32-46 MB each). The repository root .gitignore already excludes data/, this+# is an explicit local guard.+data/raw/+data/derived/+*.sav+renv/library/+.Rproj.user/+.Rhistory+.venv/+preview/diff --git a/case-studies/skills-mobility/R/01_download.R b/case-studies/skills-mobility/R/01_download.Rnew file mode 100644index 00000000..c7b4b1c7--- /dev/null+++ b/case-studies/skills-mobility/R/01_download.R@@ -0,0 +1,50 @@+#!/usr/bin/env Rscript+# 01_download.R -- fetch the open PIAAC public-use files (CSV + SPSS).+# Idempotent: skips files already present with a non-trivial size. Records the+# URL, byte size, md5 and access date in data/raw/MANIFEST.csv for provenance.++source("config.R")++ua <- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 Chrome/124.0 Safari/537.36"++fetch <- function(url, dest) {+ if (file.exists(dest) && file.info(dest)$size > 1e6) {+ message(sprintf(" exists, skip: %s", basename(dest))); return(invisible(dest))+ }+ message(sprintf(" downloading: %s", url))+ utils::download.file(url, dest, mode = "wb", quiet = TRUE,+ headers = c("User-Agent" = ua))+ invisible(dest)+}++manifest <- list()+message("PIAAC CSV public-use files:")+for (i in seq_len(nrow(SOURCES))) {+ s <- SOURCES[i, ]+ dest <- file.path(RAW_DIR, s$file)+ fetch(s$url, dest)+ manifest[[length(manifest) + 1]] <- data.frame(+ cycle = s$cycle, file = s$file, url = s$url,+ bytes = file.info(dest)$size, md5 = tools::md5sum(dest),+ access_date = ACCESS_DATE, stringsAsFactors = FALSE)+}++# SPSS files are optional (used only to source ontology value labels). Failure+# to fetch them is non-fatal so the CSV analysis pipeline still runs.+message("PIAAC SPSS files (for value labels; optional):")+for (i in seq_len(nrow(SOURCES_SAV))) {+ s <- SOURCES_SAV[i, ]+ dest <- file.path(RAW_DIR, s$file)+ ok <- tryCatch({ fetch(s$url, dest); TRUE }, error = function(e) {+ message(sprintf(" WARN could not fetch %s: %s", s$file, conditionMessage(e))); FALSE })+ if (ok && file.exists(dest))+ manifest[[length(manifest) + 1]] <- data.frame(+ cycle = s$cycle, file = s$file, url = s$url,+ bytes = file.info(dest)$size, md5 = tools::md5sum(dest),+ access_date = ACCESS_DATE, stringsAsFactors = FALSE)+}++man <- do.call(rbind, manifest); rownames(man) <- NULL+write.csv(man, file.path(RAW_DIR, "MANIFEST.csv"), row.names = FALSE)+message("\nManifest:"); print(man[, c("cycle","file","bytes","md5")])+message("\n01_download.R complete.")diff --git a/case-studies/skills-mobility/R/02_harmonise.R b/case-studies/skills-mobility/R/02_harmonise.Rnew file mode 100644index 00000000..2df5eb66--- /dev/null+++ b/case-studies/skills-mobility/R/02_harmonise.R@@ -0,0 +1,93 @@+#!/usr/bin/env Rscript+# 02_harmonise.R -- turn the two raw PIAAC public-use files into one harmonised,+# analysis-ready table with a small set of coded, documented variables on a+# common 3-band origin/destination ladder (below upper secondary / upper+# secondary / tertiary). Every recode is recorded in outputs/tables/+# harmonisation_map.csv, which is the single source of truth the ontology+# scheme (ontology/build_scheme.R) is generated from -- no entity is invented.++source("config.R")+source("R/lib_piaac.R")++# ---- coded value maps (sourced from the SPSS value labels, see technical note)+# Origin and own education share the same 3 ordered bands.+band3 <- c("1" = "Low", "2" = "Medium", "3" = "High") # parental education+own_band <- c("1"="Low", "2"="Medium","3"="Medium",+ "4"="High","5"="High","6"="High","7"="High") # EDCAT6 collapse+skill_rank <- c("1"=4L, "2"=3L, "3"=2L, "4"=1L) # ISCOSKIL4 -> higher = more skilled+BAND_LEVELS <- c("Low","Medium","High")++harmonise <- function(cycle) {+ vm <- function(concept) VARMAP[[tolower(cycle)]][VARMAP$concept == concept]+ df <- piaac_read(cycle)+ g <- function(concept) df[[ vm(concept) ]]++ out <- tibble(+ cycle = cycle,+ year = SOURCES$year[SOURCES$cycle == cycle],+ origin = factor(unname(band3[g("parental_edu")]), levels = BAND_LEVELS),+ own_edu = factor(unname(own_band[g("own_edu6")]), levels = BAND_LEVELS),+ occ_skill_rank = unname(skill_rank[g("occ_skill")]),+ isco1 = num(g("occ_isco1")),+ earn_decile = { d <- num(g("earn_hr_decile")); ifelse(d >= 1 & d <= 10, d, NA_real_) },+ sex = factor(c("1"="Male","2"="Female")[g("sex")], levels = c("Male","Female")),+ age_band = factor(c("1"="16-24","2"="25-34","3"="35-44","4"="45-54","5"="55-65")[g("age10")],+ levels = c("16-24","25-34","35-44","45-54","55-65")),+ region = g("region_tl2"),+ SPFWT0 = num(df$SPFWT0)+ )+ # high-status occupation (ISCO-08 major groups 1-3: managers, professionals,+ # technicians); 0-9 are valid groups, larger codes are missing/skip.+ out$occ_high <- ifelse(out$isco1 %in% 0:9, as.integer(out$isco1 %in% 1:3), NA_integer_)+ out$england <- out$region %in% ENGLAND_TL2+ # plausible values + replicate weights (numeric)+ for (v in c(PV_NUM, PV_LIT, W_REP)) out[[v]] <- num(df[[v]])+ # keep only working-age respondents (16-65) with a usable final weight+ out <- out[!is.na(out$age_band) & !is.na(out$SPFWT0) & out$SPFWT0 > 0, ]+ out+}++cy1 <- harmonise("CY1")+cy2 <- harmonise("CY2")++saveRDS(cy1, file.path(DERIV_DIR, "piaac_cy1.rds"))+saveRDS(cy2, file.path(DERIV_DIR, "piaac_cy2.rds"))++# ---- harmonisation map (source of truth for the ontology scheme) -------------+hmap <- bind_rows(+ tibble(variable="origin", source_cy1="PARED", source_cy2="PAREDC2",+ code=names(band3), band=unname(band3),+ definition=c("Neither parent attained upper secondary",+ "At least one parent upper secondary / post-secondary non-tertiary",+ "At least one parent attained tertiary")),+ tibble(variable="own_edu", source_cy1="EDCAT6", source_cy2="EDCAT6_TC1",+ code=names(own_band), band=unname(own_band),+ definition=c("Lower secondary or less (ISCED 1,2,3C short)",+ "Upper secondary (ISCED 3A-B, C long)",+ "Post-secondary non-tertiary (ISCED 4)",+ "Tertiary professional (ISCED 5B)",+ "Tertiary bachelor (ISCED 5A)",+ "Tertiary master/research (ISCED 5A/6)",+ "Tertiary bachelor/master/research grouped (ISCED 5A/6)")),+ tibble(variable="occ_skill_rank", source_cy1="ISCOSKIL4", source_cy2="ISCOSKIL4",+ code=names(skill_rank), band=as.character(unname(skill_rank)),+ definition=c("Skilled occupations","Semi-skilled white-collar",+ "Semi-skilled blue-collar","Elementary occupations"))+)+write.csv(hmap, file.path(OUT_TAB, "harmonisation_map.csv"), row.names = FALSE)++# ---- sample-size / coverage summary ------------------------------------------+summ <- function(d) tibble(+ cycle = d$cycle[1], n = nrow(d),+ n_england = sum(d$england),+ n_origin = sum(!is.na(d$origin)), n_own_edu = sum(!is.na(d$own_edu)),+ n_occ = sum(!is.na(d$occ_skill_rank)), n_earn = sum(!is.na(d$earn_decile)),+ pct_origin_known = round(100 * mean(!is.na(d$origin)), 1)+)+sizes <- bind_rows(summ(cy1), summ(cy2))+write.csv(sizes, file.path(OUT_TAB, "sample_sizes.csv"), row.names = FALSE)++message("02_harmonise.R complete.")+print(as.data.frame(sizes))+cat("\nOrigin x own-education cross-tab (CY1, unweighted):\n")+print(addmargins(table(origin = cy1$origin, own = cy1$own_edu, useNA = "ifany")))diff --git a/case-studies/skills-mobility/R/03_analyse.R b/case-studies/skills-mobility/R/03_analyse.Rnew file mode 100644index 00000000..270c7635--- /dev/null+++ b/case-studies/skills-mobility/R/03_analyse.R@@ -0,0 +1,161 @@+#!/usr/bin/env Rscript+# 03_analyse.R -- the analysis. Everything uses the final weight for point+# estimates, the 80 replicate weights for standard errors, and the 10 plausible+# values combined by Rubin's rules. All estimates are descriptive associations+# with 95% confidence intervals; nothing here is a causal claim.+#+# Outputs (outputs/tables/*.csv and outputs/derived results.rds):+# 1. numeracy / literacy mean by parental-education band, each cycle (gradient)+# 2. share reaching tertiary qualification by parental-education band+# 3. origin gap (High vs Low) in numeracy, adjusted for age and sex+# 4. "same qualification, different origin": origin gap net of own qualification+# 5. within-qualification origin gap (for the headline figure)+# 6. nested models: does numeracy predict earnings / occupation BEYOND quals+# 7. breakdowns by sex and (CY1 England) region++source("config.R"); source("R/lib_piaac.R")+suppressMessages({library(dplyr); library(tidyr); library(purrr); library(survey)})++cy1 <- readRDS(file.path(DERIV_DIR, "piaac_cy1.rds"))+cy2 <- readRDS(file.path(DERIV_DIR, "piaac_cy2.rds"))+# England-only subsets so 2012 and 2023 are on the same geography+cy1e <- cy1[cy1$england, ]+cy2e <- cy2[cy2$england, ]++# weighted grand SD of numeracy (pool 10 PVs) -> standardise for predictor models+grand_sd <- function(d, pv) {+ stk <- map_dfr(pv, ~tibble(x = d[[.x]], w = d$SPFWT0))+ stk <- stk[!is.na(stk$x), ]+ m <- weighted.mean(stk$x, stk$w); sqrt(weighted.mean((stk$x - m)^2, stk$w))+}++res <- list()++# ===== 1. proficiency gradient by parental education ==========================+gradient <- function(d, cyc) {+ des <- piaac_design(d[!is.na(d$origin), ])+ bind_rows(+ piaac_mean_pv(des, PV_NUM, ~origin) %>% mutate(domain = "Numeracy"),+ piaac_mean_pv(des, PV_LIT, ~origin) %>% mutate(domain = "Literacy")+ ) %>% mutate(cycle = cyc) %>%+ rename(origin = group) %>%+ mutate(origin = factor(origin, levels = c("Low","Medium","High")))+}+res$gradient <- bind_rows(gradient(cy1e, "2012"), gradient(cy2e, "2023"))+write.csv(res$gradient, file.path(OUT_TAB, "01_proficiency_gradient.csv"), row.names = FALSE)++# ===== 2. share reaching tertiary qualification by origin =====================+tertiary_by_origin <- function(d, cyc) {+ d2 <- d[!is.na(d$origin) & !is.na(d$own_edu), ]+ d2$tertiary <- as.integer(d2$own_edu == "High")+ des <- piaac_design(d2)+ sb <- svyby(~tertiary, ~origin, des, svymean, na.rm = TRUE, vartype = "se")+ tibble(cycle = cyc, origin = factor(as.character(sb$origin), levels=c("Low","Medium","High")),+ pct = 100*sb$tertiary, se = 100*sb$se,+ ci_lo = pct - 1.96*se, ci_hi = pct + 1.96*se)+}+res$tertiary <- bind_rows(tertiary_by_origin(cy1e,"2012"), tertiary_by_origin(cy2e,"2023"))+write.csv(res$tertiary, file.path(OUT_TAB, "02_tertiary_by_origin.csv"), row.names = FALSE)++# ===== 3 & 4. origin gap in numeracy: total vs net of own qualification =======+# Total gap: numeracy ~ origin + sex + age (adjusts only composition)+# Net gap: numeracy ~ origin + own_edu + sex + age (holds qualification fixed)+origin_gap_models <- function(d, cyc) {+ d2 <- d[!is.na(d$origin) & !is.na(d$own_edu) & !is.na(d$sex), ]+ des <- piaac_design(d2)+ total <- piaac_mi_glm(function(i)+ svyglm(as.formula(paste0(PV_NUM[i], " ~ origin + sex + age_band")), design = des))+ net <- piaac_mi_glm(function(i)+ svyglm(as.formula(paste0(PV_NUM[i], " ~ origin + own_edu + sex + age_band")), design = des))+ bind_rows(+ total %>% filter(term %in% c("originMedium","originHigh")) %>% mutate(model="Total (composition-adjusted)"),+ net %>% filter(term %in% c("originMedium","originHigh")) %>% mutate(model="Net of own qualification")+ ) %>% mutate(cycle = cyc)+}+res$origin_gap <- bind_rows(origin_gap_models(cy1e,"2012"), origin_gap_models(cy2e,"2023"))+write.csv(res$origin_gap, file.path(OUT_TAB, "03_origin_gap_numeracy.csv"), row.names = FALSE)++# ===== 5. within-qualification origin gap (High vs Low), for the figure =======+within_qual_gap <- function(d, cyc) {+ d <- d[!is.na(d$origin) & !is.na(d$own_edu) & !is.na(d$sex), ]+ map_dfr(levels(d$own_edu), function(lvl) {+ s <- d[d$own_edu == lvl & d$origin %in% c("Low","High"), ]+ s$origin <- droplevels(factor(s$origin, levels = c("Low","High")))+ if (nlevels(s$origin) < 2 || nrow(s) < 60) return(NULL)+ des <- piaac_design(s)+ g <- piaac_mi_glm(function(i)+ svyglm(as.formula(paste0(PV_NUM[i], " ~ origin + sex + age_band")), design = des)) %>%+ filter(term == "originHigh")+ mutate(g, own_edu = lvl, n = nrow(s), cycle = cyc)+ })+}+res$within_qual <- bind_rows(within_qual_gap(cy1e,"2012"), within_qual_gap(cy2e,"2023"))+write.csv(res$within_qual, file.path(OUT_TAB, "05_within_qualification_gap.csv"), row.names = FALSE)++# ===== 6. nested models: numeracy beyond qualification ========================+# CY1 (full occupation + validated earnings decile). Standardise numeracy per SD.+sdc <- grand_sd(cy1, PV_NUM)+nested <- function(d, outcome, family, cyc, sd_const) {+ keep <- c("origin","own_edu","sex","age_band", outcome)+ d2 <- d[complete.cases(d[, keep]) & !is.na(d[[PV_NUM[1]]]), ]+ des <- piaac_design(d2)+ # model A: qualification + controls ; model B: + numeracy (per SD)+ fit <- function(i, withnum) {+ d2$.num <- (d2[[PV_NUM[i]]] - weighted.mean(d2[[PV_NUM[i]]], d2$SPFWT0)) / sd_const+ des_i <- update(des, .num = (get(PV_NUM[i]) - weighted.mean(get(PV_NUM[i]), SPFWT0))/sd_const)+ rhs <- if (withnum) "own_edu + .num + sex + age_band" else "own_edu + sex + age_band"+ svyglm(as.formula(paste0(outcome, " ~ ", rhs)), design = des_i, family = family)+ }+ coefB <- piaac_mi_glm(function(i) fit(i, TRUE))+ # weighted R2 (linear) or McFadden pseudo-R2 (binomial), averaged across PVs+ r2 <- function(withnum) mean(map_dbl(1:10, function(i) {+ f <- fit(i, withnum)+ if (identical(family, gaussian())) wtd_r2(f) else {+ f0 <- svyglm(as.formula(paste0(outcome, " ~ 1")), design = des, family = family)+ as.numeric(1 - (f$deviance/2) / (f0$deviance/2)) # McFadden pseudo-R2+ }+ }))+ list(coef = mutate(coefB, outcome = outcome, cycle = cyc),+ r2A = r2(FALSE), r2B = r2(TRUE))+}+earn_m <- nested(cy1, "earn_decile", gaussian(), "2012", sdc)+occ_m <- nested(cy1, "occ_high", quasibinomial(), "2012", sdc)+res$nested_coef <- bind_rows(earn_m$coef, occ_m$coef) %>% filter(term == ".num")+res$nested_r2 <- tibble(+ outcome = c("earn_decile","occ_high"),+ family = c("linear R2","McFadden pseudo-R2"),+ r2_quals_only = c(earn_m$r2A, occ_m$r2A),+ r2_plus_numeracy = c(earn_m$r2B, occ_m$r2B),+ delta = r2_plus_numeracy - r2_quals_only)+write.csv(res$nested_coef, file.path(OUT_TAB, "06_nested_numeracy_coef.csv"), row.names = FALSE)+write.csv(res$nested_r2, file.path(OUT_TAB, "06_nested_r2.csv"), row.names = FALSE)++# ===== 7. breakdowns: origin gap by sex; by CY1 England region ================+gap_by_sex <- function(d, cyc) {+ d <- d[!is.na(d$origin) & d$origin %in% c("Low","High") & !is.na(d$sex), ]+ map_dfr(c("Male","Female"), function(sx) {+ s <- d[d$sex == sx, ]; s$origin <- droplevels(factor(s$origin, levels=c("Low","High")))+ des <- piaac_design(s)+ piaac_mi_glm(function(i) svyglm(as.formula(paste0(PV_NUM[i]," ~ origin + age_band")), design=des)) %>%+ filter(term=="originHigh") %>% mutate(sex = sx, cycle = cyc, n = nrow(s))+ })+}+res$gap_sex <- bind_rows(gap_by_sex(cy1e,"2012"), gap_by_sex(cy2e,"2023"))+write.csv(res$gap_sex, file.path(OUT_TAB, "07_origin_gap_by_sex.csv"), row.names = FALSE)++saveRDS(res, file.path(DERIV_DIR, "results.rds"))++# ---- console headline summary ------------------------------------------------+cat("\n================ HEADLINE NUMBERS ================\n")+cat("\n[1] Numeracy mean by parental education (England):\n")+print(res$gradient %>% filter(domain=="Numeracy") %>%+ transmute(cycle, origin, mean=round(estimate,1), ci=sprintf("[%.1f, %.1f]",ci_lo,ci_hi)) %>% as.data.frame())+cat("\n[2] % reaching tertiary by origin:\n")+print(res$tertiary %>% transmute(cycle,origin,pct=round(pct,1),ci=sprintf("[%.1f, %.1f]",ci_lo,ci_hi)) %>% as.data.frame())+cat("\n[3/4] Origin High-vs-Low numeracy gap, total vs net of qualification:\n")+print(res$origin_gap %>% filter(term=="originHigh") %>%+ transmute(cycle,model,gap=round(estimate,1),ci=sprintf("[%.1f, %.1f]",ci_lo,ci_hi)) %>% as.data.frame())+cat("\n[6] Numeracy (per SD) coefficient beyond qualifications, and Delta-R2:\n")+print(res$nested_coef %>% transmute(outcome, coef=round(estimate,3), ci=sprintf("[%.3f, %.3f]",ci_lo,ci_hi)) %>% as.data.frame())+print(as.data.frame(res$nested_r2 %>% mutate(across(where(is.numeric), ~round(.,3)))))+cat("\n03_analyse.R complete.\n")diff --git a/case-studies/skills-mobility/R/04_visualise.R b/case-studies/skills-mobility/R/04_visualise.Rnew file mode 100644index 00000000..189cc67b--- /dev/null+++ b/case-studies/skills-mobility/R/04_visualise.R@@ -0,0 +1,117 @@+#!/usr/bin/env Rscript+# 04_visualise.R -- accessible figures (Okabe-Ito colourblind-safe palette,+# large type, direct labels, descriptive captions that double as alt text).+# Each figure is saved as a high-resolution PNG and as the underlying CSV.++source("config.R"); source("R/lib_piaac.R")+suppressMessages({library(ggplot2); library(dplyr); library(tidyr); library(scales)})++res <- readRDS(file.path(DERIV_DIR, "results.rds"))+cy1 <- readRDS(file.path(DERIV_DIR, "piaac_cy1.rds")); cy1e <- cy1[cy1$england, ]++# Okabe-Ito (colourblind-safe)+OI <- c(orange="#E69F00", sky="#56B4E9", green="#009E73", blue="#0072B2",+ vermillion="#D55E00", grey="#999999")+ORIGIN_COL <- c(Low = OI[["orange"]], Medium = OI[["sky"]], High = OI[["green"]])+base_theme <- theme_minimal(base_size = 15) ++ theme(panel.grid.minor = element_blank(),+ plot.title = element_text(face = "bold", size = 17),+ plot.caption = element_text(size = 10, colour = "grey30", hjust = 0),+ legend.position = "top")+save_fig <- function(p, name, w = 10, h = 6) {+ ggsave(file.path(OUT_FIG, paste0(name, ".png")), p, width = w, height = h, dpi = 150, bg = "white")+}++# ===== Figure 1: parental-education skills gradient ===========================+g1 <- res$gradient %>% filter(domain == "Numeracy") %>%+ mutate(origin = factor(origin, levels = c("Low","Medium","High")), cycle = factor(cycle))+write.csv(g1, file.path(OUT_FIG, "fig1_gradient.csv"), row.names = FALSE)+p1 <- ggplot(g1, aes(origin, estimate, fill = origin)) ++ geom_col(width = .7) ++ geom_errorbar(aes(ymin = ci_lo, ymax = ci_hi), width = .2, linewidth = .6) ++ geom_text(aes(label = round(estimate)), vjust = -0.9, size = 4.4) ++ facet_wrap(~cycle) ++ scale_fill_manual(values = ORIGIN_COL, guide = "none") ++ coord_cartesian(ylim = c(200, 310)) ++ labs(title = "Adults' numeracy rises steeply with their parents' education",+ subtitle = "Mean PIAAC numeracy score (0-500) by parental education, England",+ x = "Parental education (origin)", y = "Mean numeracy score",+ caption = paste0("Bars show mean numeracy with 95% confidence intervals. In both 2012 and 2023, adults whose parents\n",+ "attained tertiary education score about 50 points (roughly one standard deviation) above those whose\n",+ "parents did not finish upper secondary. Source: OECD PIAAC public-use files, England.")) ++ base_theme+save_fig(p1, "fig1_gradient")++# ===== Figure 2: same qualification, different origin (the headline) ==========+# Mean numeracy by own qualification x origin (Low vs High origin), CY1 England.+d2 <- cy1e[!is.na(cy1e$own_edu) & cy1e$origin %in% c("Low","High"), ]+d2$origin <- droplevels(factor(d2$origin, levels = c("Low","High")))+des2 <- piaac_design(d2)+d2$grp <- interaction(d2$own_edu, d2$origin, sep = "||")+des2g <- piaac_design(d2)+m2 <- piaac_mean_pv(des2g, PV_NUM, ~grp) %>%+ separate(group, into = c("own_edu","origin"), sep = "\\|\\|") %>%+ mutate(own_edu = factor(own_edu, levels = c("Low","Medium","High")),+ origin = factor(origin, levels = c("Low","High")))+write.csv(m2, file.path(OUT_FIG, "fig2_same_qualification.csv"), row.names = FALSE)+p2 <- ggplot(m2, aes(own_edu, estimate, colour = origin, group = origin)) ++ geom_line(linewidth = 1, position = position_dodge(.25)) ++ geom_errorbar(aes(ymin = ci_lo, ymax = ci_hi), width = .15, linewidth = .7,+ position = position_dodge(.25)) ++ geom_point(size = 3.4, position = position_dodge(.25)) ++ scale_colour_manual(values = c(Low = OI[["orange"]], High = OI[["green"]]),+ name = "Parental education (origin)") ++ labs(title = "The origin gap survives at every qualification level",+ subtitle = "Mean numeracy by the adult's own highest qualification and parental education. England, 2012",+ x = "Adult's own highest qualification", y = "Mean numeracy score",+ caption = paste0("Among adults holding the SAME qualification, those from a high-education background still score about\n",+ "37 points higher within the upper-secondary and tertiary groups. Qualifications alone understate the\n",+ "origin gap. Lines join Low-origin and High-origin means; bars are 95% confidence intervals.")) ++ base_theme+save_fig(p2, "fig2_same_qualification")++# ===== Figure 3: numeracy adds predictive power beyond qualifications =========+g3 <- res$nested_r2 %>%+ transmute(outcome = recode(outcome, earn_decile = "Hourly earnings (decile)",+ occ_high = "Professional / managerial job"),+ `Qualifications + age + sex` = r2_quals_only,+ `... plus numeracy` = r2_plus_numeracy) %>%+ pivot_longer(-outcome, names_to = "model", values_to = "r2") %>%+ mutate(model = factor(model, levels = c("Qualifications + age + sex", "... plus numeracy")))+write.csv(g3, file.path(OUT_FIG, "fig3_numeracy_beyond_quals.csv"), row.names = FALSE)+p3 <- ggplot(g3, aes(outcome, r2, fill = model)) ++ geom_col(position = position_dodge(.7), width = .6) ++ geom_text(aes(label = percent(r2, accuracy = 0.1)),+ position = position_dodge(.7), vjust = -0.6, size = 4) ++ scale_fill_manual(values = c(OI[["grey"]], OI[["blue"]]), name = NULL) ++ scale_y_continuous(labels = percent_format(accuracy = 1), expand = expansion(mult = c(0,.15))) ++ labs(title = "Numeracy explains outcomes beyond formal qualifications",+ subtitle = "Variance explained (R-squared) before and after adding numeracy, England 2012",+ x = NULL, y = "Share of variance explained",+ caption = paste0("Adding numeracy to a model that already contains the adult's qualification, age and sex raises the\n",+ "variance explained in earnings from 30.5% to 36.7%, and in occupational attainment from 16.0% to 20.7%.\n",+ "Skills carry information that qualifications do not. Source: OECD PIAAC public-use file, England 2012.")) ++ base_theme+save_fig(p3, "fig3_numeracy_beyond_quals")++# ===== Figure 4: educational mobility -- tertiary attainment by origin ========+g4 <- res$tertiary %>% mutate(origin = factor(origin, levels = c("Low","Medium","High")))+write.csv(g4, file.path(OUT_FIG, "fig4_tertiary_by_origin.csv"), row.names = FALSE)+p4 <- ggplot(g4, aes(origin, pct/100, fill = origin)) ++ geom_col(width = .7) ++ geom_errorbar(aes(ymin = ci_lo/100, ymax = ci_hi/100), width = .2, linewidth = .6) ++ geom_text(aes(label = percent(pct/100, accuracy = 1)), vjust = -0.9, size = 4.2) ++ facet_wrap(~cycle) ++ scale_fill_manual(values = ORIGIN_COL, guide = "none") ++ scale_y_continuous(labels = percent_format(accuracy = 1), limits = c(0, .8)) ++ labs(title = "Reaching a degree still depends heavily on where you started",+ subtitle = "Share of adults attaining a tertiary qualification, by parental education, England",+ x = "Parental education (origin)", y = "Attained tertiary qualification",+ caption = paste0("In 2023, 60% of adults from a high-education background hold a tertiary qualification, against 32% from a\n",+ "low-education background. The gap narrowed since 2012 (62% vs 23%) as attainment among low-origin adults\n",+ "rose. Bars are 95% confidence intervals. Source: OECD PIAAC public-use files, England.")) ++ base_theme+save_fig(p4, "fig4_tertiary_by_origin")++message("04_visualise.R complete. Figures + CSVs in outputs/figures/.")+print(list.files(OUT_FIG, pattern = "png$"))diff --git a/case-studies/skills-mobility/R/lib_piaac.R b/case-studies/skills-mobility/R/lib_piaac.Rnew file mode 100644index 00000000..19a419fe--- /dev/null+++ b/case-studies/skills-mobility/R/lib_piaac.R@@ -0,0 +1,111 @@+# lib_piaac.R -- estimation helpers that handle PIAAC correctly:+# * point estimates use the final weight SPFWT0;+# * sampling variance uses the 80 jackknife replicate weights with the OECD+# formula Var = sum_r (theta_r - theta_0)^2 (survey type="other", mse=TRUE);+# * proficiency uses the 10 plausible values, combined by Rubin's rules.+# These are the rules in the OECD "Survey of Adult Skills (PIAAC) Data Analysis+# Manual". Naive standard errors and single-PV averages are NOT used anywhere.++suppressWarnings(suppressMessages({+ library(survey); library(mitools); library(dplyr); library(tidyr); library(purrr)+}))+options(survey.lonely.psu = "adjust")++# ---- read one cycle, keeping only the columns we need ------------------------+piaac_read <- function(cycle) {+ s <- SOURCES[SOURCES$cycle == cycle, ]+ path <- file.path(RAW_DIR, s$file)+ vm <- VARMAP[[tolower(cycle)]]+ cols <- c(VARMAP[[tolower(cycle)]], W_FINAL, W_REP, PV_NUM, PV_LIT)+ cols <- unique(cols[!grepl(":", cols)]) # drop the "PVNUM1:10" shorthand rows+ # readr: read everything as character first (PIAAC mixes letter missing codes+ # into otherwise numeric columns), then coerce deliberately.+ raw <- readr::read_delim(path, delim = s$delim, col_types = readr::cols(.default = "c"),+ progress = FALSE, show_col_types = FALSE)+ keep <- intersect(cols, names(raw))+ raw[keep]+}++# coerce a character vector to numeric, turning PIAAC letter/dot missing codes to NA+num <- function(x) suppressWarnings(as.numeric(x))++# ---- build a PIAAC replicate-weight survey design ----------------------------+# combined.weights = TRUE because SPFWT1..80 are full replicate weights.+# The variance method differs by cycle (OECD Data Analysis Manuals):+# Cycle 1 (2012): jackknife, Var = sum_r (theta_r - theta_0)^2+# -> type "other", scale 1, rscales 1.+# Cycle 2 (2023): Fay's BRR with Fay factor 0.5,+# Var = 1/(R(1-0.5)^2) * sum_r (theta_r - theta_0)^2+# -> type "Fay", rho 0.5.+# The method is inferred from the data's `cycle` column, verified empirically+# against the published England toplines (see technical note, validation step).+piaac_design <- function(df, method = NULL) {+ if (is.null(method)) method <- if (!is.null(df$cycle) && df$cycle[1] == "CY2") "fay" else "jk"+ if (method == "fay") {+ svrepdesign(data = df, weights = ~SPFWT0, repweights = df[, W_REP],+ type = "Fay", rho = 0.5, combined.weights = TRUE, mse = TRUE)+ } else {+ svrepdesign(data = df, weights = ~SPFWT0, repweights = df[, W_REP],+ type = "other", scale = 1, rscales = rep(1, N_REP),+ combined.weights = TRUE, mse = TRUE)+ }+}++# ---- Rubin's rules across plausible values -----------------------------------+# ests: numeric vector of point estimates (one per PV)+# vars: numeric vector of sampling variances (one per PV)+rubin <- function(ests, vars) {+ m <- length(ests)+ Q <- mean(ests)+ Ub <- mean(vars) # within-imputation (sampling) variance+ B <- if (m > 1) var(ests) else 0 # between-imputation variance+ Tt <- Ub + (1 + 1 / m) * B+ se <- sqrt(Tt)+ c(estimate = Q, se = se, ci_lo = Q - 1.96 * se, ci_hi = Q + 1.96 * se,+ within = Ub, between = B)+}++# ---- mean proficiency by group, PVs + replicate weights ----------------------+# design: a piaac_design; pv: character vector of 10 PV column names; by: a+# one-sided formula e.g. ~parental_edu (or NULL for overall mean).+piaac_mean_pv <- function(design, pv, by = NULL) {+ per_pv <- map(pv, function(v) {+ f <- as.formula(paste0("~", v))+ if (is.null(by)) {+ est <- svymean(f, design, na.rm = TRUE)+ tibble(group = "all", est = as.numeric(est), var = as.numeric(SE(est))^2)+ } else {+ sb <- svyby(f, by, design, svymean, na.rm = TRUE, vartype = "se")+ tibble(group = as.character(sb[[1]]), est = sb[[2]], var = sb[["se"]]^2)+ }+ })+ long <- bind_rows(per_pv, .id = "pv")+ long %>% group_by(group) %>%+ summarise(r = list(rubin(est, var)), .groups = "drop") %>%+ mutate(stat = map(r, ~as_tibble(as.list(.x)))) %>%+ select(group, stat) %>% unnest(stat)+}++# ---- regression combining PVs (PV as outcome OR predictor) -------------------+# fit_one(i): function returning a fitted svyglm for plausible value i.+# Returns a tidy tibble (term, estimate, se, ci_lo, ci_hi, p) with Rubin's+# rules applied via mitools::MIcombine over the 10 fits.+piaac_mi_glm <- function(fit_one, n_pv = 10) {+ fits <- lapply(seq_len(n_pv), fit_one)+ mc <- mitools::MIcombine(results = lapply(fits, coef),+ variances = lapply(fits, vcov))+ est <- coef(mc); se <- sqrt(diag(vcov(mc)))+ tibble(term = names(est), estimate = as.numeric(est), se = as.numeric(se),+ ci_lo = est - 1.96 * se, ci_hi = est + 1.96 * se,+ p = 2 * pnorm(-abs(est / se)))+}++# weighted R^2 (final weight only) for a gaussian svyglm fit, used to quantify+# the predictive gain of one model over another. Averaged across PVs by caller.+wtd_r2 <- function(fit) {+ y <- model.response(model.frame(fit)); w <- weights(fit, "sampling")+ if (is.null(w)) w <- rep(1, length(y))+ mu <- weighted.mean(y, w)+ sse <- sum(w * (y - fitted(fit))^2); sst <- sum(w * (y - mu)^2)+ 1 - sse / sst+}diff --git a/case-studies/skills-mobility/README.md b/case-studies/skills-mobility/README.mdnew file mode 100644index 00000000..256f578f--- /dev/null+++ b/case-studies/skills-mobility/README.md@@ -0,0 +1,62 @@+# Skills mobility: an open-data case study for Open Ontologies++A reproducible analysis of intergenerational **educational and skills mobility**+in England, built on the genuinely open OECD PIAAC public-use files (2012 and+2023), and a worked example of the **Open Ontologies** harmonisation layer+applied to open public-sector data.++**Headline finding:** adults' numeracy is strongly predicted by their parents'+education, and the gap persists even among people who hold the *same*+qualification. Qualifications understate the advantage of social origin.++See [case-study.md](case-study.md) for the narrative (gov.tesseract.academy+house style) and [technical-note.md](technical-note.md) for full methods.++## What is here++```+config.R paths, the cross-cycle variable map, constants+R/+ 01_download.R fetch the open PIAAC CSV + SPSS files (idempotent)+ 02_harmonise.R build one harmonised analysis table on a 3-band ladder+ 03_analyse.R estimates: PVs by Rubin's rules, replicate-weight SEs+ 04_visualise.R accessible figures (PNG) + per-figure CSVs+ lib_piaac.R reusable PIAAC estimators (PVs, cycle-aware variance)+ontology/+ build_scheme.R generate the coded SKOS variable scheme+ validate_scheme.py load + check it in the Oxigraph engine, write coverage+ skills-mobility-scheme.ttl / .jsonld the published scheme+ entities.csv entity list (every concept traces to a PIAAC source)+ coverage-report.md engine-generated provenance + coverage report+outputs/+ figures/ 4 figures (PNG) and their underlying CSVs+ tables/ all estimate tables (CSV)+```++Raw data (`data/raw/`, 30-46 MB per file) is regenerated by `01_download.R` and+is not committed.++## Reproduce++Requires R (with `intsvy`, `survey`, `mitools`, `tidyverse`, `haven`, `jsonlite`)+and, for the ontology step, Python 3.11 with `pyoxigraph`.++```bash+Rscript R/01_download.R+Rscript R/02_harmonise.R+Rscript R/03_analyse.R+Rscript R/04_visualise.R+Rscript ontology/build_scheme.R+.venv/bin/python ontology/validate_scheme.py+```++## Provenance and honesty++- Data: OECD PIAAC public-use files only. No restricted or licensed microdata.+- Estimates validated against the published OECD England toplines.+- All results are descriptive associations, not causal claims.+- Every ontology concept traces to a documented PIAAC source variable and the+ official OECD value label. Coverage report records 100% provenance.++Source: OECD Survey of Adult Skills (PIAAC), England, 2012 and 2023. Analysis by+The Tesseract Academy, June 2026.diff --git a/case-studies/skills-mobility/case-study.md b/case-studies/skills-mobility/case-study.mdnew file mode 100644index 00000000..3beb9f03--- /dev/null+++ b/case-studies/skills-mobility/case-study.md@@ -0,0 +1,86 @@+---+title: "What adult skills reveal about social mobility that qualifications hide"+summary: "A reproducible analysis of the OECD Survey of Adult Skills (PIAAC) for England, showing that the gap in numeracy between people from higher and lower educated families persists even among adults who hold the same qualification. Built on genuinely open data, harmonised with the Open Ontologies platform."+date: 2026-06-17+audience: "Analysts, policymakers and researchers working on social mobility, adult skills and education."+---++# What adult skills reveal about social mobility that qualifications hide++## The finding, first++In England, a person's numeracy as an adult is still strongly shaped by their parents' education. Adults whose parents reached tertiary education score about 50 points higher on the OECD numeracy scale than adults whose parents did not finish upper secondary school. That is roughly one full standard deviation, the difference between a routine and a confident command of everyday numbers.++The result that matters for policy is narrower and sharper. Hold the qualification fixed, and the origin gap does not close. Among adults who hold the **same** highest qualification, those from a higher educated family still score about 37 points higher in numeracy. Qualifications, the measure most adult-skills and mobility statistics rely on, understate the advantage that family background confers. They are a real ladder, but two people on the same rung are not in the same place.++This case study quantifies that pattern using public, reproducible data, and documents the method openly so others can rerun and challenge it.++++## Challenge++The UK has rich administrative data on qualifications and a long-standing policy interest in social mobility, yet most mobility measurement leans on a single destination variable: the qualification a person ends up with. Qualifications are coarse. They tell you the certificate, not the capability behind it, and they are awarded under conditions that vary across decades and institutions.++The Survey of Adult Skills (PIAAC) offers something qualifications cannot: a direct, internationally comparable measure of what adults can actually do with literacy and numeracy, alongside a measure of social origin (parental education). That makes it possible to ask a question qualifications cannot answer on their own. Once you know someone's qualification, does family background still predict their skills and their labour-market position? If it does, qualification-based mobility statistics are measuring the rungs and missing the gaps between them.++The practical obstacles are real. The PIAAC public-use files are large, are released under two different cycles (2012 and 2023) with different variable names and codings, and require correct statistical handling of plausible values and replicate weights. Getting any of that wrong produces confident, wrong numbers. The harmonisation work, not the modelling, is where most analyses quietly fail.++## Intervention++We built a fully reproducible pipeline in R on the genuinely open PIAAC public-use files for England, for both the 2012 (Cycle 1) and 2023 (Cycle 2) surveys. The data are downloaded programmatically from the OECD public file store, with the source URLs, file sizes and access date recorded in a manifest. No restricted or licensed microdata is used.++Three design choices make the analysis trustworthy.++1. **Correct survey statistics throughout.** Proficiency is measured with ten plausible values, combined by Rubin's rules rather than averaged into a single score. Standard errors use the 80 replicate weights with the method appropriate to each cycle (the jackknife in 2012, Fay's balanced repeated replication in 2023). Every estimate carries a 95% confidence interval. We validated the pipeline against the published OECD topline: our England 2023 mean numeracy of 269 matches the published figure of 268, and reproduces the significant rise since 2012 that the OECD reports.++2. **A common origin-to-destination ladder.** Parental education and the respondent's own highest qualification are both placed on the same three bands (below upper secondary, upper secondary, tertiary). This is what lets us compare like with like and ask the "same qualification, different origin" question directly.++3. **An open, documented harmonisation layer.** Reconciling the 2012 and 2023 variables (for example, parental education is `PARED` in one file and `PAREDC2` in the other, and the education categories are coded differently) is exactly the kind of work that usually lives in undocumented script comments. We instead encoded it as a small, machine-readable variable scheme using the **Open Ontologies** platform, our open-source RDF and SPARQL toolchain. Every variable and every coded value is a concept that traces back to its PIAAC source variable, the official OECD value label, and the source file. The scheme is published alongside the analysis as SKOS Turtle and JSON-LD, and is validated by the same Oxigraph engine that powers the platform.++## Outcome++Four results, each descriptive and each with confidence intervals reported in the technical note.++**1. Skills rise steeply with social origin.** In 2023, mean numeracy in England was 242 for adults whose parents did not finish upper secondary, 279 for the middle group, and 293 for those with a tertiary-educated parent. The 2012 gradient was almost identical (239, 271, 289). The advantage of origin is large and stable across a decade.++**2. The advantage is mostly invisible to qualifications.** The raw High-versus-Low origin numeracy gap in 2023 is 47 points. After holding the respondent's own highest qualification constant, 32 points remain (95% confidence interval 22 to 43). About two-thirds of the origin gap is not captured by the qualification a person holds. The 2012 figures tell the same story: a 52-point gap, of which 35 points survive adjustment for qualification.++++**3. Among people with the same qualification, origin still predicts skill.** Within the upper-secondary group, adults from higher educated families score 38 points higher in numeracy than their lower-origin peers with the same qualification. Within the tertiary group, 37 points. The gap is real at the very levels of the system that are supposed to equalise.++**4. Skills carry information that qualifications do not.** Adding numeracy to a model that already contains a person's qualification, age and sex raises the share of variance explained in hourly earnings from 30.5% to 36.7%, and in reaching a professional or managerial occupation from 16.0% to 20.7%. Each standard deviation of numeracy is associated with almost a full earnings-decile step up, after qualifications are accounted for. Measuring skills directly tells you something about life chances that the certificate alone does not.++++There is one encouraging movement. The share of adults from lower educated families who reach a tertiary qualification rose from 23% in 2012 to 32% in 2023, narrowing the attainment gap with higher-origin adults (still 60%). Access to qualifications has widened. The skills gap behind the qualifications has not.++++## Assurance and ethics++- **Open data, no restricted licence.** The analysis uses only the OECD PIAAC public-use files, downloaded from the OECD public file store. The pipeline records the exact URLs, byte sizes and access date.+- **Descriptive, not causal.** Every result is an association. We do not claim that parental education causes the skills gap, only that the two are strongly and persistently related once qualifications are held constant. The technical note states the limitations in full.+- **Comparability stated honestly.** The 2012 UK sample covers England and Northern Ireland; the 2023 sample covers England. All cross-year comparisons restrict 2012 to England so the geography matches. Four-digit occupation and continuous earnings are suppressed in the 2023 public file, so those measures use one-digit occupation and earnings deciles for comparability across years.+- **Accessibility.** Figures use a colourblind-safe palette, large type and descriptive captions that double as alternative text. Every figure ships with the underlying numbers as a CSV.+- **No invented entities.** Each concept in the published variable scheme traces to a documented PIAAC source variable and official value label. The coverage report records 100% provenance.++## Reusable assets++Everything needed to reproduce, audit or extend this work is published with it.++| Asset | What it is |+| --- | --- |+| R pipeline (`R/01`-`04`) | Download, harmonise, analyse and visualise, end to end |+| `lib_piaac.R` | Reusable PIAAC estimators: plausible values by Rubin's rules, cycle-aware replicate-weight variance |+| Variable scheme (`ontology/`) | SKOS Turtle and JSON-LD coded harmonisation of the 2012 and 2023 variables, plus an entity list and coverage report |+| Figure data (`outputs/figures/*.csv`) | The numbers behind every chart |+| Technical note | Full methodology, variable definitions, weighting, and limitations |++The variable scheme is the part most likely to be reused. Any analyst working across the two PIAAC cycles for the UK can take the coded crosswalk and skip the most error-prone step. That is the point of doing the harmonisation in the open, as data, rather than burying it in a script.++## Method and reproducibility++The full method, including the plausible-value and replicate-weight handling, the validation against published OECD figures, and the limitations, is in the [technical note](technical-note.md). The pipeline runs with four commands and regenerates every number and figure in this case study from the raw open files.++*Source: OECD Programme for the International Assessment of Adult Competencies (PIAAC), public-use files, England, Cycle 1 (2012) and Cycle 2 (2023). Analysis by The Tesseract Academy, June 2026.*diff --git a/case-studies/skills-mobility/config.R b/case-studies/skills-mobility/config.Rnew file mode 100644index 00000000..67425f76--- /dev/null+++ b/case-studies/skills-mobility/config.R@@ -0,0 +1,83 @@+# config.R -- shared paths, constants, and the cross-cycle PIAAC variable map.+# Sourced by every script in R/. No analysis logic here.++suppressWarnings(suppressMessages({+ library(dplyr); library(tidyr); library(readr); library(stringr); library(purrr)+}))++`%||%` <- function(a, b) if (is.null(a)) b else a++# ---- paths -------------------------------------------------------------------+# Project root: env var override, else the working directory (scripts are run+# from the project root, e.g. `Rscript R/03_analyse.R`).+PROJ <- Sys.getenv("PIAAC_PROJ", unset = getwd())+if (!dir.exists(file.path(PROJ, "R")) && dir.exists("R")) PROJ <- getwd()+RAW_DIR <- file.path(PROJ, "data", "raw")+DERIV_DIR <- file.path(PROJ, "data", "derived")+OUT_FIG <- file.path(PROJ, "outputs", "figures")+OUT_TAB <- file.path(PROJ, "outputs", "tables")+ONTO_DIR <- file.path(PROJ, "ontology")+for (d in c(RAW_DIR, DERIV_DIR, OUT_FIG, OUT_TAB, ONTO_DIR)) dir.create(d, showWarnings = FALSE, recursive = TRUE)++# ---- data sources (open, no restricted licence) ------------------------------+# OECD PIAAC public-use files, served from the OECD web file store (open+# directory, not behind the Cloudflare-gated www.oecd.org CDN).+PIAAC_BASE <- "https://webfs.oecd.org/piaac"+SOURCES <- tibble::tribble(+ ~cycle, ~year, ~url, ~file, ~delim,+ "CY1", 2012L, paste0(PIAAC_BASE, "/cy1-puf-data/CSV/prggbrp1.csv"), "prggbrp1.csv", ",",+ "CY2", 2023L, paste0(PIAAC_BASE, "/cy2-puf-data/CSV/prggbrp2.csv"), "prggbrp2.csv", ";"+)+# SPSS files (carry embedded value labels; used once to source the ontology+# value-label definitions, not by the analysis pipeline). Served zipped.+SOURCES_SAV <- tibble::tribble(+ ~cycle, ~url, ~file,+ "CY1", paste0(PIAAC_BASE, "/cy1-puf-data/SPSS/prggbrp1_sav.zip"), "prggbrp1_sav.zip",+ "CY2", paste0(PIAAC_BASE, "/cy2-puf-data/SPSS/PRGGBRP2_sav.zip"), "PRGGBRP2_sav.zip"+)++# ---- replicate-weight design (PIAAC) -----------------------------------------+# PIAAC point estimates use the final sample weight SPFWT0; sampling variance+# uses the 80 jackknife replicate weights SPFWT1..SPFWT80 with the OECD formula+# Var = sum_{r=1}^{80} (theta_r - theta_0)^2 (no Fay factor).+# Proficiency uses the 10 plausible values, combined by Rubin's rules.+W_FINAL <- "SPFWT0"+W_REP <- sprintf("SPFWT%d", 1:80)+N_REP <- 80L+PV_NUM <- sprintf("PVNUM%d", 1:10) # numeracy plausible values+PV_LIT <- sprintf("PVLIT%d", 1:10) # literacy plausible values++# ---- cross-cycle variable map ------------------------------------------------+# Each analysis concept -> the source column in each cycle. Verified by direct+# inspection of the two CSV headers (CY1 1328 cols comma-delimited; CY2 2483+# cols semicolon-delimited). "_TC1" suffixes in CY2 are the OECD's own+# trend-coded-to-Cycle-1 derivations, so they are the comparable versions.+VARMAP <- tibble::tribble(+ ~concept, ~cy1, ~cy2, ~note,+ "parental_edu", "PARED", "PAREDC2", "highest ISCED of either parent, 3 bands (1 low,2 med,3 high); D/.d = don't know",+ "own_edu6", "EDCAT6", "EDCAT6_TC1", "own highest qualification, 6-category scheme (CY2 trend-coded to CY1)",+ "numeracy_pv", "PVNUM1:10", "PVNUM1:10", "numeracy proficiency, 10 plausible values (0-500)",+ "literacy_pv", "PVLIT1:10", "PVLIT1:10", "literacy proficiency, 10 plausible values (0-500)",+ "occ_isco1", "ISCO1C", "ISCO1C", "occupation, ISCO-08 1-digit (4-digit suppressed in CY2 PUF)",+ "occ_skill", "ISCOSKIL4", "ISCOSKIL4", "occupational skill level, 4 bands",+ "earn_hr_decile", "EARNHRDCL", "EARNHRDCLC2", "gross hourly earnings incl. bonus, national decile (continuous suppressed in CY2 PUF)",+ "sex", "GENDER_R", "GENDER_R", "1 male, 2 female",+ "age10", "AGEG10LFS", "AGEG10LFS", "age band, 10-year groups (1=16-25 ... 5=56-65)",+ "region_tl2", "REG_TL2", "REG_TL2", "OECD TL2 region; CY1 = England UKC-UKK + N.Ireland UKN; CY2 = England only",+ "final_weight", "SPFWT0", "SPFWT0", "final sample weight"+)++# ---- coded value schemes (sourced from SPSS value labels in 02_harmonise) -----+# Origin (parental education) -> 3 ordered bands.+PARED_LEVELS <- c("1" = "Low (neither parent above lower secondary)",+ "2" = "Medium (at least one parent upper secondary / post-secondary)",+ "3" = "High (at least one parent tertiary)")+# Own education collapsed to the same 3-band origin/destination ladder so the+# "same qualification" comparison is on a like-for-like scale. Mapping of the+# 6-category own-education variable to {low, medium, high} is set in 02_harmonise+# from the authoritative SPSS labels and recorded in the ontology scheme.++ENGLAND_TL2 <- c("UKC","UKD","UKE","UKF","UKG","UKH","UKI","UKJ","UKK")+NIRELAND_TL2 <- "UKN"++ACCESS_DATE <- "2026-06-17" # date the public-use files were downloadeddiff --git a/case-studies/skills-mobility/ontology/build_scheme.R b/case-studies/skills-mobility/ontology/build_scheme.Rnew file mode 100644index 00000000..450116ca--- /dev/null+++ b/case-studies/skills-mobility/ontology/build_scheme.R@@ -0,0 +1,126 @@+#!/usr/bin/env Rscript+# ontology/build_scheme.R -- generate the coded, machine-readable variable+# scheme for the analysis as a SKOS concept scheme. This is the open-ontologies+# "harmonisation layer": it turns the messy PIAAC source variables (different+# names and codings across the 2012 and 2023 files) into one documented,+# coded scheme on a common 3-band ladder. Every concept traces to a PIAAC+# source variable, its OECD value label, and the source file URL. No entity is+# invented. Outputs SKOS Turtle + JSON-LD + an entity-list CSV; the engine step+# (validate_scheme.py) then loads it into Oxigraph and writes the coverage report.++source("config.R")+suppressMessages(library(jsonlite))++hmap <- read.csv(file.path(OUT_TAB, "harmonisation_map.csv"), stringsAsFactors = FALSE)+BASE <- "https://gov.tesseract.academy/ns/skills-mobility"+src_url <- function(cy) SOURCES$url[SOURCES$cycle == cy]++# ---- variable-level concepts (top concepts) ----------------------------------+vars <- VARMAP[!grepl(":", VARMAP$cy1) | VARMAP$concept %in% c("numeracy_pv","literacy_pv"), ]+# label/definition per analysis variable+VARDEF <- c(+ parental_edu = "Origin: highest education attained by either parent, 3 bands (the social-origin measure).",+ own_edu6 = "Destination: respondent's own highest qualification, 6-category scheme collapsed to 3 bands.",+ numeracy_pv = "Destination: numeracy proficiency (0-500), 10 plausible values.",+ literacy_pv = "Destination: literacy proficiency (0-500), 10 plausible values.",+ occ_isco1 = "Destination: occupation, ISCO-08 major group (1-digit).",+ occ_skill = "Destination: occupational skill level, 4 bands.",+ earn_hr_decile = "Destination: gross hourly earnings, national decile (1 = lowest, 10 = highest).",+ sex = "Analytical control: sex.", age10 = "Analytical control: age band (10-year).",+ region_tl2 = "Analytical control / breakdown: OECD TL2 region.",+ final_weight = "Final sample weight (point estimates)."+)+concept_id <- function(x) gsub("[^A-Za-z0-9]", "-", x)++# ---- build Turtle ------------------------------------------------------------+ttl <- c(+ "@prefix skos: <http://www.w3.org/2004/02/skos/core#> .",+ "@prefix dct: <http://purl.org/dc/terms/> .",+ "@prefix prov: <http://www.w3.org/ns/prov#> .",+ "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .",+ paste0("@prefix sm: <", BASE, "#> ."),+ "",+ paste0("sm:scheme a skos:ConceptScheme ;"),+ ' dct:title "PIAAC educational and skills mobility variable scheme" ;',+ ' dct:description "Coded harmonisation of the OECD PIAAC public-use variables used in the Tesseract Academy intergenerational educational and skills mobility case study, across Cycle 1 (2012) and Cycle 2 (2023)." ;',+ paste0(' dct:source <', PIAAC_BASE, '> ;'),+ paste0(' dct:created "', ACCESS_DATE, '"^^<http://www.w3.org/2001/XMLSchema#date> .'),+ ""+)+esc <- function(s) gsub('"', '\\\\"', s)+entities <- list()++emit_concept <- function(id, label, definition, broader = NULL,+ notation_cy1 = NA, notation_cy2 = NA, src = NULL, top = FALSE) {+ lines <- c(paste0("sm:", id, " a skos:Concept ;"),+ paste0(' skos:prefLabel "', esc(label), '" ;'),+ paste0(' skos:definition "', esc(definition), '" ;'),+ " skos:inScheme sm:scheme ;")+ if (top) lines <- c(lines, " skos:topConceptOf sm:scheme ;")+ if (!is.null(broader)) lines <- c(lines, paste0(" skos:broader sm:", broader, " ;"))+ if (!is.na(notation_cy1)) lines <- c(lines, paste0(' skos:notation "', notation_cy1, '" ; # PIAAC 2012 source'))+ if (!is.na(notation_cy2)) lines <- c(lines, paste0(' skos:notation "', notation_cy2, '" ; # PIAAC 2023 source'))+ if (!is.null(src)) for (u in src) lines <- c(lines, paste0(" prov:wasDerivedFrom <", u, "> ;"))+ lines[length(lines)] <- sub(" ;$", " .", lines[length(lines)]) # close+ entities[[length(entities) + 1]] <<- data.frame(+ id = id, type = if (is.null(broader)) "variable" else "coded_value",+ prefLabel = label, broader = broader %||% "", notation_cy1 = notation_cy1 %||% "",+ notation_cy2 = notation_cy2 %||% "", definition = definition,+ source = paste(src, collapse = "; "), stringsAsFactors = FALSE)+ c(lines, "")+}++# variable concepts+for (i in seq_len(nrow(vars))) {+ v <- vars[i, ]+ ttl <- c(ttl, emit_concept(+ id = concept_id(v$concept), label = v$concept, definition = VARDEF[[v$concept]] %||% v$note,+ notation_cy1 = v$cy1, notation_cy2 = v$cy2,+ src = c(src_url("CY1"), src_url("CY2")), top = TRUE))+}+# coded-value concepts (from the harmonisation map)+for (i in seq_len(nrow(hmap))) {+ r <- hmap[i, ]+ vid <- switch(r$variable, origin = "parental_edu", own_edu = "own_edu6",+ occ_skill_rank = "occ_skill", r$variable)+ cid <- concept_id(paste0(r$variable, "-", r$code))+ ttl <- c(ttl, emit_concept(+ id = cid, label = paste0(r$variable, " = ", r$band, " (code ", r$code, ")"),+ definition = r$definition, broader = concept_id(vid),+ notation_cy1 = r$source_cy1, notation_cy2 = r$source_cy2,+ src = c(src_url("CY1"), src_url("CY2"))))+}+writeLines(ttl, file.path(ONTO_DIR, "skills-mobility-scheme.ttl"))++# ---- entity-list CSV ---------------------------------------------------------+ent <- do.call(rbind, entities)+write.csv(ent, file.path(ONTO_DIR, "entities.csv"), row.names = FALSE)++# ---- JSON-LD (compact SKOS graph) --------------------------------------------+ctx <- list(skos = "http://www.w3.org/2004/02/skos/core#",+ dct = "http://purl.org/dc/terms/", prov = "http://www.w3.org/ns/prov#",+ sm = paste0(BASE, "#"),+ prefLabel = "skos:prefLabel", definition = "skos:definition",+ broader = list("@id" = "skos:broader", "@type" = "@id"),+ notation = "skos:notation",+ wasDerivedFrom = list("@id" = "prov:wasDerivedFrom", "@type" = "@id"))+graph <- lapply(seq_len(nrow(ent)), function(i) {+ r <- ent[i, ]+ obj <- list("@id" = paste0("sm:", r$id),+ "@type" = "skos:Concept",+ prefLabel = r$prefLabel, definition = r$definition,+ notation = unique(Filter(nzchar, c(r$notation_cy1, r$notation_cy2))),+ wasDerivedFrom = strsplit(r$source, "; ")[[1]])+ if (nzchar(r$broader)) obj$broader <- paste0("sm:", r$broader)+ obj+})+jsonld <- list("@context" = ctx,+ "@graph" = c(list(list("@id" = "sm:scheme", "@type" = "skos:ConceptScheme",+ "dct:title" = "PIAAC educational and skills mobility variable scheme")),+ graph))+write_json(jsonld, file.path(ONTO_DIR, "skills-mobility-scheme.jsonld"),+ auto_unbox = TRUE, pretty = TRUE)++message(sprintf("Scheme built: %d concepts (%d variables, %d coded values).",+ nrow(ent), sum(ent$type=="variable"), sum(ent$type=="coded_value")))+`%||%` <- function(a,b) if (is.null(a)) b else adiff --git a/case-studies/skills-mobility/ontology/coverage-report.md b/case-studies/skills-mobility/ontology/coverage-report.mdnew file mode 100644index 00000000..0cb57823--- /dev/null+++ b/case-studies/skills-mobility/ontology/coverage-report.md@@ -0,0 +1,37 @@+# Coverage report: PIAAC skills-mobility variable scheme++Generated 2026-06-17 by the open-ontologies engine (Oxigraph via open-ontologies-lite).++## Scheme size++- Syntactic validation: **valid**+- RDF triples loaded: **218** (engine stats: {'triples': 218, 'classes': 0, 'properties': 0, 'individuals': 26})+- skos:Concept entities: **25** (11 variables, 14 coded values)++## Provenance completeness (no entity invented)++- Concepts with a `prov:wasDerivedFrom` source file: **25 / 25 (100.0%)**+- Concepts carrying both a 2012 and a 2023 PIAAC source variable (cross-cycle harmonised): **13**++## Variables and their coded values++| Variable | Coded values |+| --- | ---: |+| own-edu6 | 7 |+| occ-skill | 4 |+| parental-edu | 3 |+| earn-hr-decile | 0 |+| region-tl2 | 0 |+| sex | 0 |+| final-weight | 0 |+| age10 | 0 |+| literacy-pv | 0 |+| occ-isco1 | 0 |+| numeracy-pv | 0 |++## Lint (engine quality checks)++- No lint issues: every concept has a label and a definition.++---+Reproduce: `Rscript ontology/build_scheme.R && .venv/bin/python ontology/validate_scheme.py`diff --git a/case-studies/skills-mobility/ontology/entities.csv b/case-studies/skills-mobility/ontology/entities.csvnew file mode 100644index 00000000..94bc8c8e--- /dev/null+++ b/case-studies/skills-mobility/ontology/entities.csv@@ -0,0 +1,26 @@+"id","type","prefLabel","broader","notation_cy1","notation_cy2","definition","source"+"parental-edu","variable","parental_edu","","PARED","PAREDC2","Origin: highest education attained by either parent, 3 bands (the social-origin measure).","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"own-edu6","variable","own_edu6","","EDCAT6","EDCAT6_TC1","Destination: respondent's own highest qualification, 6-category scheme collapsed to 3 bands.","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"numeracy-pv","variable","numeracy_pv","","PVNUM1:10","PVNUM1:10","Destination: numeracy proficiency (0-500), 10 plausible values.","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"literacy-pv","variable","literacy_pv","","PVLIT1:10","PVLIT1:10","Destination: literacy proficiency (0-500), 10 plausible values.","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"occ-isco1","variable","occ_isco1","","ISCO1C","ISCO1C","Destination: occupation, ISCO-08 major group (1-digit).","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"occ-skill","variable","occ_skill","","ISCOSKIL4","ISCOSKIL4","Destination: occupational skill level, 4 bands.","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"earn-hr-decile","variable","earn_hr_decile","","EARNHRDCL","EARNHRDCLC2","Destination: gross hourly earnings, national decile (1 = lowest, 10 = highest).","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"sex","variable","sex","","GENDER_R","GENDER_R","Analytical control: sex.","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"age10","variable","age10","","AGEG10LFS","AGEG10LFS","Analytical control: age band (10-year).","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"region-tl2","variable","region_tl2","","REG_TL2","REG_TL2","Analytical control / breakdown: OECD TL2 region.","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"final-weight","variable","final_weight","","SPFWT0","SPFWT0","Final sample weight (point estimates).","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"origin-1","coded_value","origin = Low (code 1)","parental-edu","PARED","PAREDC2","Neither parent attained upper secondary","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"origin-2","coded_value","origin = Medium (code 2)","parental-edu","PARED","PAREDC2","At least one parent upper secondary / post-secondary non-tertiary","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"origin-3","coded_value","origin = High (code 3)","parental-edu","PARED","PAREDC2","At least one parent attained tertiary","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"own-edu-1","coded_value","own_edu = Low (code 1)","own-edu6","EDCAT6","EDCAT6_TC1","Lower secondary or less (ISCED 1,2,3C short)","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"own-edu-2","coded_value","own_edu = Medium (code 2)","own-edu6","EDCAT6","EDCAT6_TC1","Upper secondary (ISCED 3A-B, C long)","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"own-edu-3","coded_value","own_edu = Medium (code 3)","own-edu6","EDCAT6","EDCAT6_TC1","Post-secondary non-tertiary (ISCED 4)","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"own-edu-4","coded_value","own_edu = High (code 4)","own-edu6","EDCAT6","EDCAT6_TC1","Tertiary professional (ISCED 5B)","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"own-edu-5","coded_value","own_edu = High (code 5)","own-edu6","EDCAT6","EDCAT6_TC1","Tertiary bachelor (ISCED 5A)","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"own-edu-6","coded_value","own_edu = High (code 6)","own-edu6","EDCAT6","EDCAT6_TC1","Tertiary master/research (ISCED 5A/6)","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"own-edu-7","coded_value","own_edu = High (code 7)","own-edu6","EDCAT6","EDCAT6_TC1","Tertiary bachelor/master/research grouped (ISCED 5A/6)","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"occ-skill-rank-1","coded_value","occ_skill_rank = 4 (code 1)","occ-skill","ISCOSKIL4","ISCOSKIL4","Skilled occupations","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"occ-skill-rank-2","coded_value","occ_skill_rank = 3 (code 2)","occ-skill","ISCOSKIL4","ISCOSKIL4","Semi-skilled white-collar","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"occ-skill-rank-3","coded_value","occ_skill_rank = 2 (code 3)","occ-skill","ISCOSKIL4","ISCOSKIL4","Semi-skilled blue-collar","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"+"occ-skill-rank-4","coded_value","occ_skill_rank = 1 (code 4)","occ-skill","ISCOSKIL4","ISCOSKIL4","Elementary occupations","https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv; https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"diff --git a/case-studies/skills-mobility/ontology/skills-mobility-scheme.jsonld b/case-studies/skills-mobility/ontology/skills-mobility-scheme.jsonldnew file mode 100644index 00000000..30fd8d90--- /dev/null+++ b/case-studies/skills-mobility/ontology/skills-mobility-scheme.jsonld@@ -0,0 +1,240 @@+{+ "@context": {+ "skos": "http://www.w3.org/2004/02/skos/core#",+ "dct": "http://purl.org/dc/terms/",+ "prov": "http://www.w3.org/ns/prov#",+ "sm": "https://gov.tesseract.academy/ns/skills-mobility#",+ "prefLabel": "skos:prefLabel",+ "definition": "skos:definition",+ "broader": {+ "@id": "skos:broader",+ "@type": "@id"+ },+ "notation": "skos:notation",+ "wasDerivedFrom": {+ "@id": "prov:wasDerivedFrom",+ "@type": "@id"+ }+ },+ "@graph": [+ {+ "@id": "sm:scheme",+ "@type": "skos:ConceptScheme",+ "dct:title": "PIAAC educational and skills mobility variable scheme"+ },+ {+ "@id": "sm:parental-edu",+ "@type": "skos:Concept",+ "prefLabel": "parental_edu",+ "definition": "Origin: highest education attained by either parent, 3 bands (the social-origin measure).",+ "notation": ["PARED", "PAREDC2"],+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"]+ },+ {+ "@id": "sm:own-edu6",+ "@type": "skos:Concept",+ "prefLabel": "own_edu6",+ "definition": "Destination: respondent's own highest qualification, 6-category scheme collapsed to 3 bands.",+ "notation": ["EDCAT6", "EDCAT6_TC1"],+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"]+ },+ {+ "@id": "sm:numeracy-pv",+ "@type": "skos:Concept",+ "prefLabel": "numeracy_pv",+ "definition": "Destination: numeracy proficiency (0-500), 10 plausible values.",+ "notation": "PVNUM1:10",+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"]+ },+ {+ "@id": "sm:literacy-pv",+ "@type": "skos:Concept",+ "prefLabel": "literacy_pv",+ "definition": "Destination: literacy proficiency (0-500), 10 plausible values.",+ "notation": "PVLIT1:10",+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"]+ },+ {+ "@id": "sm:occ-isco1",+ "@type": "skos:Concept",+ "prefLabel": "occ_isco1",+ "definition": "Destination: occupation, ISCO-08 major group (1-digit).",+ "notation": "ISCO1C",+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"]+ },+ {+ "@id": "sm:occ-skill",+ "@type": "skos:Concept",+ "prefLabel": "occ_skill",+ "definition": "Destination: occupational skill level, 4 bands.",+ "notation": "ISCOSKIL4",+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"]+ },+ {+ "@id": "sm:earn-hr-decile",+ "@type": "skos:Concept",+ "prefLabel": "earn_hr_decile",+ "definition": "Destination: gross hourly earnings, national decile (1 = lowest, 10 = highest).",+ "notation": ["EARNHRDCL", "EARNHRDCLC2"],+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"]+ },+ {+ "@id": "sm:sex",+ "@type": "skos:Concept",+ "prefLabel": "sex",+ "definition": "Analytical control: sex.",+ "notation": "GENDER_R",+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"]+ },+ {+ "@id": "sm:age10",+ "@type": "skos:Concept",+ "prefLabel": "age10",+ "definition": "Analytical control: age band (10-year).",+ "notation": "AGEG10LFS",+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"]+ },+ {+ "@id": "sm:region-tl2",+ "@type": "skos:Concept",+ "prefLabel": "region_tl2",+ "definition": "Analytical control / breakdown: OECD TL2 region.",+ "notation": "REG_TL2",+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"]+ },+ {+ "@id": "sm:final-weight",+ "@type": "skos:Concept",+ "prefLabel": "final_weight",+ "definition": "Final sample weight (point estimates).",+ "notation": "SPFWT0",+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"]+ },+ {+ "@id": "sm:origin-1",+ "@type": "skos:Concept",+ "prefLabel": "origin = Low (code 1)",+ "definition": "Neither parent attained upper secondary",+ "notation": ["PARED", "PAREDC2"],+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"],+ "broader": "sm:parental-edu"+ },+ {+ "@id": "sm:origin-2",+ "@type": "skos:Concept",+ "prefLabel": "origin = Medium (code 2)",+ "definition": "At least one parent upper secondary / post-secondary non-tertiary",+ "notation": ["PARED", "PAREDC2"],+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"],+ "broader": "sm:parental-edu"+ },+ {+ "@id": "sm:origin-3",+ "@type": "skos:Concept",+ "prefLabel": "origin = High (code 3)",+ "definition": "At least one parent attained tertiary",+ "notation": ["PARED", "PAREDC2"],+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"],+ "broader": "sm:parental-edu"+ },+ {+ "@id": "sm:own-edu-1",+ "@type": "skos:Concept",+ "prefLabel": "own_edu = Low (code 1)",+ "definition": "Lower secondary or less (ISCED 1,2,3C short)",+ "notation": ["EDCAT6", "EDCAT6_TC1"],+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"],+ "broader": "sm:own-edu6"+ },+ {+ "@id": "sm:own-edu-2",+ "@type": "skos:Concept",+ "prefLabel": "own_edu = Medium (code 2)",+ "definition": "Upper secondary (ISCED 3A-B, C long)",+ "notation": ["EDCAT6", "EDCAT6_TC1"],+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"],+ "broader": "sm:own-edu6"+ },+ {+ "@id": "sm:own-edu-3",+ "@type": "skos:Concept",+ "prefLabel": "own_edu = Medium (code 3)",+ "definition": "Post-secondary non-tertiary (ISCED 4)",+ "notation": ["EDCAT6", "EDCAT6_TC1"],+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"],+ "broader": "sm:own-edu6"+ },+ {+ "@id": "sm:own-edu-4",+ "@type": "skos:Concept",+ "prefLabel": "own_edu = High (code 4)",+ "definition": "Tertiary professional (ISCED 5B)",+ "notation": ["EDCAT6", "EDCAT6_TC1"],+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"],+ "broader": "sm:own-edu6"+ },+ {+ "@id": "sm:own-edu-5",+ "@type": "skos:Concept",+ "prefLabel": "own_edu = High (code 5)",+ "definition": "Tertiary bachelor (ISCED 5A)",+ "notation": ["EDCAT6", "EDCAT6_TC1"],+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"],+ "broader": "sm:own-edu6"+ },+ {+ "@id": "sm:own-edu-6",+ "@type": "skos:Concept",+ "prefLabel": "own_edu = High (code 6)",+ "definition": "Tertiary master/research (ISCED 5A/6)",+ "notation": ["EDCAT6", "EDCAT6_TC1"],+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"],+ "broader": "sm:own-edu6"+ },+ {+ "@id": "sm:own-edu-7",+ "@type": "skos:Concept",+ "prefLabel": "own_edu = High (code 7)",+ "definition": "Tertiary bachelor/master/research grouped (ISCED 5A/6)",+ "notation": ["EDCAT6", "EDCAT6_TC1"],+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"],+ "broader": "sm:own-edu6"+ },+ {+ "@id": "sm:occ-skill-rank-1",+ "@type": "skos:Concept",+ "prefLabel": "occ_skill_rank = 4 (code 1)",+ "definition": "Skilled occupations",+ "notation": "ISCOSKIL4",+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"],+ "broader": "sm:occ-skill"+ },+ {+ "@id": "sm:occ-skill-rank-2",+ "@type": "skos:Concept",+ "prefLabel": "occ_skill_rank = 3 (code 2)",+ "definition": "Semi-skilled white-collar",+ "notation": "ISCOSKIL4",+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"],+ "broader": "sm:occ-skill"+ },+ {+ "@id": "sm:occ-skill-rank-3",+ "@type": "skos:Concept",+ "prefLabel": "occ_skill_rank = 2 (code 3)",+ "definition": "Semi-skilled blue-collar",+ "notation": "ISCOSKIL4",+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"],+ "broader": "sm:occ-skill"+ },+ {+ "@id": "sm:occ-skill-rank-4",+ "@type": "skos:Concept",+ "prefLabel": "occ_skill_rank = 1 (code 4)",+ "definition": "Elementary occupations",+ "notation": "ISCOSKIL4",+ "wasDerivedFrom": ["https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv", "https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv"],+ "broader": "sm:occ-skill"+ }+ ]+}diff --git a/case-studies/skills-mobility/ontology/skills-mobility-scheme.ttl b/case-studies/skills-mobility/ontology/skills-mobility-scheme.ttlnew file mode 100644index 00000000..6c13e0ca--- /dev/null+++ b/case-studies/skills-mobility/ontology/skills-mobility-scheme.ttl@@ -0,0 +1,262 @@+@prefix skos: <http://www.w3.org/2004/02/skos/core#> .+@prefix dct: <http://purl.org/dc/terms/> .+@prefix prov: <http://www.w3.org/ns/prov#> .+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .+@prefix sm: <https://gov.tesseract.academy/ns/skills-mobility#> .++sm:scheme a skos:ConceptScheme ;+ dct:title "PIAAC educational and skills mobility variable scheme" ;+ dct:description "Coded harmonisation of the OECD PIAAC public-use variables used in the Tesseract Academy intergenerational educational and skills mobility case study, across Cycle 1 (2012) and Cycle 2 (2023)." ;+ dct:source <https://webfs.oecd.org/piaac> ;+ dct:created "2026-06-17"^^<http://www.w3.org/2001/XMLSchema#date> .++sm:parental-edu a skos:Concept ;+ skos:prefLabel "parental_edu" ;+ skos:definition "Origin: highest education attained by either parent, 3 bands (the social-origin measure)." ;+ skos:inScheme sm:scheme ;+ skos:topConceptOf sm:scheme ;+ skos:notation "PARED" ; # PIAAC 2012 source+ skos:notation "PAREDC2" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:own-edu6 a skos:Concept ;+ skos:prefLabel "own_edu6" ;+ skos:definition "Destination: respondent's own highest qualification, 6-category scheme collapsed to 3 bands." ;+ skos:inScheme sm:scheme ;+ skos:topConceptOf sm:scheme ;+ skos:notation "EDCAT6" ; # PIAAC 2012 source+ skos:notation "EDCAT6_TC1" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:numeracy-pv a skos:Concept ;+ skos:prefLabel "numeracy_pv" ;+ skos:definition "Destination: numeracy proficiency (0-500), 10 plausible values." ;+ skos:inScheme sm:scheme ;+ skos:topConceptOf sm:scheme ;+ skos:notation "PVNUM1:10" ; # PIAAC 2012 source+ skos:notation "PVNUM1:10" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:literacy-pv a skos:Concept ;+ skos:prefLabel "literacy_pv" ;+ skos:definition "Destination: literacy proficiency (0-500), 10 plausible values." ;+ skos:inScheme sm:scheme ;+ skos:topConceptOf sm:scheme ;+ skos:notation "PVLIT1:10" ; # PIAAC 2012 source+ skos:notation "PVLIT1:10" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:occ-isco1 a skos:Concept ;+ skos:prefLabel "occ_isco1" ;+ skos:definition "Destination: occupation, ISCO-08 major group (1-digit)." ;+ skos:inScheme sm:scheme ;+ skos:topConceptOf sm:scheme ;+ skos:notation "ISCO1C" ; # PIAAC 2012 source+ skos:notation "ISCO1C" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:occ-skill a skos:Concept ;+ skos:prefLabel "occ_skill" ;+ skos:definition "Destination: occupational skill level, 4 bands." ;+ skos:inScheme sm:scheme ;+ skos:topConceptOf sm:scheme ;+ skos:notation "ISCOSKIL4" ; # PIAAC 2012 source+ skos:notation "ISCOSKIL4" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:earn-hr-decile a skos:Concept ;+ skos:prefLabel "earn_hr_decile" ;+ skos:definition "Destination: gross hourly earnings, national decile (1 = lowest, 10 = highest)." ;+ skos:inScheme sm:scheme ;+ skos:topConceptOf sm:scheme ;+ skos:notation "EARNHRDCL" ; # PIAAC 2012 source+ skos:notation "EARNHRDCLC2" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:sex a skos:Concept ;+ skos:prefLabel "sex" ;+ skos:definition "Analytical control: sex." ;+ skos:inScheme sm:scheme ;+ skos:topConceptOf sm:scheme ;+ skos:notation "GENDER_R" ; # PIAAC 2012 source+ skos:notation "GENDER_R" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:age10 a skos:Concept ;+ skos:prefLabel "age10" ;+ skos:definition "Analytical control: age band (10-year)." ;+ skos:inScheme sm:scheme ;+ skos:topConceptOf sm:scheme ;+ skos:notation "AGEG10LFS" ; # PIAAC 2012 source+ skos:notation "AGEG10LFS" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:region-tl2 a skos:Concept ;+ skos:prefLabel "region_tl2" ;+ skos:definition "Analytical control / breakdown: OECD TL2 region." ;+ skos:inScheme sm:scheme ;+ skos:topConceptOf sm:scheme ;+ skos:notation "REG_TL2" ; # PIAAC 2012 source+ skos:notation "REG_TL2" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:final-weight a skos:Concept ;+ skos:prefLabel "final_weight" ;+ skos:definition "Final sample weight (point estimates)." ;+ skos:inScheme sm:scheme ;+ skos:topConceptOf sm:scheme ;+ skos:notation "SPFWT0" ; # PIAAC 2012 source+ skos:notation "SPFWT0" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:origin-1 a skos:Concept ;+ skos:prefLabel "origin = Low (code 1)" ;+ skos:definition "Neither parent attained upper secondary" ;+ skos:inScheme sm:scheme ;+ skos:broader sm:parental-edu ;+ skos:notation "PARED" ; # PIAAC 2012 source+ skos:notation "PAREDC2" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:origin-2 a skos:Concept ;+ skos:prefLabel "origin = Medium (code 2)" ;+ skos:definition "At least one parent upper secondary / post-secondary non-tertiary" ;+ skos:inScheme sm:scheme ;+ skos:broader sm:parental-edu ;+ skos:notation "PARED" ; # PIAAC 2012 source+ skos:notation "PAREDC2" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:origin-3 a skos:Concept ;+ skos:prefLabel "origin = High (code 3)" ;+ skos:definition "At least one parent attained tertiary" ;+ skos:inScheme sm:scheme ;+ skos:broader sm:parental-edu ;+ skos:notation "PARED" ; # PIAAC 2012 source+ skos:notation "PAREDC2" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:own-edu-1 a skos:Concept ;+ skos:prefLabel "own_edu = Low (code 1)" ;+ skos:definition "Lower secondary or less (ISCED 1,2,3C short)" ;+ skos:inScheme sm:scheme ;+ skos:broader sm:own-edu6 ;+ skos:notation "EDCAT6" ; # PIAAC 2012 source+ skos:notation "EDCAT6_TC1" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:own-edu-2 a skos:Concept ;+ skos:prefLabel "own_edu = Medium (code 2)" ;+ skos:definition "Upper secondary (ISCED 3A-B, C long)" ;+ skos:inScheme sm:scheme ;+ skos:broader sm:own-edu6 ;+ skos:notation "EDCAT6" ; # PIAAC 2012 source+ skos:notation "EDCAT6_TC1" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:own-edu-3 a skos:Concept ;+ skos:prefLabel "own_edu = Medium (code 3)" ;+ skos:definition "Post-secondary non-tertiary (ISCED 4)" ;+ skos:inScheme sm:scheme ;+ skos:broader sm:own-edu6 ;+ skos:notation "EDCAT6" ; # PIAAC 2012 source+ skos:notation "EDCAT6_TC1" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:own-edu-4 a skos:Concept ;+ skos:prefLabel "own_edu = High (code 4)" ;+ skos:definition "Tertiary professional (ISCED 5B)" ;+ skos:inScheme sm:scheme ;+ skos:broader sm:own-edu6 ;+ skos:notation "EDCAT6" ; # PIAAC 2012 source+ skos:notation "EDCAT6_TC1" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:own-edu-5 a skos:Concept ;+ skos:prefLabel "own_edu = High (code 5)" ;+ skos:definition "Tertiary bachelor (ISCED 5A)" ;+ skos:inScheme sm:scheme ;+ skos:broader sm:own-edu6 ;+ skos:notation "EDCAT6" ; # PIAAC 2012 source+ skos:notation "EDCAT6_TC1" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:own-edu-6 a skos:Concept ;+ skos:prefLabel "own_edu = High (code 6)" ;+ skos:definition "Tertiary master/research (ISCED 5A/6)" ;+ skos:inScheme sm:scheme ;+ skos:broader sm:own-edu6 ;+ skos:notation "EDCAT6" ; # PIAAC 2012 source+ skos:notation "EDCAT6_TC1" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:own-edu-7 a skos:Concept ;+ skos:prefLabel "own_edu = High (code 7)" ;+ skos:definition "Tertiary bachelor/master/research grouped (ISCED 5A/6)" ;+ skos:inScheme sm:scheme ;+ skos:broader sm:own-edu6 ;+ skos:notation "EDCAT6" ; # PIAAC 2012 source+ skos:notation "EDCAT6_TC1" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:occ-skill-rank-1 a skos:Concept ;+ skos:prefLabel "occ_skill_rank = 4 (code 1)" ;+ skos:definition "Skilled occupations" ;+ skos:inScheme sm:scheme ;+ skos:broader sm:occ-skill ;+ skos:notation "ISCOSKIL4" ; # PIAAC 2012 source+ skos:notation "ISCOSKIL4" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:occ-skill-rank-2 a skos:Concept ;+ skos:prefLabel "occ_skill_rank = 3 (code 2)" ;+ skos:definition "Semi-skilled white-collar" ;+ skos:inScheme sm:scheme ;+ skos:broader sm:occ-skill ;+ skos:notation "ISCOSKIL4" ; # PIAAC 2012 source+ skos:notation "ISCOSKIL4" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:occ-skill-rank-3 a skos:Concept ;+ skos:prefLabel "occ_skill_rank = 2 (code 3)" ;+ skos:definition "Semi-skilled blue-collar" ;+ skos:inScheme sm:scheme ;+ skos:broader sm:occ-skill ;+ skos:notation "ISCOSKIL4" ; # PIAAC 2012 source+ skos:notation "ISCOSKIL4" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .++sm:occ-skill-rank-4 a skos:Concept ;+ skos:prefLabel "occ_skill_rank = 1 (code 4)" ;+ skos:definition "Elementary occupations" ;+ skos:inScheme sm:scheme ;+ skos:broader sm:occ-skill ;+ skos:notation "ISCOSKIL4" ; # PIAAC 2012 source+ skos:notation "ISCOSKIL4" ; # PIAAC 2023 source+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy1-puf-data/CSV/prggbrp1.csv> ;+ prov:wasDerivedFrom <https://webfs.oecd.org/piaac/cy2-puf-data/CSV/prggbrp2.csv> .+diff --git a/case-studies/skills-mobility/ontology/validate_scheme.py b/case-studies/skills-mobility/ontology/validate_scheme.pynew file mode 100644index 00000000..ab4d5b2c--- /dev/null+++ b/case-studies/skills-mobility/ontology/validate_scheme.py@@ -0,0 +1,74 @@+#!/usr/bin/env python3+"""Load the generated SKOS scheme into the open-ontologies engine (Oxigraph),+run coverage and provenance checks via SPARQL, and write coverage-report.md.++This is the step that makes the open-ontologies platform genuinely *applied* to+the open PIAAC data: the same Oxigraph engine that powers the project validates+and reports on the harmonisation scheme."""+import sys, os, datetime+HERE = os.path.dirname(os.path.abspath(__file__))+sys.path.insert(0, "/Users/fabio/projects/open-ontologies/python/src")+from open_ontologies_lite import OntologyEngine++ttl_path = os.path.join(HERE, "skills-mobility-scheme.ttl")+ttl = open(ttl_path).read()++# validate syntactically, then load+vr = OntologyEngine.validate(ttl, "turtle")+eng = OntologyEngine()+n_triples = eng.load(ttl, "turtle")+stats = eng.stats()++Q = lambda s: eng.query(s)["rows"]+PRE = """PREFIX skos: <http://www.w3.org/2004/02/skos/core#>+PREFIX prov: <http://www.w3.org/ns/prov#>+PREFIX dct: <http://purl.org/dc/terms/>\n"""++n_concepts = int(Q(PRE + "SELECT (COUNT(?c) AS ?n) WHERE { ?c a skos:Concept }")[0]["n"].split("^")[0].strip('"'))+n_vars = len(Q(PRE + "SELECT ?c WHERE { ?c skos:topConceptOf ?s }"))+n_values = len(Q(PRE + "SELECT ?c WHERE { ?c skos:broader ?b }"))+n_prov = len(Q(PRE + "SELECT DISTINCT ?c WHERE { ?c a skos:Concept ; prov:wasDerivedFrom ?u }"))+# concepts carrying both a 2012 and a 2023 source notation (>=2 notations)+both_cycle = len(Q(PRE + """SELECT ?c WHERE { ?c a skos:Concept ; skos:notation ?a, ?b+ FILTER(STR(?a) != STR(?b)) } GROUP BY ?c"""))+# variable -> count of narrower coded values+vc = Q(PRE + """SELECT ?v (COUNT(?n) AS ?k) WHERE { ?v skos:topConceptOf ?s .+ OPTIONAL { ?n skos:broader ?v } } GROUP BY ?v ORDER BY DESC(?k)""")+lint = eng.lint()++prov_pct = round(100 * n_prov / n_concepts, 1) if n_concepts else 0.0+lab = lambda iri: iri.rsplit("#", 1)[-1].rstrip(">")++lines = []+w = lines.append+w("# Coverage report: PIAAC skills-mobility variable scheme\n")+w(f"Generated {datetime.date.today().isoformat()} by the open-ontologies engine "+ f"(Oxigraph via open-ontologies-lite).\n")+w("## Scheme size\n")+w(f"- Syntactic validation: **{'valid' if vr.ok else 'INVALID'}**")+w(f"- RDF triples loaded: **{n_triples}** (engine stats: {stats})")+w(f"- skos:Concept entities: **{n_concepts}** ({n_vars} variables, {n_values} coded values)\n")+w("## Provenance completeness (no entity invented)\n")+w(f"- Concepts with a `prov:wasDerivedFrom` source file: **{n_prov} / {n_concepts} "+ f"({prov_pct}%)**")+w(f"- Concepts carrying both a 2012 and a 2023 PIAAC source variable "+ f"(cross-cycle harmonised): **{both_cycle}**\n")+w("## Variables and their coded values\n")+w("| Variable | Coded values |")+w("| --- | ---: |")+for r in vc:+ w(f"| {lab(r['v'])} | {r['k'].split('^')[0].strip(chr(34))} |")+w("\n## Lint (engine quality checks)\n")+if isinstance(lint, dict):+ issues = {k: v for k, v in lint.items() if v}+ if not issues:+ w("- No lint issues: every concept has a label and a definition.")+ else:+ for k, v in issues.items():+ w(f"- {k}: {len(v) if isinstance(v,(list,dict)) else v}")+w("\n---\nReproduce: `Rscript ontology/build_scheme.R && "+ ".venv/bin/python ontology/validate_scheme.py`")++open(os.path.join(HERE, "coverage-report.md"), "w").write("\n".join(lines) + "\n")+print(f"coverage-report.md written: {n_concepts} concepts, {n_triples} triples, "+ f"provenance {prov_pct}%, lint {'clean' if not any((lint or {}).values()) else 'issues'}")diff --git a/case-studies/skills-mobility/outputs/figures/fig1_gradient.csv b/case-studies/skills-mobility/outputs/figures/fig1_gradient.csvnew file mode 100644index 00000000..ee7dc37d--- /dev/null+++ b/case-studies/skills-mobility/outputs/figures/fig1_gradient.csv@@ -0,0 +1,7 @@+"origin","estimate","se","ci_lo","ci_hi","within","between","domain","cycle"+"High",289.247884806635,1.87554014590385,285.571826120663,292.923943492607,2.98164533368089,0.487277732014687,"Numeracy","2012"+"Low",239.217135166175,1.83606407619968,235.618449576824,242.815820755527,2.8912623114658,0.43624452767745,"Numeracy","2012"+"Medium",270.925699960371,1.60374233648171,267.782364980867,274.069034939875,2.09183604988445,0.436503119944882,"Numeracy","2012"+"High",292.74812258818,2.6173725291069,287.618072431131,297.87817274523,6.29126672313008,0.508520211812133,"Numeracy","2023"+"Low",242.450243765355,4.24847093410902,234.123240734502,250.777246796209,17.2174915585801,0.756376108535512,"Numeracy","2023"+"Medium",278.669823350856,2.13228191358446,274.490550800231,282.849095901482,4.31730653088981,0.208472389190562,"Numeracy","2023"diff --git a/case-studies/skills-mobility/outputs/figures/fig1_gradient.png b/case-studies/skills-mobility/outputs/figures/fig1_gradient.pngnew file mode 100644index 00000000..cf17b3d7Binary files /dev/null and b/case-studies/skills-mobility/outputs/figures/fig1_gradient.png differdiff --git a/case-studies/skills-mobility/outputs/figures/fig2_same_qualification.csv b/case-studies/skills-mobility/outputs/figures/fig2_same_qualification.csvnew file mode 100644index 00000000..f536d48d--- /dev/null+++ b/case-studies/skills-mobility/outputs/figures/fig2_same_qualification.csv@@ -0,0 +1,7 @@+"own_edu","origin","estimate","se","ci_lo","ci_hi","within","between"+"High","High",298.609114122926,2.10371992995218,294.48582306022,302.732405185633,4.17747289043067,0.225604230224853+"High","Low",264.950929460802,3.73342192911794,257.633422479731,272.268436441873,12.8425148362215,0.996294967815712+"Low","High",232.408640565243,9.531984052224,213.725951822884,251.091329307602,80.5861927898138,9.33866107458081+"Low","Low",219.4656931185,2.5968320903256,214.375902221462,224.555484015538,5.96993568359857,0.703273837951145+"Medium","High",282.297346199495,3.67333054815358,275.097618325114,289.497074073876,8.43810019480814,4.59568829199105+"Medium","Low",246.512540673507,3.07472573633071,240.486078230299,252.539003116715,8.41088277981592,0.948232339853187diff --git a/case-studies/skills-mobility/outputs/figures/fig2_same_qualification.png b/case-studies/skills-mobility/outputs/figures/fig2_same_qualification.pngnew file mode 100644index 00000000..9f6ff143Binary files /dev/null and b/case-studies/skills-mobility/outputs/figures/fig2_same_qualification.png differdiff --git a/case-studies/skills-mobility/outputs/figures/fig3_numeracy_beyond_quals.csv b/case-studies/skills-mobility/outputs/figures/fig3_numeracy_beyond_quals.csvnew file mode 100644index 00000000..90f7137d--- /dev/null+++ b/case-studies/skills-mobility/outputs/figures/fig3_numeracy_beyond_quals.csv@@ -0,0 +1,5 @@+"outcome","model","r2"+"Hourly earnings (decile)","Qualifications + age + sex",0.305417337916628+"Hourly earnings (decile)","... plus numeracy",0.367134881346988+"Professional / managerial job","Qualifications + age + sex",0.160188181484194+"Professional / managerial job","... plus numeracy",0.206872661187028diff --git a/case-studies/skills-mobility/outputs/figures/fig3_numeracy_beyond_quals.png b/case-studies/skills-mobility/outputs/figures/fig3_numeracy_beyond_quals.pngnew file mode 100644index 00000000..0cd99f2cBinary files /dev/null and b/case-studies/skills-mobility/outputs/figures/fig3_numeracy_beyond_quals.png differdiff --git a/case-studies/skills-mobility/outputs/figures/fig4_tertiary_by_origin.csv b/case-studies/skills-mobility/outputs/figures/fig4_tertiary_by_origin.csvnew file mode 100644index 00000000..91654721--- /dev/null+++ b/case-studies/skills-mobility/outputs/figures/fig4_tertiary_by_origin.csv@@ -0,0 +1,7 @@+"cycle","origin","pct","se","ci_lo","ci_hi"+"2012","Low",22.5052770249857,1.31321837940273,19.9313690013563,25.079185048615+"2012","Medium",39.530643973326,1.29637070988026,36.9897573819607,42.0715305646913+"2012","High",62.2126658798419,1.69420391591861,58.8920262046414,65.5333055550423+"2023","Low",32.3521259729524,2.70972496657284,27.0410650384696,37.6631869074352+"2023","Medium",44.7724757675281,1.98640361392563,40.8791246842339,48.6658268508224+"2023","High",60.1050072331005,1.77334067497832,56.629259510143,63.580754956058diff --git a/case-studies/skills-mobility/outputs/figures/fig4_tertiary_by_origin.png b/case-studies/skills-mobility/outputs/figures/fig4_tertiary_by_origin.pngnew file mode 100644index 00000000..21eb8785Binary files /dev/null and b/case-studies/skills-mobility/outputs/figures/fig4_tertiary_by_origin.png differdiff --git a/case-studies/skills-mobility/outputs/tables/01_proficiency_gradient.csv b/case-studies/skills-mobility/outputs/tables/01_proficiency_gradient.csvnew file mode 100644index 00000000..d610d18a--- /dev/null+++ b/case-studies/skills-mobility/outputs/tables/01_proficiency_gradient.csv@@ -0,0 +1,13 @@+"origin","estimate","se","ci_lo","ci_hi","within","between","domain","cycle"+"High",289.247884806635,1.87554014590385,285.571826120663,292.923943492607,2.98164533368089,0.487277732014687,"Numeracy","2012"+"Low",239.217135166175,1.83606407619968,235.618449576824,242.815820755527,2.8912623114658,0.43624452767745,"Numeracy","2012"+"Medium",270.925699960371,1.60374233648171,267.782364980867,274.069034939875,2.09183604988445,0.436503119944882,"Numeracy","2012"+"High",296.30728986971,1.75934060998288,292.858982274143,299.755597465276,2.57155639838087,0.476111803230961,"Literacy","2012"+"Low",252.249370802888,1.73959438647888,248.839765805389,255.658975800387,2.48271999257708,0.494062397174305,"Literacy","2012"+"Medium",281.700540486787,1.4343572288897,278.889200318163,284.511880655411,1.66594743686332,0.355848384731652,"Literacy","2012"+"High",292.74812258818,2.6173725291069,287.618072431131,297.87817274523,6.29126672313008,0.508520211812133,"Numeracy","2023"+"Low",242.450243765355,4.24847093410902,234.123240734502,250.777246796209,17.2174915585801,0.756376108535512,"Numeracy","2023"+"Medium",278.669823350856,2.13228191358446,274.490550800231,282.849095901482,4.31730653088981,0.208472389190562,"Numeracy","2023"+"High",292.657119066441,2.43985178513453,287.875009567577,297.439228565304,5.75556346648849,0.179375697214249,"Literacy","2023"+"Low",245.945116686693,3.77205926618485,238.551880524971,253.338352848415,13.4818816786341,0.678681299069947,"Literacy","2023"+"Medium",281.325737480883,2.19637995725905,277.020832764655,285.630642197111,4.61769053343626,0.187631257466359,"Literacy","2023"diff --git a/case-studies/skills-mobility/outputs/tables/02_tertiary_by_origin.csv b/case-studies/skills-mobility/outputs/tables/02_tertiary_by_origin.csvnew file mode 100644index 00000000..91654721--- /dev/null+++ b/case-studies/skills-mobility/outputs/tables/02_tertiary_by_origin.csv@@ -0,0 +1,7 @@+"cycle","origin","pct","se","ci_lo","ci_hi"+"2012","Low",22.5052770249857,1.31321837940273,19.9313690013563,25.079185048615+"2012","Medium",39.530643973326,1.29637070988026,36.9897573819607,42.0715305646913+"2012","High",62.2126658798419,1.69420391591861,58.8920262046414,65.5333055550423+"2023","Low",32.3521259729524,2.70972496657284,27.0410650384696,37.6631869074352+"2023","Medium",44.7724757675281,1.98640361392563,40.8791246842339,48.6658268508224+"2023","High",60.1050072331005,1.77334067497832,56.629259510143,63.580754956058diff --git a/case-studies/skills-mobility/outputs/tables/03_origin_gap_numeracy.csv b/case-studies/skills-mobility/outputs/tables/03_origin_gap_numeracy.csvnew file mode 100644index 00000000..ae8421be--- /dev/null+++ b/case-studies/skills-mobility/outputs/tables/03_origin_gap_numeracy.csv@@ -0,0 +1,9 @@+"term","estimate","se","ci_lo","ci_hi","p","model","cycle"+"originMedium",33.3048627372691,2.54163473162121,28.3232586632916,38.2864668112467,3.13518364921892e-39,"Total (composition-adjusted)","2012"+"originHigh",51.9081291507558,2.66258166726459,46.6894690829173,57.1267892185944,1.20081435558635e-84,"Total (composition-adjusted)","2012"+"originMedium",23.0559003436539,2.47486646732281,18.2051620677012,27.9066386196066,1.2078869289407e-20,"Net of own qualification","2012"+"originHigh",34.4856466854996,2.88660154940326,28.8279076486692,40.14338572233,6.74748603013832e-33,"Net of own qualification","2012"+"originMedium",33.4658283867947,5.39476493744828,22.892089109396,44.0395676641933,5.52598307583706e-10,"Total (composition-adjusted)","2023"+"originHigh",47.2665884910897,5.65075653812956,36.1911056763558,58.3420713058237,6.02947396718815e-17,"Total (composition-adjusted)","2023"+"originMedium",25.2991890207731,4.89193029461491,15.7110056433278,34.8873723982183,2.32077104499272e-07,"Net of own qualification","2023"+"originHigh",32.360905940305,5.54546601627134,21.4917925484132,43.2300193321969,5.36098360064805e-09,"Net of own qualification","2023"diff --git a/case-studies/skills-mobility/outputs/tables/05_within_qualification_gap.csv b/case-studies/skills-mobility/outputs/tables/05_within_qualification_gap.csvnew file mode 100644index 00000000..0b546074--- /dev/null+++ b/case-studies/skills-mobility/outputs/tables/05_within_qualification_gap.csv@@ -0,0 +1,7 @@+"term","estimate","se","ci_lo","ci_hi","p","own_edu","n","cycle"+"originHigh",17.4307221315974,10.8899622112012,-3.91360380235699,38.7750480655518,0.109460482613507,"Low",596,"2012"+"originHigh",38.306833564663,4.66478426678552,29.1638564017634,47.4498107275627,2.17679937104281e-16,"Medium",642,"2012"+"originHigh",37.0352481921452,4.53908947933273,28.1386328126531,45.9318635716374,3.37306600558242e-16,"High",989,"2012"+"originHigh",29.84398197681,21.6225627404144,-12.5362409944023,72.2242049480223,0.167517659026572,"Low",221,"2023"+"originHigh",31.3280661504501,10.9189520330774,9.92692016561851,52.7292121352817,0.0041158193286453,"Medium",796,"2023"+"originHigh",27.3369875869605,6.51408643083385,14.5693781825262,40.1045969913949,2.70956909430134e-05,"High",1330,"2023"diff --git a/case-studies/skills-mobility/outputs/tables/06_nested_numeracy_coef.csv b/case-studies/skills-mobility/outputs/tables/06_nested_numeracy_coef.csvnew file mode 100644index 00000000..deacf045--- /dev/null+++ b/case-studies/skills-mobility/outputs/tables/06_nested_numeracy_coef.csv@@ -0,0 +1,3 @@+"term","estimate","se","ci_lo","ci_hi","p","outcome","cycle"+".num",0.860671853203414,0.068326563689812,0.726751788371383,0.994591918035446,2.20875373721855e-36,"earn_decile","2012"+".num",0.714819157256824,0.0659438376925561,0.585569235379414,0.844069079134234,2.2291561015354e-27,"occ_high","2012"diff --git a/case-studies/skills-mobility/outputs/tables/06_nested_r2.csv b/case-studies/skills-mobility/outputs/tables/06_nested_r2.csvnew file mode 100644index 00000000..aac483e6--- /dev/null+++ b/case-studies/skills-mobility/outputs/tables/06_nested_r2.csv@@ -0,0 +1,3 @@+"outcome","family","r2_quals_only","r2_plus_numeracy","delta"+"earn_decile","linear R2",0.305417337916628,0.367134881346988,0.0617175434303602+"occ_high","McFadden pseudo-R2",0.160188181484194,0.206872661187028,0.0466844797028339diff --git a/case-studies/skills-mobility/outputs/tables/07_origin_gap_by_sex.csv b/case-studies/skills-mobility/outputs/tables/07_origin_gap_by_sex.csvnew file mode 100644index 00000000..a86e500b--- /dev/null+++ b/case-studies/skills-mobility/outputs/tables/07_origin_gap_by_sex.csv@@ -0,0 +1,5 @@+"term","estimate","se","ci_lo","ci_hi","p","sex","cycle","n"+"originHigh",58.4744054065225,4.49804985331476,49.6582276940255,67.2905831190194,1.22429631587414e-38,"Male","2012",968+"originHigh",49.1715699770975,4.32426772218939,40.6960052416063,57.6471347125887,5.82659295060274e-30,"Female","2012",1269+"originHigh",45.5197495525709,7.00383389389102,31.7922351205445,59.2472639845973,8.071513248758e-11,"Male","2023",1014+"originHigh",49.200481317835,8.88155655302102,31.7926304739138,66.6083321617562,3.03122243728497e-08,"Female","2023",1340diff --git a/case-studies/skills-mobility/outputs/tables/harmonisation_map.csv b/case-studies/skills-mobility/outputs/tables/harmonisation_map.csvnew file mode 100644index 00000000..5ca82098--- /dev/null+++ b/case-studies/skills-mobility/outputs/tables/harmonisation_map.csv@@ -0,0 +1,15 @@+"variable","source_cy1","source_cy2","code","band","definition"+"origin","PARED","PAREDC2","1","Low","Neither parent attained upper secondary"+"origin","PARED","PAREDC2","2","Medium","At least one parent upper secondary / post-secondary non-tertiary"+"origin","PARED","PAREDC2","3","High","At least one parent attained tertiary"+"own_edu","EDCAT6","EDCAT6_TC1","1","Low","Lower secondary or less (ISCED 1,2,3C short)"+"own_edu","EDCAT6","EDCAT6_TC1","2","Medium","Upper secondary (ISCED 3A-B, C long)"+"own_edu","EDCAT6","EDCAT6_TC1","3","Medium","Post-secondary non-tertiary (ISCED 4)"+"own_edu","EDCAT6","EDCAT6_TC1","4","High","Tertiary professional (ISCED 5B)"+"own_edu","EDCAT6","EDCAT6_TC1","5","High","Tertiary bachelor (ISCED 5A)"+"own_edu","EDCAT6","EDCAT6_TC1","6","High","Tertiary master/research (ISCED 5A/6)"+"own_edu","EDCAT6","EDCAT6_TC1","7","High","Tertiary bachelor/master/research grouped (ISCED 5A/6)"+"occ_skill_rank","ISCOSKIL4","ISCOSKIL4","1","4","Skilled occupations"+"occ_skill_rank","ISCOSKIL4","ISCOSKIL4","2","3","Semi-skilled white-collar"+"occ_skill_rank","ISCOSKIL4","ISCOSKIL4","3","2","Semi-skilled blue-collar"+"occ_skill_rank","ISCOSKIL4","ISCOSKIL4","4","1","Elementary occupations"diff --git a/case-studies/skills-mobility/outputs/tables/sample_sizes.csv b/case-studies/skills-mobility/outputs/tables/sample_sizes.csvnew file mode 100644index 00000000..482402fd--- /dev/null+++ b/case-studies/skills-mobility/outputs/tables/sample_sizes.csv@@ -0,0 +1,3 @@+"cycle","n","n_england","n_origin","n_own_edu","n_occ","n_earn","pct_origin_known"+"CY1",8892,5078,7386,8786,7101,4904,83.1+"CY2",4941,4936,4049,4922,4332,3130,81.9diff --git a/case-studies/skills-mobility/technical-note.md b/case-studies/skills-mobility/technical-note.mdnew file mode 100644index 00000000..c76a34a1--- /dev/null+++ b/case-studies/skills-mobility/technical-note.md@@ -0,0 +1,104 @@+# Technical note: intergenerational educational and skills mobility in England (PIAAC)++This note documents the data, variables, statistical methods, validation and limitations behind the case study. It is written for analysts and official-statistics methodologists who want to check or reuse the work.++## 1. Data++| Item | Detail |+| --- | --- |+| Source | OECD Programme for the International Assessment of Adult Competencies (PIAAC), Survey of Adult Skills, public-use files |+| Files | `prggbrp1.csv` (Cycle 1, 2012, 8,892 respondents) and `prggbrp2.csv` (Cycle 2, 2023, 4,941 respondents) |+| Host | OECD public file store, `https://webfs.oecd.org/piaac/` (open directory; no registration or licence) |+| Value labels | Taken from the official SPSS public-use files (`prggbrp1.sav`, `PRGGBRP2.sav`) on the same store |+| Access date | 17 June 2026; URLs, byte sizes and MD5 checksums recorded in `data/raw/MANIFEST.csv` |+| Population | Adults aged 16 to 65 |++The UK participated in PIAAC Cycle 1 as **England and Northern Ireland** and in Cycle 2 as **England**. For every cross-cycle comparison the 2012 sample is restricted to England (OECD TL2 regions UKC to UKK, excluding Northern Ireland, UKN) so the geography matches. Northern Ireland was heavily oversampled in 2012; the final weights correct for this, and restricting to England removes it from the comparison entirely.++## 2. Variables and harmonisation++The two cycles use different variable names and, in places, different codings. All analysis variables are mapped to a common scheme, recorded in `outputs/tables/harmonisation_map.csv` and published as a coded SKOS scheme in `ontology/`.++| Concept | 2012 variable | 2023 variable | Coding used |+| --- | --- | --- | --- |+| Origin (parental education) | `PARED` | `PAREDC2` | 3 bands: Low (neither parent above lower secondary), Medium (at least one upper secondary or post-secondary non-tertiary), High (at least one tertiary). Codes 6/7/8/9 = missing |+| Own highest qualification | `EDCAT6` | `EDCAT6_TC1` | Collapsed to the same 3 bands: Low = code 1; Medium = 2,3; High = 4,5,6,7. (2012 uses code 7 for grouped tertiary; 2023 uses 5 and 6) |+| Numeracy | `PVNUM1`-`PVNUM10` | same | 10 plausible values, 0-500 |+| Literacy | `PVLIT1`-`PVLIT10` | same | 10 plausible values, 0-500 |+| Occupation (1-digit) | `ISCO1C` | `ISCO1C` | ISCO-08 major group; high-status = groups 1-3 (managers, professionals, technicians) |+| Occupational skill | `ISCOSKIL4` | `ISCOSKIL4` | 4 bands, recoded so higher = more skilled |+| Hourly earnings | `EARNHRDCL` | `EARNHRDCLC2` | National decile, 1 = lowest to 10 = highest |+| Sex | `GENDER_R` | `GENDER_R` | Male, Female |+| Age | `AGEG10LFS` | `AGEG10LFS` | 10-year bands |+| Region | `REG_TL2` | `REG_TL2` | OECD TL2 |+| Final weight | `SPFWT0` | `SPFWT0` | |+| Replicate weights | `SPFWT1`-`SPFWT80` | same | 80 replicates |++The `_TC1` suffix on the 2023 education variable denotes the OECD's own trend-coding to Cycle 1, so it is the version comparable with the 2012 `EDCAT6`.++**An empirical correction worth recording.** The SPSS value labels for the earnings-decile variable are internally inconsistent (they label code 2 as the "9th decile", code 3 as the "8th", and so on, which would make the scale non-monotonic). We did not trust the labels. We validated the variable against the continuous earnings measure available in 2012 (`EARNHRBONUSPPP`): mean continuous earnings rise monotonically from 7.6 PPP-USD per hour at decile 1 to 54.0 at decile 10, with a Spearman correlation of 0.99. The numeric values are therefore standard decile ranks (1 = lowest, 10 = highest) and the mid-range labels are a labelling error in the public file. We use the numeric values.++## 3. Statistical methods++**Plausible values.** Proficiency in PIAAC is reported as ten plausible values, not a single score. Each analysis is run separately on each of the ten values and the results are combined by Rubin's rules: the point estimate is the mean of the ten, and the total variance is the mean sampling variance plus `(1 + 1/10)` times the between-value variance. Averaging the ten plausible values into one score (a common error) understates uncertainty and is not done anywhere here.++**Replicate weights and the cycle-specific variance method.** Point estimates use the final weight `SPFWT0`. Sampling variances use the 80 replicate weights. The replication method differs by cycle, and using the wrong one inflates standard errors by a factor of roughly `sqrt(20)`:++- **Cycle 1 (2012): jackknife.** Variance is the simple sum of squared replicate deviations, `Var = sum_r (theta_r - theta_0)^2`. Implemented with `survey::svrepdesign(type = "other", scale = 1, rscales = 1, mse = TRUE)`.+- **Cycle 2 (2023): Fay's balanced repeated replication, Fay factor 0.5.** Variance is `1 / (R(1 - 0.5)^2) * sum_r (theta_r - theta_0)^2 = (1/20) * sum_r (...)`. Implemented with `survey::svrepdesign(type = "Fay", rho = 0.5, mse = TRUE)`.++We confirmed the method empirically. Computing the 2023 England mean numeracy with the jackknife formula gives a standard error of 7.25, which is implausible for a sample of about 4,900; the Fay method gives 1.65. The ratio is `sqrt(20)`, exactly the Fay scaling. The Fay estimate matches the published OECD standard error.++**Models.** All regression models are survey-weighted generalised linear models (`survey::svyglm`) fitted on the replicate-weight design, run once per plausible value and combined across the ten with `mitools::MIcombine`, so that both sampling variance and between-value variance enter the standard errors.++- *Origin gradient and gap:* mean numeracy by origin band; and `numeracy ~ origin + sex + age` (total gap) versus `numeracy ~ origin + own_qualification + sex + age` (gap net of qualification).+- *Within-qualification gap:* `numeracy ~ origin + sex + age` fitted separately within each own-qualification band.+- *Skills beyond qualifications:* `outcome ~ qualification + age + sex` versus the same plus standardised numeracy, for two outcomes (earnings decile, linear; professional/managerial occupation, quasi-binomial). Numeracy is standardised to mean 0, SD 1 using the weighted pooled plausible-value distribution, so its coefficient reads per standard deviation. Variance explained is the weighted R-squared (linear) or McFadden pseudo-R-squared (binomial), averaged across the ten plausible values.++## 4. Validation against published figures++| Quantity | This pipeline | Published OECD |+| --- | --- | --- |+| England mean numeracy, 2023 | 268.8 (SE 1.65) | 268 |+| England mean numeracy, 2012 | 261.8 (SE 1.10) | ~262 |+| Direction of change 2012 to 2023 | significant rise | significant rise |++The pipeline reproduces the published England toplines, which gives confidence that the weighting, plausible-value and variance handling are correct.++## 5. Headline estimates with confidence intervals++| Estimate (England) | 2012 | 2023 |+| --- | --- | --- |+| Numeracy, Low / Medium / High origin | 239 / 271 / 289 | 242 / 279 / 293 |+| Tertiary attainment, Low / High origin | 23% / 62% | 32% / 60% |+| Origin gap (High-Low), total | 51.9 [46.7, 57.1] | 47.3 [36.2, 58.3] |+| Origin gap (High-Low), net of own qualification | 34.5 [28.8, 40.1] | 32.4 [21.5, 43.2] |+| Within upper-secondary group, High-Low gap | 38.3 [29.2, 47.4] | 31.3 [9.9, 52.7] |+| Within tertiary group, High-Low gap | 37.0 [28.1, 45.9] | 27.3 [14.6, 40.1] |+| Numeracy coefficient (per SD) on earnings decile | 0.86 [0.73, 0.99] | not estimated (earnings suppressed) |+| Variance explained in earnings, quals only vs + numeracy | 30.5% vs 36.7% | not estimated |++Square brackets are 95% confidence intervals.++## 6. Limitations++1. **Descriptive, not causal.** These are associations. Parental education is a proxy for a bundle of family advantages; the design cannot separate them or establish causation.+2. **Cross-sectional.** PIAAC is not a panel. "Origin to destination" is reconstructed within a single survey from retrospective parental-education reporting, not followed over time.+3. **Reverse and contemporaneous influences.** Skills and qualifications are measured in adulthood and partly co-determined; the nested-model results describe shared and unique predictive content, not a causal decomposition.+4. **Public-file masking in 2023.** Continuous earnings and four-digit occupation are suppressed in the 2023 public-use file. Cross-year analyses therefore use earnings deciles and one-digit occupation. The continuous-earnings nested model is 2012 only.+5. **Missing origin data.** Parental education is unknown (don't know, refused, not stated) for about 17% of respondents, who are excluded from origin analyses. If non-response is related to origin, the gradient could be mildly under- or over-stated.+6. **Three-band collapse.** Banding parental and own education to three levels aids comparability but discards within-band detail, in particular differences within tertiary education.++## 7. Reproduce++```bash+# from the case-study directory+Rscript R/01_download.R # fetch the open PIAAC files (idempotent)+Rscript R/02_harmonise.R # build the harmonised analysis table+Rscript R/03_analyse.R # estimates, with PVs + replicate weights+Rscript R/04_visualise.R # figures + per-figure CSVs+Rscript ontology/build_scheme.R # generate the SKOS variable scheme+.venv/bin/python ontology/validate_scheme.py # validate via the Oxigraph engine+```++A clean run regenerates every number in the case study and this note, and every figure, from the raw open files.