Code-through
Due by 11:59 PM on Wednesday, December 4, 2019
The objectives of this class include “Become curious and confident in consuming and producing evaluations,” “Run statistical models,” and “Share your analyses and data with the public.” To help you with this, you will write a code-through tutorial of some statistical, causal, program evaluation-focused, or data-based principle or example.
One of the reasons R is so popular is because the R community is exceptionally generous and open and sharing.So are Python and other modern open source languages too.
The internet is full of tutorials and code-throughs where people explain how to do something interesting with R.
You will complete this assignment on your own, but you can get help from others (but you can’t all write about the same topic).
Instructions
Here’s what you need to do:
Decide what statistical or causal or program evaluation concept you want to demonstrate. Perhaps you want to show how DAGs are important and what you can do to control for back doors, or demonstrate how to run a regression discontinuity model, or how to make a plot that shows a program effect from a diff-in-diff model. This is entirely up to you!
Write a tutorial that walks a reader through a demonstration of this concept. Your problem sets have been focused on a final product. In this assignment, here the focus is didactic. Show intermediate steps, explain why you do what you do, etc. The reader should learn something new from this tutorial.
There’s no word count here, but there should be several steps and examples of the concept you’re demonstrating.
You should write this in R Markdown, since that allows you to mix prose and code.
Your demonstration must be reproducible. Use built-in datasets from the
wooldridge
package (likeinjury
orjtrain2
orjtrain3
and so on), or use thewakefield
package to simulate data, or point the reader to a CSV file from the internet and incorporateread_csv()
into your code-through.Knit the final version of your tutorial as a PDF, Word file, or HTML file.
Upload the knitted document to iCollege.
If you’re feeling especially brave, post the HTML version of your document to some public website (Medium, a personal blog, etc.), tell me, and I’ll promote it in the #rstats community on Twitter. You’ll probably get super rich and famous if you do this.
I will grade this using a check system.
Examples
The code examples I include on each week’s class page and in the weekly RStudio.cloud projects are a good example of didactic tutorials. In addition, the R-Weekly e-mail newsletter includes dozens of these kinds of tutorials every week, and Mara Averick (chief tidyverse advocate at RStudio) regularly tweets out links to different posts as well. Here are some others examples to give you a jist of what you can do: Yours won’t be nearly as complicated as these, by the way. Nor do they need to be.
- The Greatest Twitter Scheme of All Time?
- Mapping Fall Foliage with sf
- Drawing beautiful maps programmatically with R, sf and ggplot2
- Exploring Minard’s 1812 plot with ggplot2
- Animations in R
- Drone sightings in the US, visualized
- Quickly play with Polity IV and OECD data (and see the danger of US democracy)