RBS
mastbottom

Installing R and add-on packages for Propensity Score Matching

Installing R and add-on packages for Propensity Score Matching

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, go to the first bullet under the heading “Getting Started” and click on download R. You will be directed to a page titled “CRAN Mirrors.” Click on the URL representing a location that is closest to you. You will then be directed to a page with download links for Linux, Mac OS X and Windows.f you are a Windows user, follow these steps:

Windows

  1. Click on the “Download R for Windows” link. Next, from the page titled “R for Windows,” click on the “base” link.
  2. Click the “Download R 2.14.2 for Windows” link (or the link for the latest version of R) and the installer (.exe file) will be saved to your “Downloads” folder under “My Documents.”
  3. Double-click on the .exe file in the “Downloads” folder to install the software (keep the default settings for the installation).
  4. Select “Finish” once the R program has completed installation.
  5. Open the R console by clicking on the R icon on the desktop or by going to “All Programs/R/R 2.14.2” under the Start menu.

For the propensity score matching exercise, we suggest that you install four add-on packages written in R. To install the packages, carefully type each of the following four scripts (A through C, below), one at a time, after the “>” symbol in the R Console window, then press “return” or “enter” on your keyboard.

  1. install.packages(“MatchIt”)
  2. install.packages(“Zelig”)
  3. install.packages(“optmatch”)

When you enter the first script, a window will pop up asking you to select a CRAN mirror. Select a location and the first package will begin loading. Please be sure to match the punctuation and capitalization exactly.

Additional Resources

Macintosh

  1. Go to: http://www.r-project.org and click “MacOS X.”
  2. Click R-2.14.0.pkg (or the 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. An installation window titled “Install R 2.13.0 for Mac OS X 10.5 or higher (Leopard Build)” will open.
  4. Click “continue” then “continue” then “agree” to the terms of the software license agreement, then click “Install” and verify the password for your computer.
  5. Wait for the message “Install Succeeded.” Go to your application folder and double-click the R icon to open the R Console window.

For the propensity score matching exercise, we suggest that you install four add-on packages written in R. To install the packages, carefully type each of the following four scripts (A through C, below), one at a time, after the “>” symbol in the R Console window, then press “return” or “enter” on your keyboard.

  1. install.packages(“MatchIt”)
  2. install.packages(“Zelig”)
  3. install.packages(“optmatch”)

When you enter the first script, a window will pop up asking you to select a CRAN mirror. Select a location and the first package will begin loading. Please be sure to match the punctuation and capitalization exactly.

Additional Resources

 
wpbottom