Introduction This repository provides R codes to replicate the examples in the book "An Advanced Guide to Trade Policy Analysis: The Structural Gravity Model" The authors provide the codes in Stata and data here.