Randomizing trial type across the block


Author
Message
wuaham
wuaham
Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)
Group: Forum Members
Posts: 38, Visits: 170
Good morning:

I am having difficulties in randomizing trial type across the block.

In my experiment (script attached, thanks to Mr. Dave for supporting with this script earlier), I have 4 trial type (namely: "odd/odd", "even/even", "odd/even", "even/odd") but extended to 16 (and can be more in future) for randomizing across the blocks (currently, there are 64 trials in the block). I have also adjusted relevant scripts. It works fine. But the problem is that often “leftitemnumber” and “rightitemnumber” pick up the same values from the list (image attached)

I would like to avoid this that “leftitemnumber” shouldn’t be the same as “rightitemnumber”. There may be some way to put /not in list element - but I not sure how to do that.

Would highly appreciate it your kind help.
Thanks

Attachments
needhelp.iqx (23 views, 8.00 KB)
TrialTypeError.PNG (24 views, 15.00 KB)
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
wuaham - 2/8/2024
Good morning:

I am having difficulties in randomizing trial type across the block.

In my experiment (script attached, thanks to Mr. Dave for supporting with this script earlier), I have 4 trial type (namely: "odd/odd", "even/even", "odd/even", "even/odd") but extended to 16 (and can be more in future) for randomizing across the blocks (currently, there are 64 trials in the block). I have also adjusted relevant scripts. It works fine. But the problem is that often “leftitemnumber” and “rightitemnumber” pick up the same values from the list (image attached)

I would like to avoid this that “leftitemnumber” shouldn’t be the same as “rightitemnumber”. There may be some way to put /not in list element - but I not sure how to do that.

Would highly appreciate it your kind help.
Thanks

If you want to avoid that, reset the two lists odditemnumbers and evenitemnumbers /ontrialbegin in each trial.

wuaham
wuaham
Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)
Group: Forum Members
Posts: 38, Visits: 170
Dave - 2/8/2024
wuaham - 2/8/2024
Good morning:

I am having difficulties in randomizing trial type across the block.

In my experiment (script attached, thanks to Mr. Dave for supporting with this script earlier), I have 4 trial type (namely: "odd/odd", "even/even", "odd/even", "even/odd") but extended to 16 (and can be more in future) for randomizing across the blocks (currently, there are 64 trials in the block). I have also adjusted relevant scripts. It works fine. But the problem is that often “leftitemnumber” and “rightitemnumber” pick up the same values from the list (image attached)

I would like to avoid this that “leftitemnumber” shouldn’t be the same as “rightitemnumber”. There may be some way to put /not in list element - but I not sure how to do that.

Would highly appreciate it your kind help.
Thanks

If you want to avoid that, reset the two lists odditemnumbers and evenitemnumbers /ontrialbegin in each trial.

Thank you very much Dave, it works!.


Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
wuaham - 2/9/2024
Dave - 2/8/2024
wuaham - 2/8/2024
Good morning:

I am having difficulties in randomizing trial type across the block.

In my experiment (script attached, thanks to Mr. Dave for supporting with this script earlier), I have 4 trial type (namely: "odd/odd", "even/even", "odd/even", "even/odd") but extended to 16 (and can be more in future) for randomizing across the blocks (currently, there are 64 trials in the block). I have also adjusted relevant scripts. It works fine. But the problem is that often “leftitemnumber” and “rightitemnumber” pick up the same values from the list (image attached)

I would like to avoid this that “leftitemnumber” shouldn’t be the same as “rightitemnumber”. There may be some way to put /not in list element - but I not sure how to do that.

Would highly appreciate it your kind help.
Thanks

If you want to avoid that, reset the two lists odditemnumbers and evenitemnumbers /ontrialbegin in each trial.

Thank you very much Dave, it works!.


Just to make clear why you may get identical item numbers when you don't reset. It's pretty obvious when you think about what happens when trials sample from the lists.

Let's take the odditemnumbers list:
- It has four item numbers, and these are sampled randomly without replacement.

- Suppose your first trial is "odd/odd". That trial thus samples two items from the list, let's say 3 and 5, so 1 and 7 remain.

- Suppose your next trial is "even/odd". That trial will sample one of the remaining items from the odditemnumbers list (and one from the evenitemnumbers list). Let's say 1 is sampled and so 7 remains.

- Now suppose the next trial is again "odd/odd", i.e. it needs two item numbers from the list. But only one is left unsampled, 7.

To get the 2nd odd item number, the list has to reset  and make all four items available again.

There thus is a 1-in-4 chance that the 2nd item number sampled in that trial will also be 7.

When you reset the lists manually /ontrialbegin in each trial, a situation like the above cannot occur. The list will always have 4 items available, and the 2 items sampled will always be different.

wuaham
wuaham
Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)
Group: Forum Members
Posts: 38, Visits: 170
Dave - 2/9/2024
wuaham - 2/9/2024
Dave - 2/8/2024
wuaham - 2/8/2024
Good morning:

I am having difficulties in randomizing trial type across the block.

In my experiment (script attached, thanks to Mr. Dave for supporting with this script earlier), I have 4 trial type (namely: "odd/odd", "even/even", "odd/even", "even/odd") but extended to 16 (and can be more in future) for randomizing across the blocks (currently, there are 64 trials in the block). I have also adjusted relevant scripts. It works fine. But the problem is that often “leftitemnumber” and “rightitemnumber” pick up the same values from the list (image attached)

I would like to avoid this that “leftitemnumber” shouldn’t be the same as “rightitemnumber”. There may be some way to put /not in list element - but I not sure how to do that.

Would highly appreciate it your kind help.
Thanks

If you want to avoid that, reset the two lists odditemnumbers and evenitemnumbers /ontrialbegin in each trial.

Thank you very much Dave, it works!.


Just to make clear why you may get identical item numbers when you don't reset. It's pretty obvious when you think about what happens when trials sample from the lists.

Let's take the odditemnumbers list:
- It has four item numbers, and these are sampled randomly without replacement.

- Suppose your first trial is "odd/odd". That trial thus samples two items from the list, let's say 3 and 5, so 1 and 7 remain.

- Suppose your next trial is "even/odd". That trial will sample one of the remaining items from the odditemnumbers list (and one from the evenitemnumbers list). Let's say 1 is sampled and so 7 remains.

- Now suppose the next trial is again "odd/odd", i.e. it needs two item numbers from the list. But only one is left unsampled, 7.

To get the 2nd odd item number, the list has to reset  and make all four items available again.

There thus is a 1-in-4 chance that the 2nd item number sampled in that trial will also be 7.

When you reset the lists manually /ontrialbegin in each trial, a situation like the above cannot occur. The list will always have 4 items available, and the 2 items sampled will always be different.

Thank you so much for this explanation. You read my mind secretly. It was my curious to know why I needed to reset.  This clarification has cleared it up. Thank you Mr Dave once again. You are indeed a super star****. Enjoy the weekend.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search