Intro to Coding for Social Scientists

Columbia University

Fall '19 workshop

Instructors: Paul A. Bloom, Emily Nakkawita, Jonathan Nicholas, Ellen Tedeschi, Monica Thieu, Michelle VanTieghem

General Information

Columbia Psychology Scientific Computing develops and teaches workshops on scientific computing skills needed to conduct psychological research. Its target audience is researchers who have little to no prior computational experience, and its lessons are psychology-specific, building on learners' existing knowledge to enable them to quickly apply skills learned to their own research.

Who: The course is aimed at graduate students and other researchers. You don't need to have any previous knowledge of the tools that will be presented at the workshop.

Where: Butler Library 2nd floor (rooms TBD). Get directions with OpenStreetMap or Google Maps.

When: September 6, 13, 20, 2019. Add to your Google Calendar.

Requirements: Participants must bring a laptop with a Mac, Linux, or Windows operating system (not a tablet, Chromebook, etc.) that they have administrative privileges on. They should have a few specific software packages installed (listed below).

Code of Conduct: Everyone who participates in this workshop is required to conform to the Code of Conduct. This document also outlines how to report an incident if needed.

Accessibility: We are committed to making this workshop accessible to everybody. The workshop organizers have checked that:

Materials will be provided in advance of the workshop and large-print handouts are available if needed by notifying the organizers in advance. If we can help making learning easier for you (e.g. sign-language interpreters, lactation facilities) please get in touch (using contact details below) and we will attempt to provide them.

Contact: Please email psych-methods-support@columbia.edu for more information.


Surveys

Please be sure to complete these surveys before and after the workshop.

Pre-workshop Survey

Post-workshop Survey


Schedule

Session 1 (9/6/19), Butler 208B

Before startingPre-workshop survey
9:00a - 10:00aAcquainting yourself with RStudio
10:00a - 12:30pIntro to programming in R, part 1
12:30p - 1:00pLunch
1:00p - 2:00pIntro to programming in R, part 2

Session 2 (9/13/19), Butler 203

10:00a - 11:00aData cleaning in R
11:00a - 11:30aDescriptive statistics in R
12:00p - 12:30pLunch
12:30p - 1:30pData cleaning in R, continued
1:30p - 2:30pBasic plotting in R with ggplot2
2:30p - 3:30pBasic plotting in R with ggplot2, continued

Session 3 (9/20/19), Butler 203

9:00a - 10:30aIntro to Python for R users
10:30a - 12:00pData cleaning in Python
12:00p - 12:30pDescriptive statistics in Python
12:30p - 1:00pLunch
1:00p - 2:00pData cleaning in Python, continued
2:00p - 3:00pBasic plotting in Python with seaborn
3:00p - 4:00pBasic plotting in Python with seaborn, continued
After finishingPost-workshop survey

Setup

To participate in this workshop, you will need access to the software described below. In addition, you will need an up-to-date web browser.

We maintain a list of common issues that occur during installation as a reference for instructors that may be useful on the Configuration Problems and Solutions wiki page.

Python

Python is a popular language for research computing, and great for general-purpose programming as well. Installing all of its research packages individually can be a bit difficult, so we recommend Anaconda, an all-in-one installer.

Regardless of how you choose to install it, please make sure you install Python version 3.x (e.g., 3.6 is fine).

We will teach Python using the Jupyter notebook, a programming environment that runs in a web browser. For this to work you will need a reasonably up-to-date browser. The current versions of the Chrome, Safari and Firefox browsers are all supported (some older browsers, including Internet Explorer version 9 and below, are not).

  1. Open https://www.anaconda.com/download/#linux with your web browser.
  2. Download the Python 3 installer for Linux.
    (The installation requires using the shell. If you aren't comfortable doing the installation yourself stop here and request help at the workshop.)
  3. Open a terminal window.
  4. Type
    bash Anaconda3-
    and then press Tab. The name of the file you just downloaded should appear. If it does not, navigate to the folder where you downloaded the file, for example with:
    cd Downloads
    Then, try again.
  5. Press Return. You will follow the text-only prompts. To move through the text, press Spacebar. Type yes and press enter to approve the license. Press enter to approve the default location for the files. Type yes and press enter to prepend Anaconda to your PATH (this makes the Anaconda distribution the default Python).
  6. Close the terminal window.

R

R is a programming language that is especially powerful for data exploration, visualization, and statistical analysis. To interact with R, we use RStudio.

Video Tutorial

Install R by downloading and running this .exe file from CRAN. Also, please install the RStudio IDE. Note that if you have separate user and admin accounts, you should run the installers as administrator (right-click on .exe file and select "Run as administrator" instead of double-clicking). Otherwise problems may occur later, for example when installing R packages.

You can download the binary files for your distribution from CRAN. Or you can use your package manager (e.g. for Debian/Ubuntu run sudo apt-get install r-base and for Fedora run sudo dnf install R). Also, please install the RStudio IDE.