4

I started using JSPsych/javascript a few months ago and have now coded my first full experiment. I ran a pilot and it became clear that my participants were not being evenly assigned to conditions.

To assign participants to conditions I'm using a randomisation function:

 jsPsych.randomization.shuffle

I have a 20 cell design it's quite important that allocation is approximately balanced.

I know Josh de Leeuw has some PHP / JS functions which communicate with a MySQL database which allows you to assign participants to conditions in a balanced way.

This seems a little complicated and I'm not sure I quite follow how to do it.

Has anyone found a way of assigning participants to conditions in a balanced way?

Gorka
  • 3,555
  • 1
  • 31
  • 37
Con Des
  • 359
  • 1
  • 2
  • 9

1 Answers1

2

You're right that the method that jsPsych suggests is not straightforward. One option you have is to use JATOS on your server side (it's an open-source package to manage your server).

There's an example study (see 'Randomize tasks between workers') to do the counterbalancing exactly as you described.

You have the option of using a MySQL database or an H2 database (easier, and equally reliable as far as I can tell). You'll need to change a handful of lines in your jsPsych script to send data to JATOS but that's all described in the docs.

Disclaimer: I'm involved in the JATOS project. But it's open source :)

elisa
  • 965
  • 9
  • 27