Millisecond Forums

loss aversion task - incorrect data recorded

https://forums.millisecond.com/Topic13086.aspx

By gracethenoob - 4/22/2014

My experiment is a loss aversion task. There are 140 trials and for each one, the participant must choose between a guaranteed amount or take a 50/50 bet. If they take the bet, the program must determine whether they "won" or "lost" the bet. Over the course of the task, there is a running total shown on the screen such that people sensitive to losses would really see that they occasionally lose bets (if they choose to take any of them).

There are 2 types of trials: "gambles" and "gain only". In "gambles" trials, participants must choose between a positive/negative bet or a certain/guaranteed zero. In "gain only" trials, participants must choose between a positive/zero bet or a certain/guaranteed small positive amount (i.e., smaller than the positive amount within the bet). Participants can respond "A" to take the bet or "L" to take the guaranteed amount. Everything about *presenting* the stimuli is working.

For each trial, the data file contains values for what the "win", "loss" and "certain/guaranteed" amounts are. The problem is that these values the first two trials are always recorded wrong and they are always recorded as win$2/lose$0.5/certain$0 and win$2/lose$0/certain$1 no matter what was presented on screen. The data rows for trials 3, 4, and 5, show the correct values for trials 1, 2, and 3 so it somewhat seems like things get shifted downwards. The actual values for trials 139 and 140 get "cut off" because there are only 140 trials in the experiment. Despite this values problem, all 140 participant responses are correctly recorded in their appropriate data rows.

As it happens, "win$2/lose$0.5/certain$0" coincides with the first item listed for the "win", "loss" and "certain" items (respectively) for the "gambles" type of trials. Similarly, "win$2/lose$0/certain$1" coincides with the first item listed for the "win", "loss" and "certain" items (respectively) for the "gain only" type of trials. Furthermore, the actual trials with those combinations do appear later in the experiment so it's not like they are skipped.

What might be going on with my experiment? Any and all assistance is greatly appreciated.

By Dave - 4/22/2014

> What might be going on with my experiment?
Your question is impossible to answer without you providing the actual script and explaining the relevant portions of code. In general, you should audit your syntax for mistakes and pay particular attention to (a) when / how those values are updated and (b) when / how they are logged. That's very likely where your mismatch is to be found.
By gracethenoob - 4/23/2014

Thank you so much for your prompt reply!

My code specifies the following values up front:
<values results>
/outcome = 0
/balance = 0
/response = 0
/win = 0
/loss = 0
/certain = 0
</values>

Then the items associated with wins is as follows:
<item gambles_win>
/1 = "2"
/2 = "4"
/3 = "5"
/4 = "6"
/5 = "8"
...
</item>

There are also corresponding items for "losses" and "certains".

Then I use the "text" command to present these items values on screen and I link the loss values with the win values (and also the certain values with the win values so they come as a trio):

<text gambles_win>
/items = gambles_win
/position = (20, 20)
/txcolor = (0,255,0)
/select = noreplace
/ fontstyle = ("Arial", 10%)
</text>

<text gambles_certain>
/items = gambles_certain
/select = text.gambles_win.currentindex
/position = (70, 45)
/txcolor = (0,0, 255)
/ fontstyle = ("Arial", 10%)
</text>

<text gambles_loss>
/items = gambles_loss
/select = text.gambles_win.currentindex
/position = (20, 65)
/txcolor = (255,0,0)
/ fontstyle = ("Arial", 10%)
</text>

So far, I think everything is fine. Maybe it is the trial specification that is the problem. At the beginning of each trial, I set the values for win, loss, and certain to match whatever I'm presenting on screen. The "values.outcome" determines whether the participant will win or lose the bet if they choose to take it. At the end of each trial, I update the "balance" by adding the appropriate value.

<trial gambles>
/stimulusframes = [1 = running_total; 10 = gambles_win, gambles_loss, gambles_certain]
/ontrialbegin = [values.outcome = counter.flip_coin.selectedvalue]
/ontrialbegin = [values.win = text.gambles_win.currentitem]
/ontrialbegin = [values.loss = text.gambles_loss.currentitem]
/ontrialbegin = [values.certain = text.gambles_certain.currentitem]
... (bunch of other trial specifications)
/ ontrialend = [if(trial.gambles.response == 30 && values.outcome == 1)
    {values.balance = values.balance + values.win}]
/ ontrialend = [if(trial.gambles.response == 30 && values.outcome == 0)
    {values.balance = values.balance + values.loss}]
/ ontrialend = [if(trial.gambles.response == 38)
    {values.balance = values.balance + 0}]
</trial>


Lastly, I create a data output file:

<data loss_aversion_data>
/ file = "LA_data.iqdat"
/ columns = [date, time, subject, values.outcome, values.balance, values.win, values.loss, values.certain, response]
/ separatefiles = true
</data>

The values.balance column (as far as I can tell) reflects what the balance is at the *end* of the trial. This looks straightforward to me so I don't think it's the source of the problem but I welcome your input.





By Dave - 4/23/2014

> At the beginning of each trial, I set the values for win, loss, and certain to match whatever I'm presenting on screen.

Nope. There's your misconception. Any /ontrialbegin logic is executed *before* any stimuli as given in /stimulusframes are presented and thus *before* any selection for those stimulus elements occurs.

<trial gambles>
/stimulusframes = [1 = running_total; 10 = gambles_win, gambles_loss, gambles_certain]
[...]
/ontrialbegin = [values.win = text.gambles_win.currentitem]
[...]
</trial>

text.gambles_win.currentitem is not what *will be presented* in this instance of the <trial>. Selection has not happened yet (and currentitem is either indeterminate or reflects selection from the *preceding* trial) and only does later when <text gambles_win> is displayed in the 10th frame as per the /stimulusframes attribute.

Move the logic to /ontrialend.
By gracethenoob - 4/23/2014

It worked!
Thank you so so much :D