How to Program Experiments 1: Cheating with Powerpoint
And here we finally are; it’s something I’ve been avoiding getting around to for a while, because it’s such a big and complicated topic, but to a large extent it’s the raison d’etre behind this entire blog, so I knew I’d have to roll up my sleeves and get down to it eventually. The topic I’m referring to is of course, how do you make a computer perform those nice cognitive-type psychology experiments? How do you get it to put pictures, words, or videos up on the screen, collect responses, store the data and do it all with accurate timing? How, in a nutshell, do you make a computer your all-singin’, all-dancin’, research-data-collectin’ bitch?
As I said, this is a massive topic, so before getting into specialised software and ‘proper’ experimental programming we’re going to start slowly, and we’re going to start with some techniques for using a piece of software that’s on practically every PC – Microsoft Powerpoint. Powerpoint is essentially just a program for presenting multimedia (words, pictures, video, sounds) on a screen in a nice professional way, so we can use it for presenting some simple experimental stimuli. The one thing that it won’t really do is collect input from a participant (except the standard ‘advance to the next slide’ input), which is a pretty big limitation for experimental purposes, but can be worked around.
The best ways of explaining how to use Powerpoint are by example, so I’ve created a couple of illustrative slideshows.
The first one is a simple rating task, where pictures of faces are presented, and a Visual Analogue Scale (VAS) is presented on-screen underneath each picture, like this:
Participants are asked to rate each picture, and advance through the slideshow at their own pace. Ratings of stimuli are often required as ancillary tasks in experiments, in order to validate a novel set of stimuli, or to evaluate a previously-used set on some new dimension. Hopefully it’ll be obvious how this simple technique could be used with different stimulus sets and scales to suit a range of purposes. You can download the file for this one here (Example_rating_task.ppt); formatted as a .ppt (1997-2003) for compatibility purposes.
The second one is slightly more complex, and is a basic task that you might want to use in a fMRI study. This one consists of a simple visual stimulus (an animated gif of a counter-phasing black-and-white checkerboard) which alternates on and off with a blank screen (with a red fixation cross present throughout):
The stimulus was created from a single jpeg of a checkerboard. First I made a negative version of the image using the pixlr online image editor, and then put the two together into an animated gif using picasion.com – super easy. The neat thing about this one is that I’ve set timings for each slide, so that the checkerboard stimulus appears and disappears every 15s as the slides advance automatically; this creates a simple fMRI block-design experiment. The ability of powerpoint to display animated gifs, means some reasonably complex stimuli could be used, and hopefully again it should be obvious how this program could be modified to form different kinds of experiments (presentations of sounds, or simply ‘stop’ and ‘go’ cues for a finger-tapping task, for instance). This is a very simple experiment, but might be something that would be used as an ancillary task in a fMRI study, in order to validate the scanner sequence being used, or perhaps to localise the visually responsive areas in the occipital lobe. The timing in powerpoint isn’t great, and I would definitely not use it for anything event-related, but it’s probably good enough for this kind of thing. You can download the .ppt file for this one here (Example_fmri_visual_activation_experiment.ppt).
And that’s it. Easy, huh? Any questions, hit me up in the comments, otherwise – happy experimenting!
PS. If anyone actually uses one of these slideshows, or something based on the ideas in this post for their experiments I’d be thrilled to know about it – comment, or e-mail me! Thanks.