Project Data Dictionary & Processing Guide
Overview
This document describes all datasets for the Global Commodity Shocks & Production Networks project. Each team member should process their assigned datasets following the specifications below.
1. COMMODITY PRICES DATA
File: CMO-Historical-Data-Monthly.xlsx
Location: data/raw/commodity_prices/
Source: World Bank Pink Sheet
Coverage: Monthly, 1960-2024
What It Contains:
Sheet 1 - Monthly Prices: Nominal prices (USD) for 70+ commodities
- Energy: Crude oil (Brent, WTI, Dubai), Natural gas, Coal
- Agriculture: Wheat, Rice, Maize, Soybeans, Sugar, Coffee
- Metals: Copper, Aluminum, Iron ore, Gold, Silver
Sheet 2 - Monthly Indices: Price indices (2010=100 base year)
- Aggregate indices by commodity group
- Useful for comparing relative price movements
Sheet 3 - Index Weights: Weights used in index construction
Why We Need It:
This is our primary shock variable. Oil price spikes, wheat price volatility, and metal price crashes are the "shocks" we're studying. Changes in these prices affect India's production network.
Processing Tasks:
- Extract columns: Date, Crude oil (average), Wheat (US HRW), Rice (Thai 5%), Copper, Aluminum
- Filter to 2010-2024 only
- Calculate log returns:
log(Price_t / Price_{t-1}) - Calculate rolling volatility (3, 6, 12-month windows)
- Create shock indicators: binary variable = 1 if price change > 2 standard deviations
- Save as:
data/processed/commodity_prices_clean.csv
Expected Output Columns:
date, oil_price, wheat_price, rice_price, copper_price, aluminum_price,
oil_return, wheat_return, rice_return, copper_return, aluminum_return,
oil_volatility_3m, oil_volatility_6m, oil_volatility_12m,
oil_shock_binary, wheat_shock_binary, etc.
2. CLIMATE DATA (INSTRUMENTAL VARIABLE)
File: Monthly Oceanic Nino Index (ONI) - Wide.csv
Location: data/raw/climate/
Source: NOAA Climate Prediction Center
Coverage: Monthly, 1950-2024
What It Contains:
- Oceanic Niño Index (ONI): 3-month running mean of sea surface temperature anomalies in the Niño 3.4 region
- Values range from -2.5°C (strong La Niña) to +2.5°C (strong El Niño)
Why We Need It:
El Niño/La Niña events affect global weather patterns → agricultural production → wheat/rice prices. We use ONI as an instrumental variable (IV) for agricultural commodity prices because:
- ONI affects crop yields (relevant)
- ONI doesn't directly affect Indian manufacturing output (excludable)
- This helps us establish causal relationships, not just correlations
Processing Tasks:
- Filter to 2010-2024
- Classify ENSO phases:
- El Niño: ONI ≥ 0.5
- La Niña: ONI ≤ -0.5
- Neutral: -0.5 < ONI < 0.5
- Create lag variables (1, 3, 6 months) - weather affects crops with delay
- Save as:
data/processed/climate_oni_clean.csv
Expected Output Columns:
date, oni_index, enso_phase, oni_lag1, oni_lag3, oni_lag6
3. TRADE DATA
File: dataset_2025-10-22T07_56_33...csv (3 GB!)
Location: data/raw/trade/
Source: IMF International Merchandise Trade Statistics (IMTS)
Coverage: Monthly bilateral trade flows, all countries, 2000-2024
What It Contains:
- Bilateral trade flows: Country A → Country B, by product category
- Trade values: Imports/Exports in USD
- Product codes: HS classification (Harmonized System)
Why We Need It:
Measures India's trade exposure to different countries and commodities. High dependence on Gulf states for oil = high vulnerability to oil shocks.
Processing Tasks:
- Filter to India only: Reporter = India
- Select 8 key partners: USA, China, Saudi Arabia, UAE, Qatar, Germany, France, Italy
- Aggregate by commodity group:
- Energy (HS 27): Mineral fuels, oils
- Food (HS 10, 11): Cereals, grain products
- Metals (HS 74, 76): Copper, Aluminum
- Calculate trade concentration metrics:
- HHI (Herfindahl Index): Sum of squared trade shares
- Partner diversification score
- Save as:
data/processed/trade_india_bilateral.csv
Expected Output Columns:
date, partner_country, commodity_group,
import_value_usd, export_value_usd, trade_balance,
import_share, export_share
Warning: This file is HUGE (3GB). Use pd.read_csv(chunksize=100000) or filter early with SQL/Dask.
File: WITS-Partner.xlsx
Location: data/raw/trade/
Source: World Bank WITS (World Integrated Trade Solution)
Coverage: Annual trade data with partner country details
What It Contains:
- Country names, ISO codes, regional classifications
- Use as a lookup table to map country codes → country names
Processing Tasks:
- Extract mapping: ISO3 code → Country name → Region
- Merge with IMF trade data
- Save as:
data/processed/country_mapping.csv
4. MACROECONOMIC DATA
File: Index of Industrial Production.xlsx
Location: data/raw/macroeconomic/
Source: Reserve Bank of India (RBI)
Coverage: Monthly, 2010-2024, Base year 2011-12
What It Contains:
- IIP General Index: Overall industrial production
- Sectoral Indices:
- Mining & Quarrying
- Manufacturing (15+ sub-sectors: Food, Textiles, Chemicals, Metals, Machinery, etc.)
- Electricity
- Use-based Classification:
- Basic goods
- Capital goods
- Intermediate goods
- Consumer durables
- Consumer non-durables
Why We Need It:
This is our main outcome variable. We're predicting: "When oil prices spike, which manufacturing sectors see production decline?" IIP measures exactly that.
Processing Tasks:
- Extract all sectoral indices (rows) across time (columns)
- Convert from wide to long format:
date | sector | iip_value - Calculate month-over-month growth rates
- Calculate year-over-year growth rates
- Identify energy-intensive sectors (Manufacturing - Chemicals, Basic Metals, etc.)
- Save as:
data/processed/iip_sectoral.csv
Expected Output Columns:
date, sector_name, iip_index,
iip_mom_growth, iip_yoy_growth,
is_energy_intensive
File: Wholesale Price Index - Monthly Data.xlsx
Location: data/raw/macroeconomic/
Source: Office of Economic Adviser, India
Coverage: Monthly, 2010-2024
What It Contains:
- WPI for different product categories
- Inflation measure at wholesale level (before goods reach consumers)
Why We Need It:
Commodity price shocks → input cost inflation → affects production decisions. WPI captures cost pressures on manufacturers.
Processing Tasks:
- Extract WPI for: Fuel & Power, Manufactured Products, Food Articles
- Calculate inflation rate:
(WPI_t - WPI_{t-12}) / WPI_{t-12} * 100 - Save as:
data/processed/wpi_inflation.csv
Files: GDP Quarterly Estimates (3 files)
Location: data/raw/macroeconomic/
Source: MOSPI National Accounts Statistics
What They Contain:
- Quarterly GDP at constant prices (real GDP)
- Quarterly GDP at current prices (nominal GDP)
- Quarterly GVA (Gross Value Added) by sector
Why We Need It:
Control variables for macroeconomic conditions. GDP growth affects all sectors simultaneously.
Processing Tasks:
- Merge all three files
- Calculate GDP growth rate (YoY)
- Resample to monthly frequency (forward-fill)
- Save as:
data/processed/gdp_quarterly.csv
Files: OECD Data (2 CSV files)
Location: data/raw/macroeconomic/
Source: OECD Data Explorer
What They Contain:
- File 1: G20 GDP growth rates (quarterly)
- File 2: G20 price indices (monthly)
Why We Need It:
Global economic conditions affect India through trade channels. US/China/EU slowdowns reduce demand for Indian exports.
Processing Tasks:
- Extract data for: USA, China, Germany, France, Italy (India's trade partners)
- Calculate average G20 GDP growth
- Merge with India data
- Save as:
data/processed/global_macro.csv
5. INPUT-OUTPUT TABLE
File: Input-Output-Transactions-Table-India-2015-16.pdf
Location: data/raw/input_output/
Source: MOSPI (Ministry of Statistics, India)
Coverage: 139 sectors, year 2015-16
What It Contains:
Use Table: Shows which sectors use inputs from which other sectors
- Rows = industries producing inputs
- Columns = industries using inputs
- Cell (i,j) = Sector j buys inputs worth ₹X from sector i
Make Table: Shows which sectors produce which outputs
- Rows = industries
- Columns = products
- Cell (i,j) = Sector i produces ₹X worth of product j
Why We Need It:
This is the CORE of the project. The I-O table shows the production network:
- Oil refining → Chemicals → Plastics → Manufacturing
- If oil prices spike → refining costs up → chemicals cost up → plastics cost up → manufacturing slows
We model these cascading effects through the network structure.
Processing Tasks:
WARNING: This is a PDF with large tables. Need careful extraction.
Extract Use Table:
- Use Tabula or pdfplumber to extract tables
- Create 139×139 matrix:
A[i,j]= input from sector i to sector j
Calculate Technical Coefficients:
a[i,j] = A[i,j] / X[j]where X[j] = total output of sector j- This gives "input per unit of output"
Calculate Leontief Inverse:
L = (I - a)^(-1)where I is identity matrix- L[i,j] = total output from sector i needed to produce 1 unit of final demand in sector j
- This captures direct + indirect linkages
Calculate Forward & Backward Linkages:
- Backward linkage = sum of column in L matrix (how much sector j pulls from others)
- Forward linkage = sum of row in L matrix (how much sector i pushes to others)
Build Network Graph:
- Nodes = 139 sectors
- Edge (i→j) with weight = a[i,j] (technical coefficient)
- Save edge list as:
data/processed/production_network_edges.csv - Save node attributes as:
data/processed/production_network_nodes.csv
Expected Outputs:
production_network_edges.csv:
source_sector, target_sector, input_coefficient, input_value
production_network_nodes.csv:
sector_id, sector_name,
backward_linkage, forward_linkage,
total_output, is_key_sector
6. NETWORK METRICS TO CALCULATE
Once production network is built, calculate these for each sector:
Centrality Measures:
Degree Centrality:
- In-degree: How many sectors provide inputs to this sector
- Out-degree: How many sectors does this sector supply to
Betweenness Centrality:
- How often this sector lies on shortest paths between other sectors
- High betweenness = bottleneck sector (e.g., electricity, transport)
Closeness Centrality:
- Average distance to all other sectors
- High closeness = well-connected, quickly affected by shocks
Eigenvector Centrality:
- Importance based on importance of neighbors
- High eigenvector = connected to other important sectors
PageRank:
- Google's algorithm applied to production network
- Measures "influence" in the network
Network Topology:
- Clustering Coefficient: How interconnected are neighbors
- Path Length: Average steps between any two sectors
- Network Density: % of possible connections that exist
- Community Detection: Groups of tightly connected sectors
Save as: data/processed/network_metrics.csv
SUMMARY: TEAM TASK ASSIGNMENTS
Person 1: Commodity Prices + Climate
- Process CMO commodity prices
- Process NOAA ONI climate data
- Create shock indicators
- Deliverable:
commodity_prices_clean.csv,climate_oni_clean.csv
Person 2: Trade Data
- Process IMF IMTS (3GB file - use chunking!)
- Calculate trade concentration indices
- Merge with country mapping
- Deliverable:
trade_india_bilateral.csv,trade_concentration.csv
Person 3: Macroeconomic Data
- Process IIP (most important!)
- Process WPI, CPI, GDP files
- Merge OECD global data
- Deliverable:
iip_sectoral.csv,macro_controls.csv
Person 4: Input-Output Table + Network
- Extract I-O table from PDF (hardest task!)
- Build production network
- Calculate Leontief inverse
- Calculate all network metrics
- Deliverable:
production_network_edges.csv,production_network_nodes.csv,network_metrics.csv
FINAL MERGED DATASET
Once all processing is complete, merge into master dataset:
File: data/processed/master_dataset.csv
Structure:
date, sector_name,
oil_price, wheat_price, copper_price, aluminum_price,
oil_shock, wheat_shock,
oni_index, enso_phase,
import_value, export_value, trade_hhi,
iip_index, iip_growth,
wpi_inflation, gdp_growth,
degree_centrality, betweenness_centrality, eigenvector_centrality,
backward_linkage, forward_linkage,
is_energy_intensive, is_key_sector
Dimensions: ~180 months × 139 sectors × 30+ features = ~750,000 rows
This master dataset feeds into:
- Causal analysis (IV, SCM, VAR)
- ML models (LSTM, XGBoost, GNN)
- Scenario simulations
- Vulnerability index
QUESTIONS?
Contact project lead if:
- Files don't match descriptions above
- Data extraction fails (especially I-O PDF)
- Need clarification on calculations
- Encounter missing data / data quality issues
Target completion: End of Week 1 (Day 5)