Counter-balancing with increase() Demo Experiment Run Experiment

Counter-balancing with increase()

Jaap Murre

How do you assign subjects to different conditions as they come in to do your online experiment? This is easily done with the increase() function.

This script gives an example of counter-balancing. Note that the output is shown in the so called console window (open with F12 on Windows or Cmd-Option-J on Mac). More information about the increase() and how it is implemented can be found in the free NeuroTask Scripting book.

If you are a registered user and signed in, you can here copy this script and its stimuli to your own account, where you can edit it and change it in any way you want.

It is absolutely free to register (no credit card info asked!). You can then instantly copy this experiment with one click and edit it, change its accompanying texts, its landing page, stimuli, etc. Invite your colleagues, friends, or students to check out your experiment. There is no limit on how many people can do your experiment, even with a free account.

The catch? There is no catch! Just keep in mind that with a free account, you cannot collect data. For teaching that is usually not a problem. For research, prepaid data collection (unlimited subjects) starts as low as €10.00 for a 10-day period.

// See https://leanpub.com/neurotask2nd/read#leanpub-auto-increase-and-decrease
// for a description of this demo
// The output can only be viewed in the Console Window (press F12 on Chrome)
var n = increase("subject_id","script");

console.log("Subject ID",n);

// % is the modulus operator
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators
if (n%2 === 0)
{
    console.log(">>>>>> List variant A")
}
else
{
    console.log(">>>>>> List variant B")
}
This experiment has no files of this type
This experiment has no files of this type
This experiment has no files of this type
This experiment has no YouTube links
This experiment has no files of this type