Skip to content

Commit

Permalink
Finalize lesson 12 slides, add country profile examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansafner committed Dec 4, 2019
1 parent 3084ded commit a0b9d4f
Show file tree
Hide file tree
Showing 21 changed files with 3,762 additions and 14 deletions.
2 changes: 1 addition & 1 deletion content/_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<p><span><label for="sn-1" class="margin-toggle">&#8853;</label><input type="checkbox" id="sn-1" class="margin-toggle"/><span class="marginnote"> {{% courseinfo %}}<br />
<br />
</span></span> <span class="newthought">This site contains</span> the syllabus, schedule, and assignments for ECON 317: Economics of Development, held during Fall 2019 at Hood College.</p>
<p><strong>Last Update</strong>: <a href="https://github.com/ryansafner/devF19/commits/master">11:15:17 Mon Dec 02 2019</a></p>
<p><strong>Last Update</strong>: <a href="https://github.com/ryansafner/devF19/commits/master">11:22:16 Wed Dec 04 2019</a></p>
<p>By the end of this course, you will:</p>
<ul>
<li>Explain how the development community measures economic development</li>
Expand Down
4 changes: 4 additions & 0 deletions content/assignment/country-profile.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ At the end, include a short bibliography of the sources which you used to compil

# Presentation

- [<i class="fas fa-file-powerpoint"></i> Example Powerpoint](/profile/usa_example.pptx)
- [<i class="fab fa-markdown"></i>Using R to Download World Bank Data (rmd)](/profile/usa_country_profile_data.Rmd)
- [<i class="fab fa-markdown"></i>Using R to Download World Bank Data (html)](/profile/usa_country_profile_data.html)

On the last week of class, each student will have 5 minutes to present their country. I expect each of you to have slides to describe your country. The goal is for you to immerse yourself a bit in your selected country, and to give us all a sense of what it is like to live in that country, and how it fits in the world in terms of economic development. Your presentation should include:

