#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

# Delay Discounting

Dear OpenSesame community

I’m currently working on a delay discounting task and I want to integrate an inline script which calculates an indifference point. Richards, Zhang, Mitchell and de Wit (1999) programmed a random adjusting-amount procedure to use the answers to previous questions to narrow the range of values from which the value for the next question was selected. I think it is a great way to determine the indifference point but it seems quite complicated (if someone has used this procedure on OpenSesame I would be very thankful for him/her to send me the script ). Right now I’m settling for an easier procedure by Du, Green, and Myerson (2002). The variable amount starts with half of the amount of the standard amount (say the standard amount is 100\$ then the variable amount is 50\$). If the participant chooses the standard amount the variable amount increases on the next trial by ¼ of the standard amount (in this case 50 + 25 = 75\$). If the participant settles for the 75\$ in the next round than the amount decreases by 1/8 of the standard amount (in this case 12.50\$) and so on. This graphic by Frye, Galizio, Friedel, DeHart and Odum (2016) is very helpful to understand the principle:

I would like to integrate this procedure but I’m having trouble to do so. Could you please tell me how to create a code for the random adjusting-amount procedure?

If you need further information, please let me know!

Kind regards
Erwin

• Hi Erwin.

Regards,
Gisel

• Try this:

``````RespKeys = keyboard(keylist = ['x','m']) # your responses on the keyboard

var.low=50 #starting value
var.high=100 #starting value

for i in [2,4,8,16,32]:
Stim=canvas()
Stim.text('Please select x for: '+str(var.low) + '  or select m for: ' + str(var.high)  )
Stim.show()
Resp, Resp_t = RespKeys.get_key()
log.write_vars()

if Resp=='x':
var.low=var.low - 50/i
elif Resp=='m':
var.low=var.low + 50/i
``````

Greetz
Stephan

• Thank you, Stephan.
Please, let me interpret your code to see if I'm understanding. – Is the standard amount 100 and the i values (2,4,8,16,32) are the different delays?

Does this code have to be written into the loop or sequence tool? – I am new in OpenSesame and learning about it.

Best regards,
Gisel

• Hi Gisel,

in a new experiment. make a sequence. Put the inline_script and a logger item behind.
That's it.
Try the code if it fits for your porpuse. Then adopt it as you need it.

The standard amount 100 keeps always the same as in the picture by Erwin.
The lower amount changes. That's what you need the i values for. See the calculation for var.low at the end.

Enjoy
Stephan

• Hi Stephan,