These data sources contains Export, Import and Empty Entry data of Turkish and Foreign Vehicles.
There are six data sources from the TCMB site. One of the links is given below.
In this section we will analyze and find some interesting insights from our dataset.
We have 14 columns. 4 of them is character data type, 1 of them is date data type and rest of all is numeric data type.
You can see detailed summary statistics from below.
summary(df_exportimport_final)
## Level PercentageChange Difference
## Min. : 0.0 Min. : -100.000 Min. :-32764.00
## 1st Qu.: 0.0 1st Qu.: -9.253 1st Qu.: -4.00
## Median : 19.0 Median : 0.000 Median : 0.00
## Mean : 623.3 Mean : 8.911 Mean : 2.59
## 3rd Qu.: 285.0 3rd Qu.: 8.086 3rd Qu.: 6.00
## Max. :62182.0 Max. :27900.000 Max. : 24903.00
## YearlyPercentageChange YearlyDifference DtePreviousYearPercentageChange
## Min. : -100.00 Min. :-32668.0 Min. : -100.000
## 1st Qu.: -4.53 1st Qu.: -1.0 1st Qu.: -11.305
## Median : 0.00 Median : 0.0 Median : 0.000
## Mean : 46.76 Mean : 15.7 Mean : 20.535
## 3rd Qu.: 11.48 3rd Qu.: 9.0 3rd Qu.: 5.634
## Max. :293850.00 Max. : 21013.0 Max. :19850.000
## DtePreviousYearPercentageDifference MovingAverage MovingSum
## Min. :-31509.00 Min. : 0.00 Min. : 0
## 1st Qu.: -3.00 1st Qu.: 0.17 1st Qu.: 2
## Median : 0.00 Median : 20.50 Median : 225
## Mean : -17.89 Mean : 613.53 Mean : 7068
## 3rd Qu.: 4.00 3rd Qu.: 288.77 3rd Qu.: 3253
## Max. : 26171.00 Max. :53219.17 Max. :638630
## Date ExportImportCountry VehicleType ExportImport
## Min. :2012 Length:50112 Length:50112 Length:50112
## 1st Qu.:2014 Class :character Class :character Class :character
## Median :2017 Mode :character Mode :character Mode :character
## Mean :2017
## 3rd Qu.:2019
## Max. :2022
## ExportImportRegion
## Length:50112
## Class :character
## Mode :character
##
##
##
The Word Cloud graphs in the below shows us most imported and exported countries based on country name size.
Most import countries as we can see below are EU countries such as Germany, Italy, France etc. On the other hand countries close to our border like Iraq, Iran, Bulgaria etc.
Import Plot
#Import
<- df_exportimport_final %>% filter(ExportImport == 'IMPORT') %>% group_by(ExportImportCountry) %>% summarize(TotalImport = sum(Level)) %>% arrange(desc(TotalImport))
ImportFreq
wordcloud2(data=ImportFreq, size=0.8)
Most export countries as we can see below are countries close to our borders. Top countries are usually in middle east or Asia, followed by EU countries.
Export Plot
#Export
<- df_exportimport_final %>% filter(ExportImport == 'EXPORT') %>% group_by(ExportImportCountry) %>% summarize(TotalExport = sum(Level)) %>% arrange(desc(TotalExport))
ExportFreq
wordcloud2(data=ExportFreq, size=0.8)
As seen in the graph below we can see parallel increase and decrease between Import and Export numbers on Quarterly basis. Moreover we can see drops on export and import numbers between fourth quarter and first quarter. We strongly believe this is due to winter conditions also we are seeing a huge drop in between 2020-Q1 and 2020-Q2 due to Corona Virus.
%>%
df_exportimport_final filter(ExportImport == 'EXPORT' | ExportImport == 'IMPORT') %>%
group_by(Date,ExportImport) %>% summarize(TotalExportImport = sum(Level)) %>%
ggplot( aes(x=Date, y=TotalExportImport, group=ExportImport, color=ExportImport)) +
::scale_x_yearqtr(n = 100,format = '%Y Q%q') +
zoogeom_line() +
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
labs(title = "Import and Export numbers on Quarterly basis")
We can see in bar charts below Turkish vehicles mostly used for imports and exports.
Imports and Exports Percentages based on Vehicle Type also shown in tables.
# Export
<- df_exportimport_final %>% filter(ExportImport == 'EXPORT') %>% group_by(VehicleType) %>% summarize(TotalExport = sum(Level))
ExportVehicles ggplot(ExportVehicles , aes(y=TotalExport, x=VehicleType)) +
geom_bar(position="dodge", stat="identity") + labs(title = "Export Numbers based on Vehicle Types")
%>% filter(ExportImport == 'EXPORT') %>% group_by(VehicleType) %>% summarize(TotalExport = sum(Level)) %>% mutate(Percentage = TotalExport / sum(TotalExport)*100) %>% select(VehicleType,Percentage) df_exportimport_final
## # A tibble: 2 x 2
## VehicleType Percentage
## <chr> <dbl>
## 1 TIH 78.7
## 2 YIH 21.3
#Import
<- df_exportimport_final %>% filter(ExportImport == 'IMPORT') %>% group_by(VehicleType) %>% summarize(TotalImport = sum(Level))
ImportVehicles ggplot(ImportVehicles , aes(y=TotalImport, x=VehicleType)) +
geom_bar(position="dodge", stat="identity") + labs(title = "Import Numbers based on Vehicle Types")
%>% filter(ExportImport == 'IMPORT') %>% group_by(VehicleType) %>% summarize(TotalExport = sum(Level)) %>% mutate(Percentage = TotalExport / sum(TotalExport)*100) %>% select(VehicleType,Percentage) df_exportimport_final
## # A tibble: 2 x 2
## VehicleType Percentage
## <chr> <dbl>
## 1 TIT 67.1
## 2 YIT 32.9
In this part we analyse our Import data based on Regions. As we can see in the plot below, import levels in Europe are way greater than Asia and Africa regions. Africa has the lowest import numbers among all. When we analyze the line running by quarters, import lines are quite bumpy. This irregularity can be considered as a factor of seasonal and political changes. In Africa region the line runs steadily.
%>%
df_exportimport_final filter(ExportImport == 'IMPORT') %>%
group_by(Date,ExportImportRegion) %>% summarize(TotalExport = sum(Level)) %>%
ggplot( aes(x=Date, y=TotalExport, group=ExportImportRegion, color=ExportImportRegion)) +
::scale_x_yearqtr(n = 100,format = '%Y Q%q') +
zoogeom_line() +
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
labs(title = "Import numbers on Quarterly basis and Region Wise")
In the second plot we analyse our Export data based on Regions. As we can see in the plot below, export levels in Asia are greater than Europe region in the beginnings of our line chart, but export numbers of Europe has caught Asia numbers lately. Africa’s line runs steady and has the lowest export numbers among all.
%>%
df_exportimport_final filter(ExportImport == 'EXPORT') %>%
group_by(Date,ExportImportRegion) %>% summarize(TotalExport = sum(Level)) %>%
ggplot( aes(x=Date, y=TotalExport, group=ExportImportRegion, color=ExportImportRegion)) +
::scale_x_yearqtr(n = 100,format = '%Y Q%q') +
zoogeom_line() +
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
labs(title = "Export numbers on Quarterly basis and Region Wise")