Incrementing the range of a selection variable

Rishi Rajalingham's Avatar

Rishi Rajalingham

09 Aug, 2013 09:18 PM

Hi Chris,
I was wondering if there's a smart way to increment the range of a selection variable. I'd like to have blocks of trials where a variable is selected randomly from 0:n for block n. I could do this with just normal variables and rand() but I figured there's probably some advantage to using selection variables.

In particular, it'd be nice if the selection variable wasn't reinitialized, so that the "next selection" is biased away from the previous block's selections. For instance, in block 1, the variable is set to 0 or 1, and in block 2, it will get selected as 2 more often than 0/1 so that all 3 values get selected approximately equally times in total. Once again, I could hardcode this with normal variables and some distribution on rand(), but I'm wondering if there's a clever way of doing it. Let me know!
Thanks,
Rishi

  1. Support Staff 1 Posted by Christopher Sta... on 13 Aug, 2013 01:37 PM

    Christopher Stawarz's Avatar

    Hi Rishi,

    It's not immediately obvious to me if/how you could do this with selection variables. Let me think about it a bit and get back to you.

    Chris

  2. Support Staff 2 Posted by Christopher Sta... on 23 Sep, 2013 02:47 PM

    Christopher Stawarz's Avatar

    Hi Rishi,

    I still don't see any way to make this work with selection variables. It might be possible to get the behavior you want with normal variables and rand(), though I'm not fully convinced yet. Alternatively, it could be done with the aid of a Python bridge script or (as a last resort) a custom plugin. Should I explore those options further, or are you content with your current workaround(s)?

    Thanks,
    Chris

  3. 3 Posted by Rishi Rajalingh... on 23 Sep, 2013 04:55 PM

    Rishi Rajalingham's Avatar

    Hi Chris,
    Thanks. No need to explore workarounds, I'm satisfied with the current
    method.
    Best
    Rishi

  4. Christopher Stawarz closed this discussion on 23 Sep, 2013 05:39 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac