class: center, middle, inverse, title-slide # Teaching Introductory Statistics using the
tidyverse
via
bookdown
## rstudio::conf 2017 ### Chester Ismay (and Albert Y. Kim)
Twitter:
@old_man_chester
Reed College/Pacific University ### 2017/01/13
Slides available at
http://bit.ly/rstudioconf17
Source code available at
https://github.com/ismayc/rstudioconf
--- ## My story teaching Intro Stats - Grad school ![](images/NAU_Lumberjacks_wordmark.png) | ![](images/asu_logo.jpg) :-------------------------:|:-------------------------: <br> <br> <br> Images labeled as **free to use and share** via [Advanced Google Search](https://www.google.com/advanced_image_search): <small><https://upload.wikimedia.org/wikipedia/commons/2/2d/NAU_Lumberjacks_wordmark.png></small> <small>https://upload.wikimedia.org/wikipedia/commons/b/b3/Arizona_State_University_logo.svg</small> --- ## My story teaching Intro Stats - Grad school ![](images/ti2.JPG) | ![](images/Table_t.png) :-------------------------:|:-------------------------: - <small><https://upload.wikimedia.org/wikipedia/commons/2/24/TI-30XIIS.JPG></small> - <small>https://upload.wikimedia.org/wikipedia/commons/thumb/b/bd/Tabla_t.png/189px-Tabla_t.png</small> --- ## My story teaching Intro Stats ### Tenure-track stats prof <img src="images/riponsnow.jpg" width="80%" /> <small>https://commons.wikimedia.org/wiki/File:Harwood_Memorial_Union,_Ripon_College_view_4.jpg</small> --- ## My story teaching Intro Stats ### Tenure-track stats prof <img src="images/statkey.png" width="60%" style="display: block; margin: auto;" /> <http://www.lock5stat.com/StatKey/> --- class: center, middle # But something was missing... --- class: center, middle <img src="images/reed2.png" width="1613" /> --- class: center, middle <img src="images/magick/r_in_reed.png" width="900" /> --- class: center, middle # My story teaching Intro Stats ![](images/pacu.jpg) | ![](images/thinking.gif) :-------------------------:|:-------------------------: <http://giphy.com/gifs/sherlock-bbc-one-l0MYM98IwMYDIn1fO> --- class: center, middle # ModernDive ## An Introduction to Statistical and Data Sciences via R *** Authors: Chester Ismay, Albert Y. Kim and **you**? ## [ModernDive.com](http://moderndive.com) OR ## [ModernDive.org]((http://moderndive.com) --- class: center, middle # Why is this needed? --- ## Guiding Principles of ModernDive ## 1. Blur the lines between lecture and lab <img src="images/cat.gif" width="40%" /> <https://giphy.com/gifs/JIX9t2j0ZTN9S> --- ## 2. Focus on the data/science research pipeline <img src="images/hadley.png" width="100%" /> --- ## 3. It's all about the data ### - Use the `tidyverse` with rich, interesting, open data sets <img src="images/magick/hex_side.png" width="100%" style="display: block; margin: auto;" /> ```r library(nycflights13) library(ggplot2movies) library(okcupiddata) library(gapminder) library(babynames) ``` --- ## 4. Use simulation/resampling not probability/large sample approximation ### - Reinforce concepts, not equations, formulas, and probability tables <!-- ### - Have data visualization be the driver --> <img src="images/tdist.png" width="80%" style="display: block; margin: auto;" /> --- ## 4. Use simulation/resampling not probability/large sample approximation ### - Reinforce concepts, not equations, formulas, and probability tables ### - Have data visualization be the driver <img src="images/ht.png" width="65%" style="display: block; margin: auto;" /> <http://allendowney.blogspot.com/2016/06/there-is-still-only-one-test.html> --- ## 5. Don’t fence off students from the computation pool, throw them in! ### - Scaffold & support as a good foreign language professor would <img src="images/giphy2.gif" width="60%" style="display: block; margin: auto;" /> <http://giphy.com/gifs/pool-diving-synchronized-swimming-pDWtwK7D2IlFu> --- ## 6. Complete reproducibility with `bookdown` ### - Put it all out there ### - Ultimately the best textbook is one you’ve written yourself <img src="images/precious.gif" width="70%" style="display: block; margin: auto;" /> <http://giphy.com/gifs/oskouioskoui-lotr-gifscapade-3oFyCVxsQn6RBa0r5u> --- class: center, middle # Teaching the `tidyverse` --- ## Introducing students to <small>`ggplot2`</small> ```r ggplot(data = simple_ex, mapping = aes(x = A, y = B)) + geom_point() ``` --- ## Teaching the Grammar of Graphics via "chalk talk" ```r ggplot(data = simple_ex, mapping = aes(x = A, y = B)) + geom_point() ``` <img src="images/basic1.png" width="85%" style="display: block; margin: auto;" /> --- ## Teaching the Grammar of Graphics via "chalk talk" ```r ggplot(data = simple_ex, mapping = aes(x = A, y = B, color = D)) + geom_point() ``` <img src="images/basic1.png" width="85%" style="display: block; margin: auto;" /> --- ## Teaching the Grammar of Graphics via chalk talk ```r ggplot(data = simple_ex, mapping = aes(x = A, y = B, color = D)) + geom_point() ``` <img src="images/color.png" width="60%" style="display: block; margin: auto;" /> --- ## `dplyr` diagrams <img src="images/dplyrchalk.png" width="95%" style="display: block; margin: auto;" /> --- ## Reverse engineering - What `dplyr` and `ggplot2` code is needed to produce this plot using the `profiles` data frame in `okcupiddata`? ![](slides_files/figure-html/unnamed-chunk-23-1.png)<!-- --> <!-- - What effective data stories can you tell with this data based on the distributions above for males and females? --> --- ## Why use `bookdown` ### - Rapid iteration and easily-updateable ### - Exports book to multiple formats ### - Slick cross-references ### - Textbook has versions not editions ### - Wikipedia model for intro stats/data science --- class: center, middle # Finding great, interesting, accessible data sets is hard <img src="images/saul.gif" width="50%" /> <http://giphy.com/gifs/justin-g-angry-better-call-saul-exasperation-26tnnpcYVRNJGlHy0> --- # Debuting <small>`fivethirtyeight`</small> <img src="images/fallon.gif" width="90%" /> <http://giphy.com/gifs/lil-jon-FBXSMK6fp3kQ> --- ## Features of <small>`fivethirtyeight`</small> ### Data sets that balance being ### - **rich enough** to answer meaningful questions with, ### - **real enough** to ensure that there is context, and ### - **realistic enough** to convey to students that data as it exists <br> "in the wild" often needs processing. ### Easily and quickly accessible to novices, so that we [minimize the prerequisites to research](https://arxiv.org/abs/1507.05346). --- ## Features of <small>`fivethirtyeight`</small> <small><https://fivethirtyeight.com/datalab/most-police-dont-live-in-the-cities-they-serve/></small> ```r library(fivethirtyeight) data(police_locals) ``` <img src="images/police.png" width="90%" /> --- ## What's to come ### Add more interactive shiny apps into the book ### Create more Review Questions at chapter ends using <small>`fivethirtyeight`</small> and other open data sources ### Design and share instructor resources ### Create DataCamp course to supplement and assist with more immediate feedback --- # [ModernDive.com](http://www.moderndive.com) - Slides created via the R package [**xaringan**](https://github.com/yihui/xaringan) by Yihui Xie. - Fork our GitHub repository at <br> <https://github.com/ismayc/moderndiver-book> - Please feel free to modify the book as you wish for your own needs! (CC0 1.0 Universal License) All we ask is that you list the authors as "Chester Ismay, Albert Y. Kim, and **YOU**!" - Fill out Google Form to receive updates at <http://bit.ly/moderndive-users> - Email us at <chester@moderndive.com> or <albert@moderndive.com> - Getting Used to R, RStudio, and R Markdown book <br> <https://ismayc.github.io/rbasics-book/> *** These slides available at <http://bit.ly/rstudioconf17> Slides source code available at <https://github.com/ismayc/rstudioconf>