Millisecond Forums

Task that changes score

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

By raven - 5/9/2023

Hi!

I'm working on a task that involves participants being presented with a starting score of zero, before being presented with two stimuli (e.g.: shapes) from a pool of shapes. They must then guess which of the two shapes is correct. And if they choose the correct shape, their score by increases by 10 points 60% of the time, and decreases their score by 10 points 40% of the time. Any ideas how to go about this?

Thanks in advance!


By Dave - 5/9/2023

raven - 5/9/2023
Hi!

I'm working on a task that involves participants being presented with a starting score of zero, before being presented with two stimuli (e.g.: shapes) from a pool of shapes. They must then guess which of the two shapes is correct. And if they choose the correct shape, their score by increases by 10 points 60% of the time, and decreases their score by 10 points 40% of the time. Any ideas how to go about this?

Thanks in advance!



<values>
/ score = 0
/ multiplier = 0
/ cx = 0% // x position of correct stimulus
/ icx = 0% // x position of incorrect stimulus
</values>

// every time the correct shape is guessed there is
- a 6 in 10 chance to gain points (1), and
- a 4 in 10 chance to lose points (-1).
<list prob>
/ items = (1, 1, 1, 1, 1, 1, -1, -1, -1, -1)
/ selectionmode = random
/ replace = true
</list>

// present correct and incorrect stimulus
// click on cstim is correct response
<trial example>
/ ontrialbegin = [
    // position the two stimuli randomly
    values.cx = list.x.nextvalue;
    values.icx = list.x.nextvalue;
]
/ ontrialend = [
    // if we have a correct guess
    if (trial.example.correct) {
        // determine if we should add or subtract points
        values.multiplier = list.prob.nextvalue;
        // update the score
        values.score += values.multiplier * 10;
    }
]
/ stimulusframes = [1=cstim, icstim, score]
/ inputdevice = mouse
/ validresponse = (cstim, icstim)
/ correctresponse = (cstim)
</trial>

<text cstim>
/ items = ("A", "E", "I", "O", "U")
/ hposition = values.cx
</text>

<list x>
/ items = (35%, 65%)
/ selectionrate = always
</list>

<text icstim>
/ items = ("B", "C", "D", "F", "G")
/ hposition = values.icx
</text>

<text score>
/ items = ("Points: <%values.score%>")
/ size = (20%, 10%)
/ erase = false
/ position = (85%, 10%)
</text>

<block exampleblock>
/ trials = [1-100 = example]
</block>
By raven - 5/9/2023

This is great! Thanks for your quick reply! :)
By Dave - 5/9/2023

raven - 5/9/2023
This is great! Thanks for your quick reply! :)

Let me add one thing:

With

<list prob>
/ items = (1, 1, 1, 1, 1, 1, -1, -1, -1, -1)
/ selectionmode = random
/ replace = true
</list>

this essentially behaves like flipping a biased coin every time there is a correct guess. The coin is biased towards coming up heads (60%) more often than tails (40%). Of course, if you were to flip such a coin 10 times, there is no guarantee that it will come up 6 x heads and 4 x tails exactly, 60/40 is just the longterm expectation if you were to repeat this indefinitely.

You can alternatively do

<list prob>
/ items = (1, 1, 1, 1, 1, 1, -1, -1, -1, -1)
/ selectionmode = random
/ replace = false
</list>

which would be akin to having a deck of 10 cards, where 6 cards indicate "win" and 4 cards indicate "loss". For every set of 10 correct guesses, then, you'd be guaranteed to have exactly 6 x win and 4 x loss.

The complication with tasks like this is that you don't know and cannot control how often a given participant will guess correctly, so the realized win/loss ratio will necessarily vary depending on the specific participant's performance.

