---
title: "readme"
output: word_document
date: "2025-10-29"
---


## Overview
- To process, construct, and calculate price-adjusted trade data needed for a blog on US merchandise trade by product. 
- For the purpose of this blog, and due to data availability, trade data from April to July in 2024 and 2025 are used.

## Execution
- Open the R project `trade tracker-products-jul.Rproj` and then the`main.R`.
- Run the code in the `main.R`.

## Data inputs [folder: raw data]
- trade data:
  1. USITC DataWeb, monthly trade data (CIF imports, FAS exports), accessed on 10/27/2025 [folder: raw data/trade data/Imports.xlsx] [folder: raw data/trade data/Exports.xlsx]

- tariff revenue data:
  1. USITC DataWeb, monthly CIF imports and calculated duties [path: raw data/trade data/Calculated duties and CIF imports]
  
- price index:
  1. price indices data [raw data/ei.data.0.Current.txt]
  2. series names and descriptions [raw data/ei.series.txt]
  3. price indices used can also be found in the output folder
  * As noted in Table 1, price indices are assigned by first matching at the HTS-2 level; if unavailable, the corresponding HTS chapter index is used, and when both are missing, the total index is applied. Real trade values are calculated at the HTS chapter level before being aggregated to the above sector categories.


## Data outputs [folder: output-apr to july]
  1. Data ready for graphs and correlation calculations [cleaned_data_full.xlsx]
  
  Others:
  2. Underlying data [underlying_data_full.xlsx]
  3. HTS chapters mapping [HTS chapters map.xlsx]
  4. Price indices used for price adjustment [index_used_data.xlsx]
  5. Tariff revenue and respective CIF imports at HS-02 level in 2024 and 2025 [tariff_rev.xlsx]
  
  
  
  