WID Code Dictionary

Every WID variable is identified by a compact code encoding four independent dimensions: series type, concept, age group, and population unit. This vignette documents all six lookup tables and explains how to use the code grammar programmatically.

Code grammar

A full variable code has the structure:

<type:1><concept:5-6>[<age:3>][<pop:1>]

All components are validated against the lookup tables.

wid_decode("sptinc992j")
#> $series_type
#> [1] "s"
#> 
#> $concept
#> [1] "ptinc"
#> 
#> $age
#> [1] "992"
#> 
#> $pop
#> [1] "j"
wid_encode("s", "ptinc", "992", "j")
#> [1] "sptinc992j"
wid_is_valid(series_type = "s", concept = "ptinc")
#> [1] TRUE

Series types (wid_series_types)

The first character of every WID code. There are 17 types.

wid_series_types
#>    code                                   description
#> 1     a                                       average
#> 2     b            inverted Pareto-Lorenz coefficient
#> 3     f                             female population
#> 4     g                              Gini coefficient
#> 5     i                                         index
#> 6     n                                    population
#> 7     s                                         share
#> 8     t                                     threshold
#> 9     m                                         total
#> 10    p                           proportion of women
#> 11    w wealth-to-income ratio or labor/capital share
#> 12    y                           wealth-to-GDP ratio
#> 13    r                        Top 10/Bottom 50 ratio
#> 14    x                 exchange rate (market or PPP)
#> 15    e                               Total emissions
#> 16    k                          Per capita emissions
#> 17    l            Average per capita group emissions

The most commonly used types in distributional analysis:

Code Meaning Unit
s share fraction of 1 (e.g. 0.20 = 20%)
a average local currency, last year’s prices
t threshold local currency, last year’s prices
m total local currency, last year’s prices
g Gini coefficient 0–1
b inverted Pareto-Lorenz coefficient dimensionless
w wealth/income ratio fraction of national income
x exchange rate LCU per foreign currency
i index dimensionless

Series types s, g, b, w, r, p, i, y are dimensionless; wid_convert() skips them. All others carry monetary units and can be converted.

wid_search("share", tables = "series_types")
#>          table variable                                   description
#> 1 series_types        s                                         share
#> 2 series_types        w wealth-to-income ratio or labor/capital share

Concepts (wid_concepts)

Characters 2–6 (or 2–7 for six-letter concepts) of the variable code. There are 464 concepts covering income, wealth, emissions, and demographic series.

nrow(wid_concepts)
#> [1] 464
head(wid_concepts, 10)
#>     code                                                        description
#> 1  cainc                                     (=) post-tax disposable income
#> 2  ccmhn                        (+) CFC of mixed income of household sector
#> 3  ccmho      (+) consumption of fixed capital attributable to mixed income
#> 4  ccshn                   (+) CFC of operating surplus of household sector
#> 5  ccsho (+) consumption of fixed capital attributable to operating surplus
#> 6  ceuco              (+) compensation of employees of the corporate sector
#> 7  ceugo                    (+) compensation of employees of the government
#> 8  ceuhn                  (+) compensation of employees of household sector
#> 9  cfcco                                     (+) CFC income of corporations
#> 10 cfcfc                                  (+) CFC of financial corporations

Income and wealth

The most-used concepts in distributional national accounts:

Code Description
ptinc pre-tax national income
plinc pre-tax labour income
pkink pre-tax capital income
fiinc fiscal income
nninc net national income
hweal net personal wealth
hwdeb personal debt
hwnfa net financial assets
hwhou housing wealth

Emissions

Code Description
tco2e total CO₂-equivalent emissions
tpcem per-capita emissions

Searching concepts

wid_search() matches against both code and description:

