Skip to content

RVazSantos/AreTariffsMakingAmericaGreatAgain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Are Tariffs Making America Great Again?

Data Analytics Python Pandas Tableau Machine Learning

An in-depth analysis of the tariff policies introduced in 2025, exploring their policy background and assessing their economic impact to date.

Alt text

Business Case

The U.S. Department of Commerce requested a review of the 2025 tariff policies, including their scope and their economic effects to date.
This analysis aims to support policy reassessment and inform potential future actions.

Objectives

1. Scope Evaluation

  • Verify whether the United States has a negative trade balance.
  • Assess whether the main targeted countries and product categories are the most relevant.
  • Identify the sectors most affected by tariff policies.

2. Policy Effect Assessment

  • Evaluate changes in the trade balance.
  • Analyze the impact on the main importing countries.
  • Evaluate changes in imports of targeted products.
  • Examine domestic production and unemployment trends.
  • Evaluate the Consumer Price Index (CPI) trend and generate forecasts up to 2027.

Deliverables

  • Timeline of major 2025 tariff policy implementations.
  • Interactive dashboards covering background, effects, and forecasts.
  • Overall evaluation using a custom assessment framework.
  • Policy recommendations for potential future actions.

Dashboards

Background Context: Country View

Alt text

Key takeaways:

  • Negative Commercial Balance overall and with most countries;
  • Import and Export values are stable between 2022 and 2024;
  • Main Import partners are also main Export partners;

Background Context: Product View

Dashboard Demo

Key takeaways:

  • "Machinery and Electrical Equipment" is the main Product Section;
  • Main Chapters are "Motor Cars" and "Petroleum Oils";
  • Top 4 partners (EU, CN, MX, CA) account for more than half of all imports;

Tariff Timeline

Dashboard Demo

Key takeaways:

  • Main countries targeted: Canada, Mexico and China;
  • Main products targeted: Aluminum, Steel, Automobiles, Auto parts, Copper and Timber;

Out of Evaluation Scope:

  • Copper, Timber and Trucks (happened too late to measure effects)

Impacts: Product View

Dashboard Demo

Key takeaways:

  • Affected sections of "Base Metal" decreased imports on 22%;
  • Affected sections of "Machinery and Electrical Eq." increased imports on 36%;
  • Affected sections of "Vehicles" decreased imports on 12%;

Impacts: External View

Alt text

Key takeaways:

  • Imports spiked in Q1 of 2025 but then decreased;
  • Imports from Canada and China decreased;

Impacts: Internal View

Alt text

Key takeaways:

  • Commercial balance gap decreased and customs duties jumped 460%;
  • Import Prices decreased slightly;
  • Production Prices increased slightly;
  • Industrial Production changed from negative to positive trend;
  • Manufacturing Employment continues todecrease while Unemployment Ratecontinues to increase;

Machine Learning Model Process

Goal: Predict Consumer Price Index 2026-2027

Inputs:: Commercial Balance, Customs Duties, Import Price Index, Producer Price Index

Process:

  1. Extraction of historical data. Range between 2015 and 2026;
  2. Conversion of series to Month-over-Month;
  3. Creation of lag series. 12 lags created for each series (1 -12 months);
  4. Hypothesis testing. For each series was performed hypothesis testing to reject (or not) if the lag series had a significant impact on the dependable variable;
  5. Selection of features. According to significance, correlation and amount of records. Commercial Balance and Customs Duties series were dropped (no impact found on CPI);
  6. ML algorithm testing Best results (R2 score: 0.402) obtained with: GridSearch: Elastic Net, TimeSeriesSplit (5 splits), StandardScaler;
  7. Independent Variables Forecast. Creation of 24 new periods using SARIMAX;
  8. Dependent Variable Forecast. Application of best algorithm using full historic data as train and previous forecast as test.

Estimates

Alt text

Key takeaways:

  • Commercial Balance and Duties don't influentiate Consumer Price;
  • Import Price tends to zero with less volatility;
  • Producer Price increases and stabilizes near 0;
  • Consumer Prices will keep increasing at low rate;

Scope Evaluation

In order to evaluate the scope of existing tariffs and its negative balance principle, the following rubric has been created:

Alt text

Final score of 0.4 reflects a strategy partially/mostly on target

Policy Effect Assessment

In order to evaluate the effect of existing tariffs externally and internally, the following rubric has been created:

Alt text

Final score of 1.1 reflects a positive effect of the policies taken

Recommendations

Since the previous results show a positive effect, existing policies should be maintained and reinforced. Therefore, the following observations should be taken in consideration:

Recommendation Evidence
Consider chinese computers and cellphones. Chapter 8471: "Automatic data processing machines" and Chapter 8517: "Telephone sets" haven't been targeted yet. They are 4th and 5th from all chapters. Nearly 50% is produced in China. Alt text
Consider Japanese cars. Japan is the 5th biggest import partner mostly due to automotive and auto-parts imports. While specific tariffs are already implement, applying countrie specific tariffs can complement earlier actions. Alt text
Consider Vietnamese cellphones. Vietnam is the 6th biggest import partner with the "telephone sets" being the primary chapter. Import values from Vietnam have increased 71% between 2020 and 2024. Alt text
Reinforce Tariffs to Mexico. Imports from Mexico keep increasing and Mexican pesos are losing value to USD making Mexican products even more competitive. Alt text
Boost automatic data processing machines internal production. Imports of this chapter keep increasing at a high pace (over 100% in 2025) showing a lack of internal production. Alt text
Alternatives to Canadian Oil. Petroleum oils are the 2nd biggest chapter and more than half is imported from Canada. Instead of imposing tariffs (because oil has a considerable effect on inflation), consider new sources or increases others. Alt text

Warnings

Reassess frequently! Relevant time gap between the import of a product/raw material until its purchased by a final consumer. Most of the effects aren't covered by existing data. Also, new action should take this in consideration (preferable to wait before strengthen tariffs).

High Customs Duties! It's estate revenue, but later paid by consumers. Historical data didn't show effect between duties and CPI, but…duties have never been so high! Average american went from paying 20$ to 90$ per month(hidden tax).

Main challenges:

Data Collection. Collection techniques weren't very complex (dataset downloads and web scraping). The hardest part was to identify meaningful inputs, its sources and the most suitable view (e.g. YoY or MoM)

Tariff Timeline The year of 2025 was chaotic regarding tariff threats, implementations, suspensions, increases and decreases. Documentation of affected chapters in done mid text of pdf files.

ML Model. To target a macroeconomic indicator can be very complex because it's a time series that relies on a multitude of factors. Creation of lags can be complex and picking a view such as YoY proved to be a bad choice for ML. Needed to replace by MoM.

Possible improvements:

Reassess with more data. In some months the effect of tariffs will be clear. Independent variables excluded from the ML Model (e.g. duties) can be proven to have a bigger correlation due to such high level unseen before.

API connection. All data gathered was downloaded, therefore its static. An API connection hasn't been created due to fees. However, to ensure a continuous data feed and allow in time monitoring, an API implementation would be a valuable addition.

ML Model. According to the scope of the project, the model took in consideration mostly trade variables. However, to better predict CPI other variables should be included (e.g. energy index, oil prices). Also, if duties keep being a non-factor, time range can be extended over the limit of duties (2015) for a more expressive historical data.

Sources

About

An analysis of the economic effects of the 2025 U.S. tariff policies using Python for data analysis and machine learning, and Tableau for data visualization. Developed as part of the Ironhack Data Analytics Bootcamp.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors