I try to find out the correlation between Economic growth of Germany towards some independent variables such as Foreign Direct Investment, Export and Import data from 1971-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 Import that is statistically significant. The R squared presents weak correlation by only 32,1%.
lm_multi = sn.OLS(y_multi, X_multi_cons).fit()
lm_multi.summary()
- Visualize the graph in 3D graph