Skip to main content

Nonlinear Engel curve (GAM)

This illustrates GAM: the relationship between the food expenditure share and income (the Engel curve) is typically nonlinear — declining as income rises (Engel's law). GAM captures this curvature with a smooth function without pre-specifying the form. Figures are illustrative.

Summary: use a smooth function f(income)f(\text{income}) to model the Engel curve, versus a linear OLS.


Step 1 — Ideation

  • Question: how does the food expenditure share change nonlinearly with income?

Step 2 — Literature Review

Engel's law; nonparametric/semiparametric Engel-curve estimation.

Step 3 — Data Collection

Household data (VHLSS): food_share (food expenditure share), lninc (log income/expenditure), controls for household size and region.

Step 4 — Modeling

Choose the Non-linear & semi-parametric family → GAM; mark lninc as a smooth term:

food_sharei=β0+f(lninci)+Xiγ+εifood\_share_i = \beta_0 + f(lninc_i) + X_i\gamma + \varepsilon_i

Illustrative results (format — not real results):

Linear OLSGAM
Relationship shapestraight linedeclining curve (concave)
Adjusted R2R^20.410.52
edf of f(lninc)3.8 (clearly nonlinear)

Sample interpretation: the smooth-function plot shows the food share falling quickly at low income then flattening — exactly Engel's law; GAM fits better than linear OLS (edf > 1 ⇒ nonlinear).

* ── GAM: Engel curve ──────────────────────────────
* Smooth nonlinear relationship: food_share ~ f(income)
npregress series food_share income, basis(bspline 4)

* Marginal effect plot
margins, at(income=(1(0.5)10)) post
marginsplot

Step 5 — Reporting

Export a report + the smooth-function plot + replication code.

Video tutorial

Video Tutorial: Guide to running GAM in EcoLab

See also