wid_search("wealth")
#>       table variable                                       description
#> 1  concepts    cwres                     (+) residual corporate wealth
#> 2  concepts    gweal          (=) net wealth of the general government
#> 3  concepts    hweal                          (=) household net wealth
#> 4  concepts    iweal           (=) non-profit institutions’ net wealth
#> 5  concepts    nwboo                    (=) book-value national wealth
#> 6  concepts    nweal              (=) net market-value national wealth
#> 7  concepts    pweal                            (=) private net wealth
#> 8  concepts    pwoff                               (+) offshore wealth
#> 9  concepts    pwtgr                     (+) property and wealth taxes
#> 10 concepts    tiwgo             (+) direct taxes on income and wealth
#> 11 concepts    tiwhn (+) taxes on income and wealth paid by households
#> 12 concepts    tiwho           (+) personal taxes on income and wealth
#> 13 concepts    tiwnp           (+) personal taxes on income and wealth
#> 14 concepts   wwealc                  Corporate wealth-to-income ratio
#> 15 concepts   wwealg                 Government wealth-to-income ratio
#> 16 concepts   wwealh                  Household wealth-to-income ratio
#> 17 concepts   wweali              Institutional wealth-to-income ratio
#> 18 concepts   wwealn               Net national wealth-to-income ratio
#> 19 concepts   wwealp                    Private wealth-to-income ratio
wid_search("income", tables = "concepts")
#>        table variable
#> 1   concepts    cainc
#> 2   concepts    ccmhn
#> 3   concepts    ccmho
#> 4   concepts    cfcco
#> 5   concepts    citgr
#> 6   concepts    comnx
#> 7   concepts    diinc
#> 8   concepts    fainc
#> 9   concepts    fdinx
#> 10  concepts    fdipx
#> 11  concepts    fdirx
#> 12  concepts    ficap
#> 13  concepts    fiinc
#> 14  concepts    filin
#> 15  concepts    fimik
#> 16  concepts    fimil
#> 17  concepts    fimix
#> 18  concepts    finpx
#> 19  concepts    finrx
#> 20  concepts    fkpin
#> 21  concepts    flcin
#> 22  concepts    flcip
#> 23  concepts    flcir
#> 24  concepts    flinc
#> 25  concepts    gmxhn
#> 26  concepts    gmxho
#> 27  concepts    gsmhn
#> 28  concepts    gsmho
#> 29  concepts    gsrnp
#> 30  concepts   inyixx
#> 31  concepts    nmxhn
#> 32  concepts    nmxho
#> 33  concepts    nnfin
#> 34  concepts    nninc
#> 35  concepts    nsmhn
#> 36  concepts    nsmho
#> 37  concepts    pinnx
#> 38  concepts    pinpx
#> 39  concepts    pinrx
#> 40  concepts    pitgr
#> 41  concepts    pkkin
#> 42  concepts    pllin
#> 43  concepts    prgco
#> 44  concepts    prgfc
#> 45  concepts    prggo
#> 46  concepts    prghn
#> 47  concepts    prgho
#> 48  concepts    prgnf
#> 49  concepts    prgnp
#> 50  concepts    prico
#> 51  concepts    prifc
#> 52  concepts    prigo
#> 53  concepts    prihn
#> 54  concepts    priho
#> 55  concepts    prinf
#> 56  concepts    prinp
#> 57  concepts    prpco
#> 58  concepts    prpfc
#> 59  concepts    prpgo
#> 60  concepts    prphn
#> 61  concepts    prpho
#> 62  concepts    prpnf
#> 63  concepts    prpnp
#> 64  concepts    ptdnx
#> 65  concepts    ptdpx
#> 66  concepts    ptdrx
#> 67  concepts    ptenx
#> 68  concepts    ptepx
#> 69  concepts    pterx
#> 70  concepts    ptfnx
#> 71  concepts    ptfpx
#> 72  concepts    ptfrx
#> 73  concepts    ptinc
#> 74  concepts    ptkin
#> 75  concepts    ptlin
#> 76  concepts    ptrrx
#> 77  concepts    sagco
#> 78  concepts    savco
#> 79  concepts    secco
#> 80  concepts    secfc
#> 81  concepts    secgo
#> 82  concepts    sechn
#> 83  concepts    secho
#> 84  concepts    secnf
#> 85  concepts    secnp
#> 86  concepts    segco
#> 87  concepts    seggo
#> 88  concepts    seghn
#> 89  concepts    segho
#> 90  concepts    segnp
#> 91  concepts    tiwgo
#> 92  concepts    tiwhn
#> 93  concepts    tiwho
#> 94  concepts    tiwnp
#> 95  concepts   wcapsh
#> 96  concepts   wcsgni
#> 97  concepts   wcsnni
#> 98  concepts   wlabsh
#> 99  concepts   wlsgni
#> 100 concepts   wlsnni
#> 101 concepts   wwealc
#> 102 concepts   wwealg
#> 103 concepts   wwealh
#> 104 concepts   wweali
#> 105 concepts   wwealn
#> 106 concepts   wwealp
#>                                                       description
#> 1                                  (=) post-tax disposable income
#> 2                     (+) CFC of mixed income of household sector
#> 3   (+) consumption of fixed capital attributable to mixed income
#> 4                                  (+) CFC income of corporations
#> 5                                        (+) corporate income tax
#> 6                                    (+) net foreign labor income
#> 7                                    (=) post-tax national income
#> 8                                      (=) factor national income
#> 9                        (+) net foreign direct investment income
#> 10                           (+) foreign direct investment income
#> 11                           (+) foreign direct investment income
#> 12                                      (+) fiscal capital income
#> 13                                              (=) fiscal income
#> 14                                        (+) fiscal labor income
#> 15                          (+) capital component of mixed-income
#> 16                            (+) labor component of mixed-income
#> 17                                               (=) mixed-income
#> 18               (-) foreign income paid to the rest of the world
#> 19         (+) foreign income received from the rest of the world
#> 20                                         (+) net capital income
#> 21                       (+) net foreign labor and capital income
#> 22     (+) labor and capital income paid to the rest of the world
#> 23        (+) labor and capital income from the rest of the world
#> 24                                        (=) labor factor income
#> 25                     (+) gross mixed income of household sector
#> 26                                         (+) gross mixed income
#> 27                   (+) gross operating surplus and mixed income
#> 28                   (+) gross operating surplus and mixed income
#> 29                   (+) gross operating surplus and mixed income
#> 30                Consumer price index / national income deflator
#> 31                       (+) net mixed income of household sector
#> 32                             (+) net mixed income of households
#> 33                                             (+) foreign income
#> 34                                        (=) net national income
#> 35                     (+) net operating surplus and mixed income
#> 36                     (+) net operating surplus and mixed income
#> 37                                 (+) net foreign capital income
#> 38              (+) property income paid to the rest of the world
#> 39        (+) property income received from the rest of the world
#> 40                                        (+) personal income tax
#> 41                                      (+) pretax capital income
#> 42                                        (+) pretax labor income
#> 43                       (=) gross primary income of corporations
#> 44             (=) gross primary income of financial corporations
#> 45             (=) gross primary income of the general government
#> 46               (=) gross primary income of households and NPISH
#> 47                         (=) gross primary income of households
#> 48         (=) gross primary income of non-financial corporations
#> 49                              (=) gross primary income of NPISH
#> 50                         (+) net primary income of corporations
#> 51               (+) net primary income of financial corporations
#> 52               (+) net primary income of the general government
#> 53           (+) net primary income of households and non-profits
#> 54                           (+) net primary income of households
#> 55           (+) net primary income of non-financial corporations
#> 56                          (+) net primary income of non-profits
#> 57                            (+) property income of corporations
#> 58                                      (+) property income (net)
#> 59                          (+) property income of the government
#> 60                    (+) property income of households and NPISH
#> 61                                      (+) property income (net)
#> 62                                      (+) property income (net)
#> 63                                      (+) property income (net)
#> 64                                            (+) net debt income
#> 65                                                (+) debt income
#> 66                                                (+) debt income
#> 67                                          (+) net equity income
#> 68                                              (+) equity income
#> 69                                              (+) equity income
#> 70                                       (+) net portfolio income
#> 71                                 (+) portfolio and other income
#> 72                                 (+) portfolio and other income
#> 73                                     (=) pretax national income
#> 74                                      (+) pretax capital income
#> 75                                        (+) pretax labor income
#> 76                                            (+) reserves income
#> 77             (+) gross savings/secondary income of corporations
#> 78               (+) net savings/secondary income of corporations
#> 79                       (+) net secondary income of corporations
#> 80             (+) net secondary income of financial corporations
#> 81             (+) net secondary income of the general government
#> 82         (+) net secondary income of households and non-profits
#> 83                         (+) net secondary income of households
#> 84         (+) net secondary income of non-financial corporations
#> 85                        (+) net secondary income of non-profits
#> 86        (=) gross secondary income/gross saving of corporations
#> 87           (=) gross secondary income of the general government
#> 88             (=) gross secondary income of households and NPISH
#> 89                       (=) gross secondary income of households
#> 90                            (=) gross secondary income of NPISH
#> 91                          (+) direct taxes on income and wealth
#> 92              (+) taxes on income and wealth paid by households
#> 93                        (+) personal taxes on income and wealth
#> 94                        (+) personal taxes on income and wealth
#> 95                               Capital share of national income
#> 96   Capital share of total gross national income at factor-price
#> 97         Capital share of total national income at factor-price
#> 98                                 Labor share of national income
#> 99     Labor share of total gross national income at factor-price
#> 100          Labor share of total national income at factor-price
#> 101                              Corporate wealth-to-income ratio
#> 102                             Government wealth-to-income ratio
#> 103                              Household wealth-to-income ratio
#> 104                          Institutional wealth-to-income ratio
#> 105                           Net national wealth-to-income ratio
#> 106                                Private wealth-to-income ratio
wid_search("^ptinc$", tables = "concepts")   # exact match
#>      table variable                description
#> 1 concepts    ptinc (=) pretax national income

To find all share series for wealth:

wid_search("wealth", type = "s")
#> No matches found.

Age groups (wid_ages)

Age groups are represented by three-digit, zero-padded codes for population brackets. There are 40 defined age groups.

wid_ages
#>    code
#> 1   999
#> 2   014
#> 3   156
#> 4   997
#> 5   991
#> 6   992
#> 7   993
#> 8   994
#> 9   995
#> 10  996
#> 11  998
#> 12  201
#> 13  251
#> 14  301
#> 15  351
#> 16  401
#> 17  451
#> 18  501
#> 19  551
#> 20  601
#> 21  651
#> 22  701
#> 23  751
#> 24  801
#> 25  851
#> 26  901
#> 27  951
#> 28  111
#> 29  001
#> 30  051
#> 31  101
#> 32  151
#> 33  202
#> 34  302
#> 35  402
#> 36  502
#> 37  602
#> 38  702
#> 39  802
#> 40  902
#>                                                                  description
#> 1                    The population is comprised of individuals of all ages.
#> 2       The population is comprised of individuals in the 0 to 14 age group.
#> 3      The population is comprised of individuals in the 15 to 64 age group.
#> 4             The population is comprised of individuals over the age of 65.
#> 5            The population is comprised of individuals below the age of 20.
#> 6             The population is comprised of individuals over the age of 20.
#> 7  The population is comprised of individuals between the ages of 20 and 39.
#> 8  The population is comprised of individuals between the ages of 40 and 59.
#> 9             The population is comprised of individuals over the age of 60.
#> 10 The population is comprised of individuals between the ages of 20 and 64.
#> 11            The population is comprised of individuals over the age of 80.
#> 12     The population is comprised of individuals in the 20 to 24 age group.
#> 13     The population is comprised of individuals in the 25 to 29 age group.
#> 14     The population is comprised of individuals in the 30 to 34 age group.
#> 15     The population is comprised of individuals in the 35 to 39 age group.
#> 16     The population is comprised of individuals in the 40 to 44 age group.
#> 17     The population is comprised of individuals in the 45 to 49 age group.
#> 18     The population is comprised of individuals in the 50 to 54 age group.
#> 19     The population is comprised of individuals in the 55 to 59 age group.
#> 20     The population is comprised of individuals in the 60 to 64 age group.
#> 21     The population is comprised of individuals in the 65 to 69 age group.
#> 22     The population is comprised of individuals in the 70 to 74 age group.
#> 23     The population is comprised of individuals in the 75 to 79 age group.
#> 24     The population is comprised of individuals in the 80 to 84 age group.
#> 25     The population is comprised of individuals in the 85 to 89 age group.
#> 26     The population is comprised of individuals in the 90 to 94 age group.
#> 27     The population is comprised of individuals in the 95 to 99 age group.
#> 28            The population is comprised of individuals over the age of 99.
#> 29       The population is comprised of individuals in the 0 to 4 age group.
#> 30       The population is comprised of individuals in the 5 to 9 age group.
#> 31     The population is comprised of individuals in the 10 to 14 age group.
#> 32     The population is comprised of individuals in the 15 to 19 age group.
#> 33     The population is comprised of individuals in the 20 to 29 age group.
#> 34     The population is comprised of individuals in the 30 to 39 age group.
#> 35     The population is comprised of individuals in the 40 to 49 age group.
#> 36     The population is comprised of individuals in the 50 to 59 age group.
#> 37     The population is comprised of individuals in the 60 to 69 age group.
#> 38     The population is comprised of individuals in the 70 to 79 age group.
#> 39     The population is comprised of individuals in the 80 to 89 age group.
#> 40     The population is comprised of individuals in the 90 to 99 age group.

