Skip to content

Commit

Permalink
update slides
Browse files Browse the repository at this point in the history
  • Loading branch information
floswald committed Aug 30, 2019
1 parent 2699c9c commit 5a801a0
Show file tree
Hide file tree
Showing 49 changed files with 1,865 additions and 9,152 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.Rproj.user
.Rhistory
.RData
.Ruserdata
*_cache
82 changes: 72 additions & 10 deletions chapter1/chapter1.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ knitr::opts_chunk$set(
warning = FALSE,
dev = "svg",
cache = TRUE,
cache.path = ".cache/",
fig.align = "center"
#fig.width = 11,
#fig.height = 5
Expand Down Expand Up @@ -88,9 +87,15 @@ Will increasing the minimum wage *cause* greater unemployment?
</ru-blockquote>](http://davidcard.berkeley.edu/papers/njmin-aer.pdf)

---
background-image: url("https://media.giphy.com/media/3o7TKMMlq8TItpr7Co/giphy.gif")
background-position: 80% 80%
background-size: 300pt


# Causality

.pull-left[

* Notice the keyword **cause** in all of the above.

* Notice also that *many other factors could have caused* each of those outcomes.
Expand All @@ -99,6 +104,15 @@ Will increasing the minimum wage *cause* greater unemployment?

* We will encounter the most basic of those conditions, and talk about some potential pitfalls.


]

.pull-right[
As in the acclaimed [book of why](https://www.amazon.fr/Book-Why-Science-Cause-Effect/dp/046509760X) we often ask *why* did something happen?
]



---

# This Course
Expand All @@ -123,6 +137,18 @@ Will increasing the minimum wage *cause* greater unemployment?

3. There will be _no_ final exam. Your grade will be 40% of 1 and 60% of 2.

---

# Course Materials

1. The [Book](https://scpoecon.github.io/ScPoEconometrics/).

1. The [Slides](https://github.com/ScPoEcon/ScPoEconometrics-Slides)

1. The code repository for book and [R package](https://github.com/ScPoEcon/ScPoEconometrics)

1. Quizzes on [Moodle](https://moodle.sciences-po.fr)

---
layout: false
class: title-slide-section-red, middle
Expand Down Expand Up @@ -169,9 +195,7 @@ What does that mean?

3\. `R` is very __flexible and powerful__—adaptable to nearly any task, _e.g._, 'metrics, spatial data analysis, machine learning, web scraping, data cleaning, website building, teaching.

---

## Why are we using `R`?
--

4\. _Related:_ `R` imposes __no limitations__ on your amount of observations, variables, memory, or processing power. (I'm looking at __you__, .mono[Stata].)

Expand Down Expand Up @@ -251,6 +275,7 @@ head(fl,n = 4)
# Data Wrangling

* There are always several ways to achieve a goal. (In life `r emo::ji("smile")`)

* Here are the two leading data packages:

.pull-left[
Expand Down Expand Up @@ -289,15 +314,27 @@ delays_dt <-

# Plotting

* Now we could *look* at `delays_dt`, or compute some statistics from it.
.pull-left[
* Now we could *look* at the result in `delays_dt`, or compute some statistics from it.

* Nothing beats a picture, though:

```{r,fig.width=10,fig.height=3.5}
```{r,eval = FALSE}
ggplot(data = delays_dt,
mapping = aes(x = dist, y = delay)) +
geom_point(aes(size = count), alpha = 1/3) +
geom_smooth(se = FALSE)
```
]

.pull-right[
```{r,echo = FALSE, fig.h}
ggplot(data = delays_dt,
mapping = aes(x = dist, y = delay)) +
geom_point(aes(size = count), alpha = 1/3) +
geom_smooth(se = FALSE)
```
]

---

Expand Down Expand Up @@ -327,7 +364,11 @@ paris_sh <- readRDS("paris.RDS")
```{r, eval = FALSE}
library(sf)
plot(paris_sh[,"n"],
main = "Number or IRIS by Arrondissement",key.pos = 3, axes = FALSE, key.width = lcm(1.3), key.length = 1.0)
main = "Number or IRIS by Arrondissement",
key.pos = 3,
axes = FALSE,
key.width = lcm(1.3),
key.length = 1.0)
```
]

Expand All @@ -350,6 +391,8 @@ plot(paris_sh[,"n"],


.pull-left[
<br>
<br>

* ggplot can also directly plot spatial data

Expand All @@ -363,7 +406,7 @@ plot(paris_sh[,"n"],
]

.pull-right[
```{r ggparis,fig.width = 6, fig.height = 5,echo = FALSE}
```{r ggparis,fig.height = 6,echo = FALSE}
gp = ggplot(paris_sh) +
geom_sf(aes(fill = n)) +
scale_fill_viridis_c("Num IRIS") +
Expand All @@ -380,7 +423,7 @@ gp
# 3D ggplots

.pull-left[
* A recent _very_ cool `r emo::ji("cool")` package is [`rayshader`](https://cran.r-project.org/web/packages/rayshader/index.html)
* A recent *very* cool `r emo::ji("sunglasses")` package is [`rayshader`](https://cran.r-project.org/web/packages/rayshader/index.html)

* Sometimes graphs are better to see in 3D.
]
Expand Down Expand Up @@ -419,8 +462,25 @@ layout: true
<div class="my-footer"><img src="../img/logo/ScPo-shield.png" style="height: 60px;"/></div>

---
background-image: url("https://media.giphy.com/media/3oKIPqsXYcdjcBcXL2/giphy-downsized.gif")
background-position: 90% 50%
background-size: 300pt

# Tool Time!


.pull-left[

## Getting R and Rstudio

* Download `R` from [CRAN](https://cran.r-project.org) for your OS.

* Download `RStudio` from [here](https://www.rstudio.com/products/rstudio/download/#download) for your OS.
]


---

# Start your `Rstudio`!

## First Glossary of Terms
Expand Down Expand Up @@ -1029,7 +1089,9 @@ background-position: 9% 19%
| <a href="mailto:[email protected]">.ScPored[<i class="fa fa-paper-plane fa-fw"></i>] | [email protected] |
| <a href="https://github.com/ScPoEcon/ScPoEconometrics-Slides">.ScPored[<i class="fa fa-link fa-fw"></i>] | Slides |
| <a href="https://scpoecon.github.io/ScPoEconometrics">.ScPored[<i class="fa fa-link fa-fw"></i>] | Book |

| <a href="http://twitter.com/ScPoEcon">.ScPored[<i class="fa fa-twitter fa-fw"></i>] | @ScPoEcon |
| <a href="http://github.com/ScPoEcon">.ScPored[<i class="fa fa-github fa-fw"></i>] | @ScPoEcon |

```{r makepdf, echo=FALSE,eval=FALSE}
system("decktape chapter1.html chapter1.pdf --chrome-arg=--disable-web-security")
```
73 changes: 64 additions & 9 deletions chapter1/chapter1.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# ScPoEconometrics
## Introduction
### Florian Oswald
### SciencesPo Paris </br> 2019-08-20
### SciencesPo Paris </br> 2019-08-30

---

Expand Down Expand Up @@ -73,9 +73,15 @@
&lt;/ru-blockquote&gt;](http://davidcard.berkeley.edu/papers/njmin-aer.pdf)

---
background-image: url("https://media.giphy.com/media/3o7TKMMlq8TItpr7Co/giphy.gif")
background-position: 80% 80%
background-size: 300pt


# Causality

.pull-left[

* Notice the keyword **cause** in all of the above.

* Notice also that *many other factors could have caused* each of those outcomes.
Expand All @@ -84,6 +90,15 @@

* We will encounter the most basic of those conditions, and talk about some potential pitfalls.


]

.pull-right[
As in the acclaimed [book of why](https://www.amazon.fr/Book-Why-Science-Cause-Effect/dp/046509760X) we often ask *why* did something happen?
]



---

# This Course
Expand All @@ -108,6 +123,18 @@

3. There will be _no_ final exam. Your grade will be 40% of 1 and 60% of 2.

---

# Course Materials

1. The [Book](https://scpoecon.github.io/ScPoEconometrics/).

1. The [Slides](https://github.com/ScPoEcon/ScPoEconometrics-Slides)

1. The code repository for book and [R package](https://github.com/ScPoEcon/ScPoEconometrics)

1. Quizzes on [Moodle](https://moodle.sciences-po.fr)

---
layout: false
class: title-slide-section-red, middle
Expand Down Expand Up @@ -154,9 +181,7 @@

3\. `R` is very __flexible and powerful__—adaptable to nearly any task, _e.g._, 'metrics, spatial data analysis, machine learning, web scraping, data cleaning, website building, teaching.

---

## Why are we using `R`?
--

4\. _Related:_ `R` imposes __no limitations__ on your amount of observations, variables, memory, or processing power. (I'm looking at __you__, .mono[Stata].)

Expand Down Expand Up @@ -222,6 +247,7 @@
# Data Wrangling

* There are always several ways to achieve a goal. (In life 😄)

* Here are the two leading data packages:

.pull-left[
Expand Down Expand Up @@ -262,7 +288,9 @@

# Plotting

* Now we could *look* at `delays_dt`, or compute some statistics from it.
.pull-left[
* Now we could *look* at the result in `delays_dt`, or compute some statistics from it.

* Nothing beats a picture, though:


Expand All @@ -272,8 +300,11 @@
geom_point(aes(size = count), alpha = 1/3) +
geom_smooth(se = FALSE)
```
]

&lt;img src="chapter1_files/figure-html/unnamed-chunk-4-1.svg" style="display: block; margin: auto;" /&gt;
.pull-right[
&lt;img src="chapter1_files/figure-html/fig.h-1.svg" style="display: block; margin: auto;" /&gt;
]

---

Expand Down Expand Up @@ -302,7 +333,11 @@
```r
library(sf)
plot(paris_sh[,"n"],
main = "Number or IRIS by Arrondissement",key.pos = 3, axes = FALSE, key.width = lcm(1.3), key.length = 1.0)
main = "Number or IRIS by Arrondissement",
key.pos = 3,
axes = FALSE,
key.width = lcm(1.3),
key.length = 1.0)
```
]

Expand All @@ -322,6 +357,8 @@


.pull-left[
&lt;br&gt;
&lt;br&gt;

* ggplot can also directly plot spatial data

Expand All @@ -345,7 +382,7 @@
# 3D ggplots

.pull-left[
* A recent _very_ cool 🆒 package is [`rayshader`](https://cran.r-project.org/web/packages/rayshader/index.html)
* A recent *very* cool 😎 package is [`rayshader`](https://cran.r-project.org/web/packages/rayshader/index.html)

* Sometimes graphs are better to see in 3D.
]
Expand Down Expand Up @@ -377,8 +414,25 @@
&lt;div class="my-footer"&gt;&lt;img src="../img/logo/ScPo-shield.png" style="height: 60px;"/&gt;&lt;/div&gt;

---
background-image: url("https://media.giphy.com/media/3oKIPqsXYcdjcBcXL2/giphy-downsized.gif")
background-position: 90% 50%
background-size: 300pt

# Tool Time!


.pull-left[

## Getting R and Rstudio

* Download `R` from [CRAN](https://cran.r-project.org) for your OS.

* Download `RStudio` from [here](https://www.rstudio.com/products/rstudio/download/#download) for your OS.
]


---

# Start your `Rstudio`!

## First Glossary of Terms
Expand Down Expand Up @@ -1239,7 +1293,8 @@
| | |
| :--------------------------------------------------------------------------------------------------------- | :-------------------------------- |
| &lt;a href="mailto:[email protected]"&gt;.ScPored[&lt;i class="fa fa-paper-plane fa-fw"&gt;&lt;/i&gt;] | [email protected] |
| &lt;a href="https://scpoecon.github.io/ScPoEconometrics"&gt;.ScPored[&lt;i class="fa fa-link fa-fw"&gt;&lt;/i&gt;] | Slides and Book |
| &lt;a href="https://github.com/ScPoEcon/ScPoEconometrics-Slides"&gt;.ScPored[&lt;i class="fa fa-link fa-fw"&gt;&lt;/i&gt;] | Slides |
| &lt;a href="https://scpoecon.github.io/ScPoEconometrics"&gt;.ScPored[&lt;i class="fa fa-link fa-fw"&gt;&lt;/i&gt;] | Book |
| &lt;a href="http://twitter.com/ScPoEcon"&gt;.ScPored[&lt;i class="fa fa-twitter fa-fw"&gt;&lt;/i&gt;] | @ScPoEcon |
| &lt;a href="http://github.com/ScPoEcon"&gt;.ScPored[&lt;i class="fa fa-github fa-fw"&gt;&lt;/i&gt;] | @ScPoEcon |
</textarea>
Expand Down
Binary file added chapter1/chapter1.pdf
Binary file not shown.
Loading

0 comments on commit 5a801a0

Please sign in to comment.