Aims of this lesson

Setting up experiments or questionnaires requires knowledge of computers. For example, you will need to create stimuli, even when you are only using the PsyToolkit web-based version. Here you will learn about what you need and where you can get it, etc.

Whether you are a psychology student or a laboratory researcher, at some point you might want to create surveys and experiments yourself, rather than relying on others to do this for you. For this you need more than just psychology skills, you will also need to understand the equipment you work with and which you use for your measurements of human behavior.

The following types of knowledge are necessary:

  • Understand what behavioral measurement software is.

  • Understand what a computer file is, and how to use a file.

  • Know what an image file is, and how to create one.

  • Know how computers register and measure time.

Each of these questions and more are addressed below. If you have further questions, do not hesitate to contact Gijsbert Stoet.

Software for measuring human behavior

The type of human behavior cognitive/experimental psychologists are interested in occurs quickly. For example, noticing that an image appears and responding to it takes a fraction of a second. Computers can measure this with reasonable to great accuracy, all depending on the software. There is a software especially designed for measuring the time it takes to respond to stimuli, and PsyToolkit is one such package.

The stimuli themselves, the images and sounds you want to use need to be made with other software, or you might already have found them somewhere. In particular the creation of the little images used in experiments is quite important. There are various programs you can use to create stimuli; I recommend Inkscape, about which there is a whole lesson.

Computer hardware

Computer hardware is what the computer is made of, and the components you see are the keyboard, the case that contains most of the components, and the screen.

Computers are great tools for psychological experiments. The screen and speakers are used for stimulus presentation. The mouse and keyboard are used as response measurement instruments. And the timers in the computer can easily measure events at the millisecond[resolution] (1 second has 1000 milliseconds).

Note When you run experiments in your browser, you do not get the same precision as you would get when you run PsyToolkit on the desktop. However, it is still pretty good and works with an around 10 ms resolution.

Each computer screen is made of small light emitting units, called pixels. The resolution of a screen is a description of the number of pixels. Modern screens often have something like 1600x1000 pixels.

When writing a research paper, you might describe a stimulus as 5 x 5 mm, or alternatively, you can describe stimuli in visual angle.

Computer keyboards and computer mice are input devices. These can be used for psychological experiments, although researchers often use custom devices, such as the excellent Cedrus keyboards.

Operating system

The operating system of a computer (OS) is the software system that manages the computer "behind the scenes". Well known operating systems are Microsoft Windows, Mac OS, and Linux. You do not really need to know much about the operating system, but it is important to understand that different OSs are not necessarily compatible with each other.

PsyToolkit was initially only developed for Linux, but can run on all computers if you run experiments within your browser. Thus, you do not need to use Linux, but if you are a highly motivated person who wants to do many laboratory experiments, you might give it a try (initially, you will need to be willing to spend some time and have patience learning the new computer skills).

The browser version of PsyToolkit is ideal for student projects and online data collection projects.

The advantage of running on Linux is that you will have even better timing, although even the timing in the browser is good enough for demonstrating well known psychological phenomena. As a Linux fan, I would like to say that Linux is free of cost and you can add it to the OS you already have. For example, if your computer runs Microsoft Windows, you can add Linux, given you have sufficient hard-disk space. Once you have installed Linux next to Microsoft Windows, you will get an option during start up whether you want to start Linux or Microsoft Windows. In modern computers, you can even simultaneously run operating systems as virtual machines, even though this will likely lead to diminished performance.

There are a number of popular Linux versions, such as Mint, Ubuntu, Fedora, Debian, and OpenSuse. These are all equally good.

Files and folders

Files are pieces of information (e.g., a text document, a song, a movie) and have a filename. Files are organized in directories or folders . The words directory and folder mean exactly the same.

In some operating systems, the full file name is not shown (but there is typically an option to make the full file name visible).

In PsyToolkit, all files related to one experiment should (ideally) be placed in one folder. Typically, stimuli can be placed in a sub folder.

Every computer has a file manager to show the files and folders on your computer.

File types

Files have a file type. The simplest files are text files. They often have an extension .txt, but this might not be visible on some operating systems, most notably Microsoft Windows. In that case, there might be an icon that helps you to find out what the file type is.

Text files

Text files are the simplest type of files that can be modified (edited) using a text editor. It is strongly discouraged to use a Word processor (e.g., Word) for this.

PsyToolkit and text editing If you work in the browser, you can do all editing in a text box within your browser. But if you use PsyToolkit on a Linux Desktop (which fewer people will do than use the browser version), then you need to learn a bit about text editors. It is easy.

Text editors

A text editor is a computer application that allows you to edit a text file. PsyToolkit scrips and R scripts are all text files that can be edited with text editors. There are text editors, just have a look here. Notepad++ seems a good choice for Microsoft Windows. For Linux, there are so many good ones in obvious places in the applications menu that this does not need any further comments.

Which editor you will use may be a matter of taste and for the purposes of these lessons any will do. Personally, I find emacs the best, especially because it can run R scripts in a convenient way.

The image below shows a texteditor (gedit) with a PsyToolkit script file (which is just a simple text file).


Bitmap images

Drawings and photos can be saved in many different formats. You can read more about the details here . What is important is that PsyToolkit can read in practically any bitmap format. A stimulus bitmap should be smaller than the screen resolution, and the default screen resolution of the PsyToolkit screen is 800 by 600 pixels. That is way smaller than images made by digital cameras. If you use bitmaps, make sure they have an appropriate size. Use a programme such as gimp or inkscape (below) to cut and scale them. The ImageMagick software toolkit is very easy for manipulating images.


Fonts contain information about what text should look like. Typical fonts are Times and Arial, but there are hundreds of different fonts, and there are typically a whole bunch on any computer. PsyToolkit can use fonts to render text, but because text rendering costs time, it is better to use bitmaps for text stimuli.


Inkscape is a drawing programme. It is one of the best available open source free programmes in its class. It is ideal for use with PsyToolkit, because it is easy to create stimuli and same stimuli in a bitmap format (png is the default format). Inkscape is available for all operating systems. Its native file format is SVG.

There is a whole lesson about working with Inkscape. Note that even if you use PsyToolkit in the browser, you still need to create and draw your stimuli. Click here to go to that lesson.

It is easy to learn Inkscape. It is recommended to spend some time to learn it before you plan to program experiments.


R and SPSS

R and SPSS are professional statistics programmes. SPSS is commonly used in Psychology, but unlike R, it is expensive. R has a steep learning curve, but it is a fantastic programme. The donations of individuals and research organizations pay for the costs. There are many top statisticians contributing to the development of R.

Here are a few links for introductions with a focus on psychology students:

The recommended way to use R is RStudio.

Also, there is an excellent search engine for R: Rseek

Office software

If you are looking for free office software, just check LibreOffice

  • LibreOffice Includes word processor and spreadsheet program. It is compatible with files saved in Microsoft office.

Below, you see the free office suite Libre Office in action.


Where to download these packages

If you work with Linux, you would just download and install these packages using your package installer. If you do not work with Linux, you will need to visit the individual websites and manually download and install.

Essential software for PsyToolkit on Linux

Additional software mentioned in this lesson:


Test yourself with some homework

Now it is time to check if you can use the above information to solve real issues. Before you do so, make sure you have installed Inkscape, as well as a decent text editor or RStudio.
  • Use Inkscape and draw a 50x50 red rectangle without a stroke rounded corners. Export this as a PNG bitmap.

  • Explore your computer using its file manager. Find out how to show the file extensions of the files.

  • Play around with a text editor. Type "hello" and save the file. Does your file manager show the extension "txt"? If not, do you now know how to get your computer to show file extensions?