The most-used groups:

Code Description
999 all ages
992 adults 20+ (most common default)
996 adults 20–64 (working age)
993 adults 20–39
994 adults 40–59
995 adults 60+
997 elderly 65+
014 children 0–14

The default in download_wid() is ages = "992". To download all available age groups pass ages = "all".

wid_validate(age = 992)    # validates and zero-pads: "992"
wid_validate(age = "014")

Population types (wid_pop_types)

One-letter codes for the statistical unit of observation. There are 6 types.

wid_pop_types
#>   code        description
#> 1    i        individuals
#> 2    j equal-split adults
#> 3    m               male
#> 4    f             female
#> 5    t           tax unit
#> 6    e           employed
Code Description
j equal-split adults (income/wealth split equally between spouses)
i individuals
t tax units
m male
f female
e employed

j (equal-split) is the standard unit for distributional comparisons because it avoids counting couples differently in countries with different filing conventions. The default in download_wid() is pop = "j".

Countries and regions (wid_countries)

Two-letter ISO codes plus WID regional aggregates. There are 281 entries.

head(wid_countries, 10)
#>    code          description
#> 1    AD              Andorra
#> 2    AE United Arab Emirates
#> 3    AF          Afghanistan
#> 4    AG  Antigua and Barbuda
#> 5    AI             Anguilla
#> 6    AL              Albania
#> 7    AM              Armenia
#> 8    AO               Angola
#> 9    AR            Argentina
#> 10   AT              Austria

