6  Schema & Variable Dictionary

Published

July 20, 2026

Status

This variable dictionary is a working draft. Confirm the final variable list, value-label codes, and the precise definition of welfare_self with the 50by35 methodology team before treating it as authoritative.

6.1 Overview

Every harmonized file uploaded and approved through the pipeline must conform to this schema. Variables are grouped into mandatory (must be present and non-missing per the rules of the variable) and optional (included when available in the source survey).

The unit of observation is the individual: one row per person, with household-level variables (e.g. welfare, hhid) repeated across all members of the same household.

6.2 Conventions

  • Type refers to the Stata storage type of the variable in the harmonized .dta file: str# (string), byte/int/long (integers), float/double (reals). Read the equivalents in R (character, integer, double) via haven.
  • Missing — mandatory variables may not be missing except where noted. Use Stata’s system missing (.) for genuinely unknown values; do not use numeric sentinels such as -9 or 99, or extended missing values (.a.z).
  • Labels — categorical variables must carry Stata value labels; the numeric codes below are authoritative and must match across all surveys.
  • Identifiers are strings to preserve leading zeros and avoid precision loss.

6.3 Mandatory Variables

Variable Label Type Unit / range Missing Notes
code Country code str3 ISO / WDI 3-letter Not allowed e.g. AGO, ETH
year Survey year int 1990–2035 Not allowed Four-digit year of data collection
survname Survey name str# Not allowed Survey acronym (e.g. GEIH, EHCVM, RHS)
hhid Household identifier str Not allowed Unique per household within the survey; string to preserve leading zeros
pid Person identifier str Not allowed Unique per individual within the survey
welfare Welfare aggregate double > 0, LCU, annual per capita Not allowed Consumption or income aggregate from the survey’s official poverty methodology
welfare_self Self-reliance-adjusted welfare double ≥ 0, LCU, annual per capita Not allowed Welfare measure used for the 50by35 self-reliance indicator
welfare_type Welfare measure type byte 13 Not allowed 1 = Consumption, 2 = Income, 3 = Expenditure
weight Sampling weight double > 0 Not allowed Individual sampling/population weight
camp Camp/non-camp byte 0/1 Allowed 0 = Non-camp, 1 = Camp
urban Urban/rural byte 0/1 Allowed 0 = Rural, 1 = Urban

6.4 Optional Variables

Variable Label Type Unit / range Notes
hhsize Household size int ≥ 1 Number of household members
age Age double 0–120 years Decimal allowed for children under 5 (per GMD 2.0); integer otherwise
male Sex byte 0/1 0 = Female, 1 = Male
educat4 Highest education (4 cat.) byte 14 See value labels below
empstat Employment status byte 14 See value labels below
strata Sampling strata int Design variable for variance estimation
psu Primary sampling unit long Design variable for variance estimation

6.5 Value Labels

Categorical variables must use these codes and labels exactly.

welfare_type

1 Consumption · 2 Income · 3 Expenditure

male

0 Female · 1 Male

urban

0 Rural · 1 Urban

educat4

1 No education · 2 Primary · 3 Secondary · 4 Tertiary

empstat

1 Employed · 2 Unemployed · 3 Out of labor force · 4 Not applicable

6.6 Validation

These variables and value-label codes are enforced by the validation scripts (Stata/validate_50by35.do, R/validate_50by35.R), which run before every harmonized upload. Any deviation from the schema triggers an error and prevents the harmonized file from being uploaded to datalibweb. The checks cover missing values in mandatory variables, negative or zero values in welfare and weight, and that welfare_self is not greater than welfare. Households where hhsize differs from the number of pid records are flagged with a warning rather than an error, since rosters can be incomplete and refugee-only samples keep a subset of household members.