Summary

This publication aims to present migration data in the world from 1990 to 2020 carried out using data analysis with R

Migration

Migration is defined as the movement of people from one place to another, either within a country or between countries. There are different reasons why people decide to migration, such as the searchig for better economic opportunities, family reunification, fleeing of violence or being affected by climate change in their country or in their region. Migration has a significant impact on societies of origin and destination.

library(tidyr)
library(readr)
library(readxl)
library(dplyr)
library(gridExtra)
library(ggplot2)
library(plotly)
library(RColorBrewer)
library(stringr)
library(DT)
library(kableExtra)
library(knitr)

Migrant patterns by continent subregion

bySubregion <- migration_long %>%
  filter(str_detect(origin_region, paste(subregions, collapse = "|"))) %>%
  filter(!str_detect(origin_region, paste(notSubregions, collapse = "|"))) %>%
  mutate(origin_region= str_replace(origin_region, "\\*", ""))
datatable(bySubregion)

Top subregions of male migration by origin in 2020

Top subregions of female migration by origin in 2020

¿Is the same Migrants, Emigrants and Inmigrants?

Due to the migratory flows that currently affect millions of people around the world, doubts have grew up in the media about the word that should be used to refer to all of them in a general way.

In this regard, it should be noted that the noun emigrant focuses on the person who leaves their home, while immigrant refers to that same person, but from the perspective of someone who has already arrived at their new destination to settle there.

Global migration by origin between males and females in 2020

genderStats <- byOriginContinent %>%
  filter(year == "2020" & gender %in% c("Female", "Male")) %>%
  group_by(gender) %>%
  summarize(totalMigrants = sum(countMigrants)) %>%
  mutate(percentage = round((totalMigrants / sum(totalMigrants)) * 100, 1))
datatable(genderStats)

T-test of gender migration global by origin in 2020

The stated H0: There is no difference in migration trends between males and females

# t-test to compare the mean migration between genders
t_testGender <- t.test(countMigrants ~ gender, data = filtered_data)
t_testGender
## 
##  Welch Two Sample t-test
## 
## data:  countMigrants by gender
## t = -0.1408, df = 9.6524, p-value = 0.8909
## alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
## 95 percent confidence interval:
##  -29028851  25594071
## sample estimates:
## mean in group Female   mean in group Male 
##             21469718             23187108
estimate estimate1 estimate2 statistic p.value parameter conf.low conf.high method alternative
-1717390 21469718 23187108 -0.141 0.891 9.652 -29028851 25594071 Welch Two Sample t-test two.sided

According to the p-value (0.8909) there is no evidence to reject H0

continents <- c("AFRICA", "ASIA", "EUROPE", "LATIN AMERICA AND THE CARIBBEAN", "NORTHERN AMERICA", "OCEANIA")
byDestContinent <- migration2_long %>%
  filter(dest_region %in% c("AFRICA", "ASIA", "EUROPE", "LATIN AMERICA AND THE CARIBBEAN", "NORTHERN AMERICA", "OCEANIA")) 

Global migration by destination between males and females in 2020

genderStats2 <- byDestContinent %>%
  filter(year == "2020" & gender %in% c("Female", "Male")) %>%
  group_by(gender) %>%
  summarize(totalMigrants = sum(countMigrants)) %>%
  mutate(percentage = (totalMigrants / sum(totalMigrants)) * 100)
genderStats2
## # A tibble: 2 × 3
##   gender totalMigrants percentage
##   <chr>          <dbl>      <dbl>
## 1 Female    1190451171       47.8
## 2 Male      1301814563       52.2