Country sub-regions follow the pattern XX-YY (e.g. US-CA for California). Regional aggregates use non-standard codes (e.g. WO for world, QE for Europe).

wid_search("United States", tables = "countries")
#> No matches found.
wid_search("^US", tables = "countries")     # US and all sub-regions
#>        table variable          description
#> 1  countries       SU                 USSR
#> 2  countries       US                  USA
#> 3  countries    US-AK               Alaska
#> 4  countries    US-AL              Alabama
#> 5  countries    US-AR             Arkansas
#> 6  countries    US-AZ              Arizona
#> 7  countries    US-CA           California
#> 8  countries    US-CO             Colorado
#> 9  countries    US-CT          Connecticut
#> 10 countries    US-DC District of Columbia
#> 11 countries    US-DE             Delaware
#> 12 countries    US-FL              Florida
#> 13 countries    US-GA              Georgia
#> 14 countries    US-HI               Hawaii
#> 15 countries    US-IA                 Iowa
#> 16 countries    US-ID                Idaho
#> 17 countries    US-IL             Illinois
#> 18 countries    US-IN              Indiana
#> 19 countries    US-KS               Kansas
#> 20 countries    US-KY             Kentucky
#> 21 countries    US-LA            Louisiana
#> 22 countries    US-MA        Massachusetts
#> 23 countries    US-MD             Maryland
#> 24 countries    US-ME                Maine
#> 25 countries    US-MI             Michigan
#> 26 countries    US-MN            Minnesota
#> 27 countries    US-MO             Missouri
#> 28 countries    US-MS          Mississippi
#> 29 countries    US-MT              Montana
#> 30 countries    US-NC       North Carolina
#> 31 countries    US-ND         North Dakota
#> 32 countries    US-NE             Nebraska
#> 33 countries    US-NH        New Hampshire
#> 34 countries    US-NJ           New Jersey
#> 35 countries    US-NM           New Mexico
#> 36 countries    US-NV               Nevada
#> 37 countries    US-NY             New York
#> 38 countries    US-OH                 Ohio
#> 39 countries    US-OK             Oklahoma
#> 40 countries    US-OR               Oregon
#> 41 countries    US-PA         Pennsylvania
#> 42 countries    US-RI         Rhode Island
#> 43 countries    US-SC       South Carolina
#> 44 countries    US-SD         South Dakota
#> 45 countries    US-TN            Tennessee
#> 46 countries    US-TX                Texas
#> 47 countries    US-UT                 Utah
#> 48 countries    US-VA             Virginia
#> 49 countries    US-VT              Vermont
#> 50 countries    US-WA           Washington
#> 51 countries    US-WI            Wisconsin
#> 52 countries    US-WV        West Virginia
#> 53 countries    US-WY              Wyoming
wid_search("Europe", tables = "countries")
#> No matches found.

