RainbowStats · World Bank
WORLD_GDP
Compare one development indicator with purchasing-power-adjusted GDP per capita across countries and territories.
Syntax
WORLD_GDP(indicator,year[,fit,xScale,yScale])
Arguments resolve through getTool() via parseArgExpr(): use quoted indicator/option strings or string variables, and an integer numeric expression or variable for the year, 1960–2200. No automatic latest-year selection.
Examples
Life=WORLD_GDP("SP.DYN.LE00.IN",2023)
EXTRACT(Life,"regression")
WORLD_GDP("SP.DYN.LE00.IN",2023,"linear","log","linear")
WORLD_GDP("SH.DYN.MORT",2023,"loglog","log","log")
WORLD_GDP("EG.ELC.ACCS.ZS",2023,"none")
Models and axes
Default log estimates Y = a + b ln(GDP), with log X display and linear Y display.
linear estimates Y = a + b GDP; loglog estimates ln(Y) = a + b ln(GDP);
none displays points only. Both axis options accept linear or log independently.
In the default model, a doubling of GDP is associated with b ln(2) outcome units. In loglog, b is an elasticity; R² and residuals refer to ln(Y). Its displayed exp(predicted ln Y) curve has no retransformation bias correction.
Extracts
chart: one chart;
regression, model, summary: equation and fit statistics;
data: matched countries with fitted outcomes and model residuals;
residuals, outliers: all matched rows ranked by absolute model residual;
source, sources, metadata, license: source details and attribution.
Coverage and interpretation
GDP is NY.GDP.PCAP.PP.KD: PPP, constant 2021 international dollars. One exact year is used for both indicators. Countries are aligned by ISO3; regional/income aggregates are excluded by the existing World Bank client. Missing values stay missing. No interpolation or reuse of older observations occurs. Nonpositive GDP is excluded; log outcomes and log Y axes require positive Y. Each country/territory has equal weight. A fit needs three valid observations and varying GDP.
Do not label SH.DYN.MORT as percent: it is deaths under age five per 1,000 live births. Stunting measures child height-for-age, not all hunger. Preserve each outcome's published units.
Income, health, institutions and education can influence each other. These descriptive regressions do not identify causal effects. A log-income fit assumes diminishing marginal income associations; it is not imposed by a logarithmic display axis.
Page cards
Place WORLD_GDP directly in a markets JSON command field.
Use a fixed period, such as 2023; no {{since}} is required.
Output is an SVG chart inside the existing D3 HTML operator, with native point-title hover labels and no new renderer JavaScript.
Available extracts
Save the command result in a variable, then use EXTRACT(result, "key"). Availability can depend on the input form and fitted model.
chartregressionmodelsummarydataresidualsoutlierssourcesourcesmetadatalicense
In indexed patterns such as beta:n, replace n with the required index.