RBS
mastbottom

Installing R and Add-On Packages for Propensity Score Analysis

R is a free statistical package that can be downloaded and installed from the website: http://www.r-project.org. Once you get to the website, click on download R, You will be directed to a webpage titled “CRAN Mirrors”. You should click on the URL representing the location that is close to you, which will direct you to a page with download links to R for Linux, MacOS X and Windows.

Installation Instructions

Windows Installation

Note: If you are a Mac user running software such as VMware Fusion, Parallels or Virtual Box, you may also install the Windows version of R on your virtual Windows computer.

  1. Select the “base” package of R for Windows
  2. Click on Download R 2.13.2 for Windows, which will allow you to select the .exe file to download the current release
  3. Save the .exe file on your desktop
  4. Click on the .exe file to install the software and keep the default settings for the installation
  5. Select “Finish” once the R program has completed installation.
  6. For the propensity score matching exercise, you will need to install two programs written in R. Just copy and paste the following script in the R Console window and click the "enter" key to install the MatchIt package.
    1. install.packages("MatchIt")
    2. After you see a pop-up window asking you to select a CRAN mirror for use, choose the closest location (e.g., PA1 for the state of Pennsylvania in the US) and the package will start downloading.
  7. The second package, called "Zelig", is for post-matching regression analysis. Just enter: install.packages("Zelig")
  8. The third package, called "Design". Just enter: install.packages("Design")
  9. The fourth package, called "optmatch". Just enter: install.packages("optmatch")

Note: You will need Internet access in order to install all of the add-on packages for R.

We also have a brief video to help you with the installation process:

FAQ for R for Windows: http://cran.r-project.org/bin/windows/rw-FAQ.html#Can-I-run-R-from-a-CD-or-USB-drive_003f

Macintosh Installation

  1. Go to: http://www.r-project.org and click "MacOS X"
  2. Click R-2.13.2.pkg (latest version) to download the installer package file to your download folder.
  3. Once the installer package file is downloaded, double click on the file and you will see a installation window titled Install R 2.13.0 for Mac OS X 10.5 or higher (Leopard Build).
  4. Click continue, then continue, then agree to the terms of the software license agreement, then click Install and verify the password for your laptop.
  5. Wait for the message Install Succeeded, then go to your Applications folder. You should be able to double click the R logo and open the R Console window.
  6. For the propensity score matching exercise, you will need to install two programs written in R. Just copy and paste the following script in the R Console window and click the "enter" key to install the MatchIt package.
    1. install.packages("MatchIt")
    2. After you see a pop-up window asking you to select a CRAN mirror for use, choose the closest location (e.g., PA1 for the state of Pennsylvania in the US) and the package will start downloading.
  7. The second package, called "Zelig". Just enter:  install.packages("Zelig")
  8. The third package, called "Design". Just enter: install.packages("Design")
  9. The fourth package, called "optmatch". Just enter: install.packages("optmatch")

Note: You will need Internet access in order to install all of the add-on packages for R.

We also have a couple of brief videos to help you with the installation process:

R for Mac FAQ: http://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html

 
wpbottom