What is an embedded experiment is

In PsyToolkit, there are two different types of scripts you can create:

  1. Experiments: The experiments contain the code needed to run an (online) experiment, such as the Simon effect.

  2. Surveys: Surveys are online questionnaires. They have their own simple scripting language

Importantly, if you want to give online participants an experiment, you must embed one (or more) of your experiments in the survey. That is really easy to do (see below).

But why are experiments and surveys coded differently?

Just coding an experiment is quite different from the survey questions that you would want around it. For example, for coding an experiment, you have all sorts of code needed to show stimuli, wait for key presses, and so on.

Surveys and questionnaires are of a very different nature, they are simply questions people need to answer, such as multiple choice questions or open questions.

The nice thing about PsyToolkit is that it allows you to have experiments within your online questionnaires. This is called "embedding experiments".

How to embed it

This is fairly simple. When you are creating your survey, you can do it either "easy mode" or you can write out the script. For example, if you have an experiment called simon_task, you can simply have a "question" in your survey that looks like this.

l: my_experiment
t: experiment
- simon_task

How to analyze it

This is a bit more complicated to set up, because it takes a few steps:

  1. Within your experiment, you need to go to the experiment’s analyze section and then go to the analyze section. There, you can analyze one example data file and tell PsyToolkit which parts of the output data file you want to analyze.

  2. Once you have provided the information in the analyze part of your experiment, PsyToolkit’s survey download will automatically analyze the response times and error rates in the different conditions of your experiment.

  3. When you download, you will now have for each embedded experiment, a set of spreadsheet files (either as csv or excel) which contain for each participant the response times (mean and median), error rates, minumum, maximum, and number of trials per condition.

Once you have all this information, it is easy to then analyze that with SPSS.

Video tutorial

Does the above sound a bit complicated, see the full video tutorial of how to do this here. Click here.