Author: Rahul Kumar
Enrolment: M2024ANLT021 Date:
2024-12-07
Output: HTML Document
In this assignment, we will use the Penn World Table (PWT) dataset to analyze key economic trends and comparisons among countries. The main focus will be on:
library(dplyr)
## Warning: package 'dplyr' was built under R version 4.4.2
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.4.2
library(tidyr)
## Warning: package 'tidyr' was built under R version 4.4.2
library(readxl)
## Warning: package 'readxl' was built under R version 4.4.2
library(rnaturalearth)
## Warning: package 'rnaturalearth' was built under R version 4.4.2
library(rnaturalearthdata)
## Warning: package 'rnaturalearthdata' was built under R version 4.4.2
##
## Attaching package: 'rnaturalearthdata'
## The following object is masked from 'package:rnaturalearth':
##
## countries110
library(sf) # For spatial data manipulation
## Warning: package 'sf' was built under R version 4.4.2
## Linking to GEOS 3.12.2, GDAL 3.9.3, PROJ 9.4.1; sf_use_s2() is TRUE
library(scales) # For formatting scales
## Warning: package 'scales' was built under R version 4.4.2
# Load the Penn World Table data
pwt <- read_excel("C:/Users/sharm/Downloads/pwt100 (1).xlsx", sheet = "Data")
# Check the structure of the dataset
str(pwt)
## tibble [12,810 × 52] (S3: tbl_df/tbl/data.frame)
## $ countrycode : chr [1:12810] "ABW" "ABW" "ABW" "ABW" ...
## $ country : chr [1:12810] "Aruba" "Aruba" "Aruba" "Aruba" ...
## $ currency_unit: chr [1:12810] "Aruban Guilder" "Aruban Guilder" "Aruban Guilder" "Aruban Guilder" ...
## $ year : num [1:12810] 1950 1951 1952 1953 1954 ...
## $ rgdpe : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ rgdpo : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ pop : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ emp : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ avh : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ hc : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ ccon : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ cda : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ cgdpe : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ cgdpo : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ cn : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ ck : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ ctfp : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ cwtfp : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ rgdpna : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ rconna : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ rdana : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ rnna : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ rkna : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ rtfpna : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ rwtfpna : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ labsh : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ irr : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ delta : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ xr : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ pl_con : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ pl_da : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ pl_gdpo : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ i_cig : chr [1:12810] NA NA NA NA ...
## $ i_xm : chr [1:12810] NA NA NA NA ...
## $ i_xr : chr [1:12810] NA NA NA NA ...
## $ i_outlier : chr [1:12810] NA NA NA NA ...
## $ i_irr : chr [1:12810] NA NA NA NA ...
## $ cor_exp : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ statcap : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ csh_c : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ csh_i : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ csh_g : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ csh_x : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ csh_m : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ csh_r : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ pl_c : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ pl_i : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ pl_g : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ pl_x : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ pl_m : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ pl_n : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
## $ pl_k : num [1:12810] NA NA NA NA NA NA NA NA NA NA ...
We’ll select relevant columns and create new variables for analysis.
# Select relevant columns and create GDP per capita and labor productivity
pwt_clean <- pwt %>%
select(country, year, rgdpna, pop, emp, ccon, ck) %>%
filter(!is.na(rgdpna)) %>%
mutate(
gdp_per_capita = rgdpna / pop,
labor_productivity = rgdpna / emp,
employment_rate = emp / pop
)
This scatter plot shows the relationship between GDP and capital investment across countries in 2017.
A choropleth map showing employment rates across the world in 2017.
A line chart comparing GDP per capita trends for three economic blocs: the European Union, BRICS, and ASEAN.
## `geom_smooth()` using formula = 'y ~ x'
A scatter plot comparing labor productivity and consumption expenditure for different countries in 2017.
GDP vs. Capital Investment in 2017:
The scatter plot shows a positive correlation between GDP and capital
investment. Wealthier nations with higher GDP per capita tend to have
greater capital stock, highlighting the role of investment in economic
growth.
Employment Rates by Region in 2017:
The global map illustrates clear regional disparities in employment
rates. Developed regions like Europe and North America have higher
employment rates compared to parts of Africa and Asia, indicating
differences in labor market conditions.
GDP Per Capita Trends by Economic Bloc:
The line chart reveals that the European Union maintains consistently
high GDP per capita. BRICS countries show rapid growth, especially China
and India, while ASEAN countries display moderate but steady growth
trends.
Labor Productivity vs. Consumption Expenditure in
2017:
The scatter plot suggests that countries with higher labor productivity
also tend to have higher consumption expenditure. This highlights the
relationship between economic efficiency and household spending
power.
This analysis underscores key insights into economic growth, employment, and productivity using the Penn World Table dataset.