5 Access Data
5.1 Overview
Approved files are distributed through datalibweb, in two collections:
| Collection | Content |
|---|---|
FDPRAW |
Raw survey microdata, questionnaires and documentation |
FDP |
Harmonized microdata (50by35 schema) and harmonization programs |
The harmonized welfare module in the FDP collection is called WELF.
5.2 Who can access data
To access the data, users must be registered on datalibweb and have permission to access the FDPRAW and FDP collections. Access is set to private by default on datalibweb. Each user needs to subscribe to access the datasets they need and be approved by admin. Admin can change access to public, so that all (internal) datalibweb users can access it without user level subscription.
5.3 File naming conventions
datalibweb survey identifiers guarantee replicability: versions are never replaced — new releases get a new version number, and previous vintages remain available. Always record the full survey ID used in an analysis.
Raw (master) data in FDPRAW:
CCC_YYYY_SSSS_V##_M
CCC— 3-letter ISO/WDI country code (e.g.COL)YYYY— year data collection startedSSSS— survey acronym (e.g.GEIH,EHCVM,RHS)V##_M— version of the master (original) data; first release isV01
Harmonized data in FDP:
CCC_YYYY_SSSS_V##_M_V##_A_FDP
V##_A— version of the harmonization (adaptation), independent of the master versionFDP— the collection of harmonized surveys
Module files append the module name to the survey ID. The 50by35 harmonized welfare file (V01) for Colombia is:
COL_2023_GEIH_V01_M_V01_A_FDP_WELF.dta
5.4 Using datalibweb
Two clients are available: the datalibweb Stata package and the dlw R package. Both require the World Bank intranet/VPN, permission to access the collections, and the same datalibweb token used by PRIMUS (valid 30 days, renewed on the datalibweb website).
5.4.1 Authentication
Register the datalibweb token (from the datalibweb website) once every 30 days:
dlw_set_token("<your datalibweb token>") # stored in the system keyringdatalibweb, token(<your datalibweb token>) version(2)5.5 Checking the catalog
library(dlw)
# all collections (servers) you can access
dlw_server_catalog()
# what is in a collection
dlw_server_catalog("FDP")
dlw_server_catalog("FDPRAW")
# everything available for one country, across collections
dlw_country_catalog("COL")
# files for one country within a collection
dlw_server_inventory("COL", server = "FDP")* interactive browser: click through region -> country -> collection
datalibweb
* list what is available for a country-year in a collection; when raw
* data is requested, datalibweb lists the individual files to pick from
datalibweb, country(COL) years(2023) type(FDP) clear5.6 Loading data
library(dlw)
# harmonized 50by35 welfare module (WELF) from the FDP collection
welf <- dlw_get_data(
country_code = "COL",
filename = "COL_2023_GEIH_V01_M_V01_A_FDP_WELF.dta",
server = "FDP",
year = 2023
)
# a raw file from the FDPRAW collection; year and survey (acronym) disambiguate
# the specific survey vintage — the R equivalent of Stata's surveyid()
raw <- dlw_get_data(
country_code = "COL",
year = 2023,
survey = "GEIH",
filename = "individual_data_2023.dta",
server = "FDP"
)* harmonized 50by35 welfare module (WELF) from the FDP collection;
* the latest master and harmonization versions are loaded by default
datalibweb, country(COL) years(2023) type(FDP) mod(WELF) clear
* pin specific vintages for replicability
dlw, country(COL) years(2023) type(FDP) mod(WELF) verm(01) vera(01) survey(GEIH) clear
* a raw file from the FDPRAW collection
datalibweb, country(COL) years(2023) type(FDPRAW) ///
surveyid(COL_2023_GEIH_V01_M) filename(individual_data_2023.dta) clear5.7 Calculating SR indicators
library(dlw)
library(pipr)
# harmonized 50by35 welfare module (WELF) from the FDP collection
welf <- dlw_get_data(
country_code = "COL",
filename = "COL_2023_GEIH_V01_M_V01_A_FDP_WELF.dta",
server = "FDP",
year = 2023
)
# CPI and PPP conversion factors from PIP (public)
cpi_pip <- get_aux("cpi", ppp_version = 2021)
ppp_pip <- get_aux("ppp", ppp_version = 2021)
# calculate SR indicator ----
ccode <- welf$code[1]
yr <- welf$year[1]
# CPI: ratio normalized to 1 in the PPP base year (2021), for the survey year
cpi_value <- cpi_pip$value[cpi_pip$country_code == ccode &
cpi_pip$year == yr &
cpi_pip$data_level == "national"]
# PPP: ICP 2021 conversion factor (LCU per international $)
ppp_value <- ppp_pip$value[ppp_pip$country_code == ccode &
ppp_pip$data_level == "national"]
# poverty line in $/day 2021 PPP (placeholder — pending confirmation)
zline <- 3.00
# self-reliance share: weighted proportion above the line using welfare_self
sr_share <- weighted.mean(
welf$welfare_self / 365 / cpi_value / ppp_value >= zline,
welf$weight
)
# poverty headcount: weighted proportion below the line using welfare
headcount <- weighted.mean(
welf$welfare / 365 / cpi_value / ppp_value < zline,
welf$weight
)
sprintf("%s %d - Self-reliance share: %.4f Headcount: %.4f ($%.2f/day 2021PPP)", ccode, yr, sr_share, headcount, zline)* harmonized 50by35 welfare module (WELF) from the FDP collection;
* the latest master and harmonization versions are loaded by default
datalibweb, country(COL) years(2023) type(FDP) mod(WELF) clear
* calculate SR indicator
local ccode = code[1]
local year = year[1]
* CPI and PPP conversion factors from PIP (public)
preserve
pip tables, table(cpi) ppp_year(2021) clear
keep if country_code=="`ccode'" & year==`year' & data_level=="national"
local cpival = value[1]
restore
preserve
pip tables, table(ppp) ppp_year(2021) clear
keep if country_code=="`ccode'" & data_level=="national"
local pppval = value[1]
restore
* poverty line in $/day 2021 PPP (placeholder — pending confirmation)
local zline 3.00
* self-reliance share: weighted proportion above the line using welfare_self
gen byte _sr = (welfare_self/365/`cpival'/`pppval') >= `zline'
qui sum _sr [aw=weight]
local sr : di %9.6f r(mean)
* poverty headcount: weighted proportion below the line using welfare
gen byte _poor = (welfare/365/`cpival'/`pppval') < `zline'
qui sum _poor [aw=weight]
local hc : di %9.6f r(mean)
drop _sr _poor
di "`ccode' `year' - Self-reliance share: `sr' Headcount: `hc' ($`zline'/day 2021PPP)"For citation guidance and further options (e.g. PPP conversion on load), see the datalibweb help file in Stata and the datalibweb guidelines; questions to the datalibweb team at datalibweb@worldbank.org.