Problem set 3
IMPORTANT: Again, this looks like a lot of work, but it’s mostly copying/pasting chunks of code and changing things.
You can find a complete example of RCTs and matching and inverse probability weighting on the class page from Week 7. This will be incredibly useful as a guide for completing this assignment.
Remember, if you’re struggling, please talk to me. Work with classmates too. (Definitely work with classmates on this one!) Don’t suffer in silence!
Instructions
Open the project named “Problem Set 3” on RStudio.cloud. This link should take you to the project—if it doesn’t, log in and look for the project named “Problem Set 3.”
Alternatively, if you’re using R on your own computer, download this file, unzip it, and double click on the file named
problem-set-3.Rproj
:problem-set-3.zip
You’ll need to make sure you have these packages installed on your computer:
tidyverse
,MatchIt
, andpatchwork
. If you try to load one of those packages withlibrary(tidyverse)
orlibrary(MatchIt)
, etc., and R gives an error that the package is missing, use the “Packages” panel in RStudio to install it.Rename the R Markdown file named
your-name_problem-set-3.Rmd
to something that matches your name and open it in RStudio.Complete the tasks given in the R Markdown file. Fill out code in the empty chunks provided (you can definitely copy, paste, and adapt from other code in the document or the class page on RCTs and matching—don’t try to write everything from scratch!). You’ll need to insert your own code chunks. Rather than typing them by hand (that’s tedious!), use the “Insert” button at the top of the editing window, or press “ctrl + alt + I” on Windows, or “⌥ + ⌘ + I” on macOS.
When you’re all done, click on the “Knit” button at the top of the editing window and create a PDF or Word document of your problem set. Upload that file to iCollege.