Programming for Psychologists: An Introduction with Tips and Tricks

Version 1.0
Last update: May 27, 2018

This set of modules has been designed to introduce you to the basics of programming and to show you a set of useful examples for how to use programming to make your life as a scientist and psychologist easier.

Before we begin, please download and take a look at this overview handout. Below, you will find the basic contents and details of this course, including step-by-step instructions for how to go from zero to code-hero (or at least "get-the-job-done-competent").

Downloading the software >>

This set of tutorials and examples is designed for Matlab (and its free copycat version Octave). The first step is to make sure that you have the relevant software. Please try to have either Matlab or Octave, as well as PsychToolBox, installed prior to the starting these modules. Click here for instructions.

Learning basic coding skills >>

The next step along your path is to learn basic coding skills. If you have already done some programming before, you should check out this section to make sure you understand the relevant material in MATLAB. If you have never coded before, you should spend as much time as you need to familiarize yourself with these basic concepts prior to moving to the next set of modules. This will help you in interpreting code that you read in other sections. You will also likely want to continue digging in a bit deeper after going through these modules to become more familiar with key components of programming. Click here for some recommendations on how to go about doing this.

Experiment programming >>

Having gained basic programming skills, the next step you may want to tackle is putting together scripts for experiment presentation, stimulus delivery, and/or data collection. These modules will walk you through both some basic and more advanced issues, using a single experiment as an example. I will introduce you to some recommended practices that will likely make your life easier, either today or in the future. Click here to begin.

Data analysis >>

You've programmed the study, you've collected data, and now you want to see what the data says. These modules will walk you through basic data analysis, including code for both statistics and plotting in MATLAB. It will also show you how to export your data in formats that can be read by other statistics packages (e.g., R or SPSS), since to be perfectly honest I'm not actually a huge fan of using MATLAB for analyses. Click here to stats it up!

More to come!

Although this set of modules is currently oriented exclusively around MATLAB programming, new modules may be posted here in the future covering programming in other languages (i.e., Python, R) so check back to see if there any recent updates.

Thanks for reading, and hope these materials are helpful to you!
Cendri Hutcherson