The biased coin approach is more naturalistic, but might result in the realized win/loss ratio diverging more from the target win/loss ratio. The deck of cards approach will yield results closer to the target ratio, but it also introduces a subtle pattern (i.e. participants may pick up on the fact that there's 6 wins and 4 losses for every 10 correct guesses).
By raven - 5/9/2023

Thanks Dave, that makes sense.

So I guess there would be no way to ensure that each participant gets 6 wins and 4 losses when using randomisation of stimuli.

What if the stimuli aren't randomised and are drawn from a given set that all participants will see (e.g.: / items = ("A", "E", "I", "O", "U", "B", "C", "D", "F", "G")? In this instance it should ensure the required ratio of wins and losses. But, following on from that, can the order of the stimuli be randomised for different participants, ensuring the same win/loss ratio?

I hope that makes sense. :unsure:
By Dave - 5/9/2023

raven - 5/10/2023
Thanks Dave, that makes sense.

So I guess there would be no way to ensure that each participant gets 6 wins and 4 losses when using randomisation of stimuli.

What if the stimuli aren't randomised and are drawn from a given set that all participants will see (e.g.: / items = ("A", "E", "I", "O", "U", "B", "C", "D", "F", "G")? In this instance it should ensure the required ratio of wins and losses. But, following on from that, can the order of the stimuli be randomised for different participants, ensuring the same win/loss ratio?

I hope that makes sense. :unsure:

Randomization of stimuli has nothing to do with it. You cannot know how often a given participant will guess correctly. It's the participant's choice how they respond and it's not under your control!

Suppose you run 20 trials and use the deck of 10 cards model (i.e. /replace = false for the list, 6 "win" cards, 4 "loss" cards).
Participant A makes 3 correct guesses. There is no way for this participant to achieve a 60/40 win-loss ratio, and the realized ratio might be anything from 3 wins / 0 losses to 0 wins / 3 losses.
Participant B makes 13 correct guesses. In the deck of cards model, they'll have an exact 6/4 split for the 1st 10 correct guesses. But what about the remaining 3? Those could again be anything between 3 wins / 0 losses and 0 wins / 3 losses. Or, across all 13 guesses, anything between 9 wins / 4 losses and 6 wins / 7 losses.
By raven - 5/9/2023

Thanks for explaining the logic, that clears things up.

Also, just to confirm, does the 'noreplace' attribute mean that a particular stimulus will only be shown once, as opposed to multiple times?
By Dave - 5/9/2023

raven - 5/10/2023
Thanks for explaining the logic, that clears things up.

Also, just to confirm, does the 'noreplace' attribute mean that a particular stimulus will only be shown once, as opposed to multiple times?

noreplace means items are sampled randomly without replacement. If you have a stimulus with 5 items and sample from that stimulus 5 times, then each item will appear exactly once. If you sample more than 5 times from the stimulus, then obviously some or all items will have to repeat.
By raven - 5/12/2023

I've implemented a timeout, so is it possible to make the score reduce by 10 points if the participant does not respond within that period?
By raven - 5/14/2023

To explain better, instead of using the mouse for input, I'd like to use keyboard input 'e' if participants think a particular stimulus (from cstim) will result in a score increase, or 'i' if they think it will result in a score decrease (from icstim), but if no input is received, then the score will decrease (as per previous post).

Also, is it possible to include a pool of stimuli that don't result in any change to the score?

I appreciate your help!
By Dave - 5/15/2023

raven - 5/14/2023
To explain better, instead of using the mouse for input, I'd like to use keyboard input 'e' if participants think a particular stimulus (from cstim) will result in a score increase, or 'i' if they think it will result in a score decrease (from icstim), but if no input is received, then the score will decrease (as per previous post).

Also, is it possible to include a pool of stimuli that don't result in any change to the score?

I appreciate your help!

> I've implemented a timeout, so is it possible to make the score reduce by 10 points if the participant does not respond within that period?

/ ontrialend = [if (trial.example.response == 0) {
values.score -= 10;}
]

> Also, is it possible to include a pool of stimuli that don't result in any change to the score?

Sure, just set up and run a <trial> that displays these stimuli and does not change the score.
By raven - 5/16/2023

Thanks Dave,

The no response part of the script works great.

For the second part though, I would like stimuli that doesn't change the score randomly mixed in with the other stimuli that do change the score, so are you saying that I can create another <trial>? How would I make those stimuli be randomly presented with the other stimuli?
By Dave - 5/16/2023

raven - 5/16/2023
Thanks Dave,

The no response part of the script works great.

For the second part though, I would like stimuli that doesn't change the score randomly mixed in with the other stimuli that do change the score, so are you saying that I can create another <trial>? How would I make those stimuli be randomly presented with the other stimuli?

Yes, create another trial. Let's call it the "distractor" trial and the one that changes the score the "experimental" trial. Then sample these trials randomly in your block, at whatever experimental to distractor trial ratio you want.

E.g.

<block example>
/ trials = [1-100 = noreplace(experimental, distractor)]
</block>

would run 50 experimental trials and 50 distractor trials in random order, for a total of 100 trials.

<block example>
/ trials = [1-100 = noreplace(experimental, experimental, experimental, distractor)]
</block>

would run 75 experimental trials and 25 distractor trials in random order, i.e. a 3 to 1 ratio.
By raven - 5/16/2023

Ok, that makes sense, I'll give it a try and see how it goes. Thanks again Dave! :)