Data conventions
The measurement conventions behind economic and business data.
The measurement conventions behind economic and business data. Each one, ignored, gives a result that runs without errors and is wrong. Notation: i a unit (person, household, firm, store, region, country), t a period, X a variable.
Structure of the data
- Unit of observation
What one row describes: a person, a household, a firm, an order, a country in a year. Write it down before any calculation; every count, mean and merge depends on it.
- Cross-section Xi
Many units observed once. Key: i. A census, one wave of a household survey, a firm register in a given year.
- Time series Xt
One unit observed over time at a fixed frequency (monthly, quarterly, annual). Key: t. Spain's quarterly GDP, the monthly CPI.
- Panel Xit
The same units followed over time. Key: (i, t). Balanced if every unit appears in every period. Units that leave the panel (attrition) rarely leave at random. Countries by year (World Bank), workers in social security records, firms in balance-sheet data.
- Repeated cross-sections
A new sample of units each period. You can follow groups (age cohorts, regions) over time, not individuals. Most labour force surveys and budget surveys across years.
- Long and wide
Long: one row per (i, t), one column per variable. Wide: one row per i, one column per period. Analysis and plotting want long; tables for reading are often wide.
- Keys and merges
Before a merge, decide the relationship (one-to-one, many-to-one), check that the key is unique on the side that should be unique, and count the rows before and after. A duplicated key multiplies rows without any error.
- Units and aggregates in one file
Many files mix units with groups of them (countries with "World" or "Euro area", provinces with the national total). Separate them before averaging or counting.
Units of measurement
- Flows and stocks
A flow is measured over a period and has a time dimension: income in 2025, GDP per year, sales per month, hours per week, hires in a quarter. A stock is measured at a point in time: wealth on 31 December, debt, population, employees on a date, inventories.
Flows of sub-periods add up: the four quarterly GDP figures sum to annual GDP; a household's monthly incomes sum to its annual income. Stocks do not add over time: the annual figure is the end-of-year value or the average over the year (read the definition).
A ratio of a stock to a flow is measured in units of time: public debt equal to 110% of annual GDP is 1.1 years of output; wealth equal to 6 times annual income is 6 years of income.
- Rates and shares
Unemployment rate, interest rate, a market share, GDP per capita. Never add them across units; average them only with the right weights. The mean of the ratios differs from the ratio of the sums: the average country is different from the average person.
- Per what
Per capita, per worker, per hour, per household. Household income per member ignores economies of scale in the household: equivalence scales (OECD modified: 1 for the first adult, 0.5 for other members aged 14 or more, 0.3 per child) adjust for that.
- Scale and currency
Euros or thousands of euros, monthly or annual, gross or net of taxes, current or constant prices. In a regression, a regressor in thousands divides its coefficient by 1,000; an outcome in thousands divides all coefficients by 1,000; t-statistics do not change.
- Percent and points
From 10% to 12% is +2 percentage points and +20 per cent.
Prices
- Nominal and real
Xrealt = Xnominalt / Pt × 100, with Pt a price index. Use the index that matches the variable: the CPI for wages, consumption and household income; the GDP deflator for output.
- Base of an index
Rebasing to t0: Pnewt = 100 · Pt / Pt0. It rescales the series and leaves every growth rate unchanged.
- International comparisons
Market exchange rates compare what an income buys abroad; purchasing power parities (PPP) compare what it buys at home. Living standards across countries use PPP; trade and financial flows use exchange rates.
- Breaks in a series
A new basket, questionnaire, classification or base changes what a series measures. Growth across the break needs a linked series; the statistical office usually publishes one.
Growth, logs and time
- Growth rates
Period on period: gt = Xt / Xt−1 − 1.
Year on year: Xt / Xt−4 − 1 with quarterly data, Xt / Xt−12 − 1 with monthly data.
Annualised: (1 + gq)4 − 1 from a quarterly rate, (1 + gm)12 − 1 from a monthly one.
Average annual growth over T years: (XT / X0)1/T − 1.
- Log differences
ln Xt − ln Xt−1 ≈ gt for small changes (below 10%, roughly). Log differences add up over time; percentage changes do not.
- Logs and zeros
ln 0 does not exist, and zeros are often real values: no earnings, no exports, no purchases. Dropping them silently changes the question to "among those with positive values".
Options: separate the extensive margin (whether X > 0) from the intensive margin (ln X among the positives); keep the variable in levels or use a model for non-negative outcomes (Poisson regression, PPML in trade). ln(1 + X) and asinh X give results that depend on the units of X: avoid them to estimate elasticities.
- Seasonality
Many series have a pattern that repeats every year: sales at Christmas, tourism in summer, hiring before the season, fewer working days at Easter.
A seasonally adjusted (SA) series removes that pattern: compare it with the previous period. A raw (not adjusted) series keeps it: compare it with the same period one year earlier, Xt / Xt−4 − 1 or Xt / Xt−12 − 1. Comparing a raw December with a raw November measures Christmas.
- Annualised levels (SAAR)
US national accounts publish quarterly flows as seasonally adjusted annual rates: SAARq = 4 × Xq, with Xq the seasonally adjusted flow of the quarter. The year's total is X1 + X2 + X3 + X4, the average of the four SAAR figures. US quarterly growth is reported annualised, (Xq / Xq−1)4 − 1; Eurostat and the INE report it quarter on quarter. Check which before comparing.
- Revisions
Official figures are revised for years. Record the date you downloaded the data (the vintage).
Microdata
- Sources
Labour force surveys (EPA in Spain, EU-LFS, CPS in the US); household budget and consumer expenditure surveys (EPF, CEX); income and living conditions (EU-SILC, ECV); wealth surveys (EFF of the Bank of Spain, SCF); time-use surveys; population and housing censuses; harmonised collections of censuses and surveys (IPUMS, LIS); administrative records (social security, tax files); firm data (balance sheets, registers) and transaction data (scanner data, card payments, a company's own sales).
- Survey weights
Each respondent represents a number of people (the weight). Population totals, means and rates use the weights; unweighted counts describe the sample.
- Person and household
Surveys come in person files and household files, linked by a household identifier. Decide whether the unit of analysis is the person or the household before merging.
- Codes, caps and imputations
Missing values are often codes (
-9,99,9999): recode them, as listed in the codebook, before any statistic. Top-coded values are capped at a threshold to protect confidentiality. Imputed values come with a flag. Durations still running at the end of the data (an unemployment spell, a customer still active) are censored.- Labour market (ILO)
Employed: worked at least one hour for pay or profit in the reference week. Unemployed: without work, available to start within two weeks and actively searched in the last four weeks (or has found a job that starts soon). Inactive: the rest.
Unemployment rate U / (E + U); activity rate (E + U) / population of working age (16+ in Spain, 15+ in most countries; check the age band, often 15-64).