# USMCA Imports

## Project Overview

The analysis uses USITC DataWeb import data to compute, for each HTS code, what fraction of U.S. imports in 2025 came from Canada and Mexico combined versus the rest of the world. Results are then categorized by good type (consumer goods, capital goods, raw materials, industrial intermediates) using the UN's Broad Economic Categories (BEC Rev. 5) classification.



## Raw Data

Source data was downloaded from [USITC DataWeb](https://dataweb.usitc.gov/) for calendar year 2025, using General Customs Value.


| `Canada_Mexico_Imports_2025.xlsx` | U.S. imports from Canada and Mexico, 4-digit HTS |
| `TotalImports_2025.xlsx` | U.S. imports from all countries, 4-digit HTS |
| `HS6CAMX.xlsx` | U.S. imports from Canada and Mexico, 6-digit HTS |
| `HS6WORLD.xlsx` | U.S. imports from all countries, 6-digit HTS |
| `4 Digit Data.xlsx` | Supporting 4-digit HTS reference data |

---

## Do Files

### 1. `Import Calculations.do`
Computes the USMCA import share at the **4-digit HTS** level.

- Imports Canada/Mexico and global data from the raw Excel files
- Collapses Canada and Mexico into a single combined value by HTS code
- Merges with global import data and calculates `percent_USMCA = combined_value / global_value`
- Exports results to `Results.xlsx`

### 2. `Sorting by Good Type.do`
Extends the analysis to the **6-digit HTS** level and adds BEC good-type categories.

- Repeats the import/merge/calculation steps using the HS6 source files
- Merges in the HS-to-BEC5 crosswalk (`HS2022toBEC5.xlsx`)
- Classifies each product line into one of five types based on its 3- or 4-digit BEC code:
  - **Consumer goods** — BEC ending in `13`
  - **Capital goods** — BEC ending in `12`
  - **Raw materials** — BEC ending in `111`
  - **Industrial intermediates** — BEC ending in `112`
  - **Other merchandise** — anything not matched above (includes HTS codes with no BEC equivalent, such as certain special tariff provisions)
- Exports results to `Results_6dig.xlsx`

---

## Results

| File | Description |
|------|-------------|
| `Results_6dig.xlsx` | Main output: 6-digit HTS import shares with BEC good-type classification |
| `USMCA Compliance Data.xlsx` | USMCA rules-of-origin compliance data |
| `Results for 4 digit og calculations.xlsx` | 4-digit HTS import share results |
| `output.xlsx` | Additional aggregated output |
| `HS2022toBEC5.xlsx` | BEC crosswalk used in the analysis |


## Notes

- HTS codes appearing in USITC DataWeb but lacking a BEC code (e.g., 980100, 981200, 999995) are retained and classified as "Other merchandise."
- HTS codes present in the BEC crosswalk but not in the DataWeb download are dropped (`_merge == 2`).
- BEC category definitions follow [UN BEC Rev. 5 (Annex I)](https://unstats.un.org/unsd/trade/classifications/SeriesM_53_Rev.5_17-01722-E-Classification-by-Broad-Economic-Categories_PRINT.pdf).
