Staircase to INCREASE number of dots

Hello! I am creating an experiment where I want to increase the number of moving dots obscuring an image when the participant answers correctly.

The Psychopy staircase handler in builder only allows for a variable to decrease in value on a correct answer. From the previous discussion below it appears I might be able to do this with a negative step size or equation but I’m not sure how to implement it:

I am new to coding but can manipulate bits in the coder or create a staircase code component if needed. Has anyone else had experience making a staircase in this way?

Thanks in advance!

Hi, I’m not too familiar with the staircase, but what about this previous post from that thread:

This should take just a single line of code in a code component to define the variable you use to set the number of dots.

Right, I guess I’m just not sure what arithmetic to use and how it interacts with my step size and minimum/maximum values.

My step size is 25, the number of dots should increase by 25 for correct answers and decrease by 25 for incorrect answers.

I use the variable “level” (the value generated by the staircase) to set the number of dots:

dots = visual.DotStim(win=win, name='dots',
    nDots=level,

How would I transform this? I’ve tried making level or the step size negative (thinking a decrease by a negative value would result in an increase) but I get an error when the number of dots tries to go below zero, ignoring the minimum value for some reason.

OK, I’m flying a little blind here, but I guess it could be something like this (using whatever your variable name is for the starting value):

nDots = (start_value - level) + start_value

e.g. if the starting value is 250, and in response to a correct answer the stair case calculates level as 250 - 25 = 225, this would flip it around in the opposite direction to (250 - 225) + 250 = 275.

you should probably also explicitly record this value in the data on each trial, as something like:

thisExp.addData('num_dots', (start_value - level) + start_value)

This makes sense but I want the task to start easier and get more difficult with the staircase and using smaller values as the start_value doesn’t seem to work, the number of dots quickly maxes out.

Also, I’ve found that if a participant continually answers incorrectly, decreasing the number of dots, they can error out of the study if the dot number goes negative. No one should be answering incorrectly with very few dots on the screen but I think it’s still a problem. Any way to prevent this?

I worked it out by starting on a large step, subtracting that from the maximum value and adding the minimum value:

nDots = (500 - level) + 25

1 Like