1. Some At a Glance statistics from above
Expand Down
5 changes: 5 additions & 0 deletions content/assignment/country-profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ <h2 id="write-up">Write Up</h2>
</ul>
<p>At the end, include a short bibliography of the sources which you used to compile your overview. I do not care about the formatting, just be consistent, and use reputable sources (again, e.g. World Bank, IMF, OECD, UN, CIA World Factbook).</p>
<h2 id="presentation">Presentation</h2>
<ul>
<li><a href="/profile/usa_example.pptx"><i class="fas fa-file-powerpoint"></i> Example Powerpoint</a></li>
<li><a href="/profile/usa_country_profile_data.Rmd"><i class="fab fa-markdown"></i>Using R to Download World Bank Data (rmd)</a></li>
<li><a href="/profile/usa_country_profile_data.html"><i class="fab fa-markdown"></i>Using R to Download World Bank Data (html)</a></li>
</ul>
<p>On the last week of class, each student will have 5 minutes to present their country. I expect each of you to have slides to describe your country. The goal is for you to immerse yourself a bit in your selected country, and to give us all a sense of what it is like to live in that country, and how it fits in the world in terms of economic development. Your presentation should include:</p>
<ol style="list-style-type: decimal">
<li>Some At a Glance statistics from above</li>
Expand Down
2 changes: 1 addition & 1 deletion content/schedule.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
</span></span></li>
</ul>
<p>Relevant materials (if applicable, icons will become links) will be posted before class meets.</p>
<p><strong>Last Update</strong>: <a href="https://github.com/ryansafner/devF19/commits/master">11:15:46 Mon Dec 02 2019</a>.</p>
<p><strong>Last Update</strong>: <a href="https://github.com/ryansafner/devF19/commits/master">11:22:53 Wed Dec 04 2019</a>.</p>
<hr />
{{% schedule %}}
Binary file added static/profile/us_gdp_graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/profile/us_gdp_growth_graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/profile/us_unemployment_graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
123 changes: 123 additions & 0 deletions static/profile/usa_country_profile_data.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
---
title: "Using World Bank Data for Country Profile"
author: "Ryan Safner"
date: "11/30/2019"
output:
html_document:
df_print: paged
#theme:
toc: true
toc_depth: 3
toc_float: true
code_folding: show
highlight: tango
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
```

Let's use the `wbstats` package for `R`:

```{r}
# install.packages("wbstats") # install for first use
library(wbstats) # load package
```


Search for indicators

https://data.worldbank.org/indicator


- NY.GDP.PCAP.CD GDP per capita (current USD)
- NY.GDP.PCAP.KD.ZG (GDP per capita growth rate)
- SL.UEM.TOTL.ZS (total unemployment rate)
- SL.TLF.CACT.FE.ZS female labor force participation rate
- SL.TLF.CACT.MA.ZS male labor force participation rate
- FP.CPI.TOTL.ZG inflation (CPI)
- GC.DOD.TOTL.GD.ZS debt-percent-of-gdp
- SP.POP.TOTL total population
- SP.POP.GROW pop growth
- SI.POV.GINI Gini
- SP.DYN.LE00.IN total life expectancy at birth
- SP.DYN.IMRT.IN infant mortality rate total per 1000 births
- SI.POV.DDAY poverty headcount ratio 1.90 per day % of pop
- NE.TRD.GNFS.ZS trade % of gdp
- DT.ODA.OATL.CD net official aid received (current USD)

```{r}
# example of searching manually in the system (vs online)
wbsearch(pattern = "unemployment")
```

Figure out what country code is in World Bank (e.g. "US" for United States)

```{r}
usa<-wb(country = c("US"),
indicator = c("NY.GDP.PCAP.CD", "NY.GDP.PCAP.KD.ZG", "SL.UEM.TOTL.ZS", "FP.CPI.TOTL.ZG", "GC.DOD.TOTL.GD.ZS", "SP.POP.TOTL", "SP.POP.GROW", "SI.POV.GINI", "SP.DYN.LE00.IN", "SP.DYN.IMRT.IN", "SI.POV.DDAY", "NE.TRD.GNFS.ZS"),
startdate = 1970, enddate = 2019,
return_wide = TRUE) %>%
mutate(date = as.numeric(date)) %>%
rename("Year" = date,
"GDP_per_Capita"= NY.GDP.PCAP.CD,
"GDP_growth" = NY.GDP.PCAP.KD.ZG,
"Unemployment" = SL.UEM.TOTL.ZS,
"Inflation" = FP.CPI.TOTL.ZG,
"Debt_pct_GDP" = GC.DOD.TOTL.GD.ZS,
"Population" = SP.POP.TOTL,
"Pop_growth" = SP.POP.GROW,
"Gini" = SI.POV.GINI,
"Life_Exp" = SP.DYN.LE00.IN,
"Infant_mortality" = SP.DYN.IMRT.IN,
"Poverty_pct" = SI.POV.DDAY,
"Trade_pct_GDP" = NE.TRD.GNFS.ZS)
```

```{r}
usa
```

```{r, fig.retina=3}
ggplot(data = usa)+
aes(x = Year,
y = GDP_per_Capita)+
#geom_point()+
geom_path(size=2, color = "blue")+
scale_x_continuous(breaks=seq(1970,2020,10))+
scale_y_continuous(breaks=seq(10000,60000,10000),
labels=scales::dollar)+
theme_classic(base_family = "Fira Sans Condensed", base_size=18)+
labs(x = "Year",
y = "GDP per Capita (Current USD)")
```


```{r}
ggplot(data = usa)+
aes(x = Year,
y = Unemployment)+
#geom_point()+
geom_path(size=2, color = "blue")+
scale_x_continuous(breaks=seq(1970,2020,10))+
scale_y_continuous(labels=function(x){paste(x,"%")})+
theme_classic(base_family = "Fira Sans Condensed", base_size=18)+
labs(x = "Year",
y = "Unemployment Rate (%)")
```

```{r}
ggplot(data = usa)+
aes(x = Year,
y = GDP_growth)+
#geom_point()+
geom_path(size=2, color = "blue")+
geom_hline(yintercept=0, size =1)+
scale_x_continuous(breaks=seq(1970,2020,10))+
scale_y_continuous(labels=function(x){paste(x,"%")})+
theme_classic(base_family = "Fira Sans Condensed", base_size=18)+
labs(x = "Year",
y = "GDP per Capita Growth")
```

3,101 changes: 3,101 additions & 0 deletions static/profile/usa_country_profile_data.html

Large diffs are not rendered by default.

Binary file added static/profile/usa_example.pdf
Binary file not shown.
Binary file added static/profile/usa_example.pptx
Binary file not shown.
Loading

0 comments on commit a0b9d4f

Please sign in to comment.