I try to find out the correlation between Economic growth of Germany towards some independent variables such as Trade Balance, FDI (Bil USD), and Tariff rates(%) data from 1988-2018. Using numpy, pandas, seaborn and matplotlib, the correlation could be presented and visualized comprehensively through tables and graphs.
- Download the data from the website and arrange into 1 file
- Extracting into data panda frames
3.Drop the date
- Define X and Y variables through this line of code
- Run this code to get the result of OLS. We can see that only variable Tariff rates that is statistically significant. The R squared presents strong correlation by 70,4%.
lm_multi = sn.OLS(y_multi, X_multi_cons).fit()
lm_multi.summary()
- Visualize the graph in 3D graph