wid_validate() warns on codes not matching the ^[A-Z]{2}(-[A-Z0-9]{1,5})?$ pattern:

wid_validate(areas = c("US", "FR", "US-CA"))    # valid
wid_validate(areas = "lowercase")               # warning
#> Warning: Area codes may be invalid: lowercase

Percentiles (wid_percentiles)

Codes of the form pXpY specifying a fraction of the distribution. There are 184 enumerated codes.

head(wid_percentiles, 10)
#>      code       description
#> 1    p0p1         Bottom 1%
#> 2   p0p10        Bottom 10%
#> 3  p0p100 Entire population
#> 4   p0p20        Bottom 20%
#> 5   p0p30        Bottom 30%
#> 6   p0p40        Bottom 40%
#> 7   p0p50        Bottom 50%
#> 8   p0p60        Bottom 60%
#> 9   p0p70        Bottom 70%
#> 10  p0p80        Bottom 80%

Semantics by series type

The meaning of a percentile code depends on the series type:

Common codes

Code Meaning
p0p100 whole population
p0p50 bottom 50%
p50p90 middle 40%
p90p100 top 10%
p99p100 top 1%
p99.9p100 top 0.1%
p99.99p100 top 0.01%
p0p50, p50p90, p90p100 the three standard WID groups
wid_search("top 1", tables = "percentiles")
#>         table variable description
#> 1 percentiles  p90p100     Top 10%
#> 2 percentiles  p99p100      Top 1%
wid_search("bottom", tables = "percentiles")
#>          table variable description
#> 1  percentiles     p0p1   Bottom 1%
#> 2  percentiles    p0p10  Bottom 10%
#> 3  percentiles    p0p20  Bottom 20%
#> 4  percentiles    p0p30  Bottom 30%
#> 5  percentiles    p0p40  Bottom 40%
#> 6  percentiles    p0p50  Bottom 50%
#> 7  percentiles    p0p60  Bottom 60%
#> 8  percentiles    p0p70  Bottom 70%
#> 9  percentiles    p0p80  Bottom 80%
#> 10 percentiles    p0p90  Bottom 90%

Validation

wid_validate() checks that the lower bound is strictly less than the upper:

wid_validate(perc = "p99p100")    # valid
wid_validate(perc = "p90p10")     # error: invalid percentile order
wid_validate(perc = "bad")        # error: invalid format

Searching across all tables

Pass tables = "all" to search every table simultaneously:

wid_search("income", tables = "all")
#>            table variable
#> 1       concepts    cainc
#> 2       concepts    ccmhn
#> 3       concepts    ccmho
#> 4       concepts    cfcco
#> 5       concepts    citgr
#> 6       concepts    comnx
#> 7       concepts    diinc
#> 8       concepts    fainc
#> 9       concepts    fdinx
#> 10      concepts    fdipx
#> 11      concepts    fdirx
#> 12      concepts    ficap
#> 13      concepts    fiinc
#> 14      concepts    filin
#> 15      concepts    fimik
#> 16      concepts    fimil
#> 17      concepts    fimix
#> 18      concepts    finpx
#> 19      concepts    finrx
#> 20      concepts    fkpin
#> 21      concepts    flcin
#> 22      concepts    flcip
#> 23      concepts    flcir
#> 24      concepts    flinc
#> 25      concepts    gmxhn
#> 26      concepts    gmxho
#> 27      concepts    gsmhn
#> 28      concepts    gsmho
#> 29      concepts    gsrnp
#> 30      concepts   inyixx
#> 31      concepts    nmxhn
#> 32      concepts    nmxho
#> 33      concepts    nnfin
#> 34      concepts    nninc
#> 35      concepts    nsmhn
#> 36      concepts    nsmho
#> 37      concepts    pinnx
#> 38      concepts    pinpx
#> 39      concepts    pinrx
#> 40      concepts    pitgr
#> 41      concepts    pkkin
#> 42      concepts    pllin
#> 43      concepts    prgco
#> 44      concepts    prgfc
#> 45      concepts    prggo
#> 46      concepts    prghn
#> 47      concepts    prgho
#> 48      concepts    prgnf
#> 49      concepts    prgnp
#> 50      concepts    prico
#> 51      concepts    prifc
#> 52      concepts    prigo
#> 53      concepts    prihn
#> 54      concepts    priho
#> 55      concepts    prinf
#> 56      concepts    prinp
#> 57      concepts    prpco
#> 58      concepts    prpfc
#> 59      concepts    prpgo
#> 60      concepts    prphn
#> 61      concepts    prpho
#> 62      concepts    prpnf
#> 63      concepts    prpnp
#> 64      concepts    ptdnx
#> 65      concepts    ptdpx
#> 66      concepts    ptdrx
#> 67      concepts    ptenx
#> 68      concepts    ptepx
#> 69      concepts    pterx
#> 70      concepts    ptfnx
#> 71      concepts    ptfpx
#> 72      concepts    ptfrx
#> 73      concepts    ptinc
#> 74      concepts    ptkin
#> 75      concepts    ptlin
#> 76      concepts    ptrrx
#> 77      concepts    sagco
#> 78      concepts    savco
#> 79      concepts    secco
#> 80      concepts    secfc
#> 81      concepts    secgo
#> 82      concepts    sechn
#> 83      concepts    secho
#> 84      concepts    secnf
#> 85      concepts    secnp
#> 86      concepts    segco
#> 87      concepts    seggo
#> 88      concepts    seghn
#> 89      concepts    segho
#> 90      concepts    segnp
#> 91      concepts    tiwgo
#> 92      concepts    tiwhn
#> 93      concepts    tiwho
#> 94      concepts    tiwnp
#> 95      concepts   wcapsh
#> 96      concepts   wcsgni
#> 97      concepts   wcsnni
#> 98      concepts   wlabsh
#> 99      concepts   wlsgni
#> 100     concepts   wlsnni
#> 101     concepts   wwealc
#> 102     concepts   wwealg
#> 103     concepts   wwealh
#> 104     concepts   wweali
#> 105     concepts   wwealn
#> 106     concepts   wwealp
#> 107 series_types        w
#>                                                       description
#> 1                                  (=) post-tax disposable income
#> 2                     (+) CFC of mixed income of household sector
#> 3   (+) consumption of fixed capital attributable to mixed income
#> 4                                  (+) CFC income of corporations
#> 5                                        (+) corporate income tax
#> 6                                    (+) net foreign labor income
#> 7                                    (=) post-tax national income
#> 8                                      (=) factor national income
#> 9                        (+) net foreign direct investment income
#> 10                           (+) foreign direct investment income
#> 11                           (+) foreign direct investment income
#> 12                                      (+) fiscal capital income
#> 13                                              (=) fiscal income
#> 14                                        (+) fiscal labor income
#> 15                          (+) capital component of mixed-income
#> 16                            (+) labor component of mixed-income
#> 17                                               (=) mixed-income
#> 18               (-) foreign income paid to the rest of the world
#> 19         (+) foreign income received from the rest of the world
#> 20                                         (+) net capital income
#> 21                       (+) net foreign labor and capital income
#> 22     (+) labor and capital income paid to the rest of the world
#> 23        (+) labor and capital income from the rest of the world
#> 24                                        (=) labor factor income
#> 25                     (+) gross mixed income of household sector
#> 26                                         (+) gross mixed income
#> 27                   (+) gross operating surplus and mixed income
#> 28                   (+) gross operating surplus and mixed income
#> 29                   (+) gross operating surplus and mixed income
#> 30                Consumer price index / national income deflator
#> 31                       (+) net mixed income of household sector
#> 32                             (+) net mixed income of households
#> 33                                             (+) foreign income
#> 34                                        (=) net national income
#> 35                     (+) net operating surplus and mixed income
#> 36                     (+) net operating surplus and mixed income
#> 37                                 (+) net foreign capital income
#> 38              (+) property income paid to the rest of the world
#> 39        (+) property income received from the rest of the world
#> 40                                        (+) personal income tax
#> 41                                      (+) pretax capital income
#> 42                                        (+) pretax labor income
#> 43                       (=) gross primary income of corporations
#> 44             (=) gross primary income of financial corporations
#> 45             (=) gross primary income of the general government
#> 46               (=) gross primary income of households and NPISH
#> 47                         (=) gross primary income of households
#> 48         (=) gross primary income of non-financial corporations
#> 49                              (=) gross primary income of NPISH
#> 50                         (+) net primary income of corporations
#> 51               (+) net primary income of financial corporations
#> 52               (+) net primary income of the general government
#> 53           (+) net primary income of households and non-profits
#> 54                           (+) net primary income of households
#> 55           (+) net primary income of non-financial corporations
#> 56                          (+) net primary income of non-profits
#> 57                            (+) property income of corporations
#> 58                                      (+) property income (net)
#> 59                          (+) property income of the government
#> 60                    (+) property income of households and NPISH
#> 61                                      (+) property income (net)
#> 62                                      (+) property income (net)
#> 63                                      (+) property income (net)
#> 64                                            (+) net debt income
#> 65                                                (+) debt income
#> 66                                                (+) debt income
#> 67                                          (+) net equity income
#> 68                                              (+) equity income
#> 69                                              (+) equity income
#> 70                                       (+) net portfolio income
#> 71                                 (+) portfolio and other income
#> 72                                 (+) portfolio and other income
#> 73                                     (=) pretax national income
#> 74                                      (+) pretax capital income
#> 75                                        (+) pretax labor income
#> 76                                            (+) reserves income
#> 77             (+) gross savings/secondary income of corporations
#> 78               (+) net savings/secondary income of corporations
#> 79                       (+) net secondary income of corporations
#> 80             (+) net secondary income of financial corporations
#> 81             (+) net secondary income of the general government
#> 82         (+) net secondary income of households and non-profits
#> 83                         (+) net secondary income of households
#> 84         (+) net secondary income of non-financial corporations
#> 85                        (+) net secondary income of non-profits
#> 86        (=) gross secondary income/gross saving of corporations
#> 87           (=) gross secondary income of the general government
#> 88             (=) gross secondary income of households and NPISH
#> 89                       (=) gross secondary income of households
#> 90                            (=) gross secondary income of NPISH
#> 91                          (+) direct taxes on income and wealth
#> 92              (+) taxes on income and wealth paid by households
#> 93                        (+) personal taxes on income and wealth
#> 94                        (+) personal taxes on income and wealth
#> 95                               Capital share of national income
#> 96   Capital share of total gross national income at factor-price
#> 97         Capital share of total national income at factor-price
#> 98                                 Labor share of national income
#> 99     Labor share of total gross national income at factor-price
#> 100          Labor share of total national income at factor-price
#> 101                              Corporate wealth-to-income ratio
#> 102                             Government wealth-to-income ratio
#> 103                              Household wealth-to-income ratio
#> 104                          Institutional wealth-to-income ratio
#> 105                           Net national wealth-to-income ratio
#> 106                                Private wealth-to-income ratio
#> 107                 wealth-to-income ratio or labor/capital share

Building and validating codes

# Validate before building
wid_validate(series_type = "s", concept = "ptinc", age = 992, pop = "j")

# Encode
code <- wid_encode("s", "ptinc", "992", "j")
code  # "sptinc992j"
#> [1] "sptinc992j"

# Round-trip
identical(wid_encode(wid_decode(code)), code)  # TRUE
#> [1] TRUE

# Non-throwing check
wid_is_valid(series_type = "Z")   # FALSE
#> [1] FALSE
wid_is_valid(series_type = "s")   # TRUE
#> [1] TRUE

The exchange rate codes

Exchange rate series follow a distinct naming convention. The concept occupies the standard positions but carries a currency and direction suffix:

Code Description
xlcusx999i LCU per USD (market)
xlceup999i EUR per LCU (market)
xlpppx999i LCU per USD (PPP)

wid_convert() uses these internally. The age 999 (all ages) and pop i (individuals) are standard for price/exchange indices, which have no distributional meaning and are always retrieved at p0p100.

Reference

Function Purpose
wid_decode(x) Parse code string into components
wid_encode(type, concept, age, pop) Build code string from components
wid_validate(...) Validate one or more components
wid_is_valid(...) Non-throwing validation check
wid_search(query, tables, type) Search lookup tables by regex
wid_series_types Lookup table: series types
wid_concepts Lookup table: concepts
wid_ages Lookup table: age groups
wid_pop_types Lookup table: population types
wid_countries Lookup table: countries and regions
wid_percentiles Lookup table: percentile codes