Propensity Score Matching (University of Jerusalem)

Setup

Why R

  • Free and open source (think of science in developing countries)
  • Good online-documentation (much better than some commercial software such as Mplus)
  • Lively community of users (forums etc.)
  • Visualization capabilities (ggplot …)
  • Cooperates with other programs and programming language (e.g. Python, )
  • Popularity (See popularity statistics on books, blogs, forums)
  • RStudio as powerful integrated development environment (IDE) for R
  • Evolves into a scientific work suite optimizing workflow (replication, reproducability etc.)
  • Institutions/people (Gary King, Andrew Gelman etc.)
  • Economic power (Revolution Analytics, Microsoft R Open)

Where to study it

Install R on your Machine

Below some notes on the installation and setup of R and relevant packages on your own computer:

  • Install Rtools for Windows machines from CRAN (https://cran.r-project.org/bin/windows/Rtools/).
  • If you are using OS X, you will need to to install XCode, available for free from the App Store. This will install a compiler (if you don’t have a compiler installed) which will be needed when installing packages from GitHub that require compilation from C++ source code.
  • Install the latest version of R from CRAN (https://cran.r-project.org/).
  • Install the latest version of RStudio (https://www.rstudio.com/products/RStudio/). RStudio is the editor we’ll rely on, i.e. we’ll write code in RStudio which is subsequently sent to and run within R.
  • Install the latest versions of various packages that we need. You can follow this setup.

Set up the Environment on your local machine

  • Once R-Studio is installed copy and paste the following code
  • Be sure everything run smoothly
  • Try to familiarize with R if needed
  • If you are not able to figure it out you can create an account on https://rstudio.cloud/
    • It is R in the cloud (Virtual Machine)
    • It usually resolves most of the incompatibilities
  • If you are still not able to run R and R Studio
    • We will figure it out in class ;)