selecting stimuli without replacement from a list, but using the same stimuli consistently on trials within a block

534 views
Skip to first unread message

Katie S

unread,
May 10, 2011, 11:06:45 PM5/10/11
to E-Prime
Hi all

Here is my situation:

I want to present shapes paired with sounds, first shape, then sound,
in three different blocks.

In each block, there are 16 shape-sound trials: 12 common sounds and 4
oddball sounds.

In one block, the same shape always predicts the same sound, so there
are 12 common shapes, 4 oddball shapes.
In another block, there is an "error" 25% of the time. So there are 6
oddball shapes (3 before the the oddball sounds, 3 before the common
sound) and 10 common shapes (1 before the oddball shape, 9 before the
common shapes)
In a third block, it is random which shape predicts which sound, so
there are 6 of one shape before common sounds and 2 before oddball
sounds, and the same is true of the other.

I have some constraints I'd like to satisfy. I'd like the oddball
sounds to be dispersed so that one occurs in each quarter of the 16
trials. I probably have some others but I don't think that's
important for my current question.

I can write code just fine to generate two arrays that create a
constraint-satisfying pseudorandom order for my shapes and noises,
calling one arrShape and populating it with 1's and 2's, and the other
arrNoise and populating it with 1's and 2's. I more or less already
have.

What I can't figure out: having specified that order, how do I assign
a shape to be 1, 2 and a noise to be 1,2, and where would I put the
order I generated to control the display of my shapes and noises?

If what I needed to do was select a random shape with a particular
characteristic on each trial, I would know how to do that with nested
lists. But that's not what I need. I need to select a shape randomly
from a list somewhere, designate it shape 1 (the same for sound 1,
shape 2, sound 2) and have that identity be consistent on each trial
through the block. I also have some constraints about which two
shapes get paired together, so I need to be able to place some limits
on the selection of the second shape. I need to generate the order
for the presentation of shape 1, sound 1, etc. (I already know how to
generate a constraint-satisfying pseudorandom order) , and use that
order to govern their presentation through the 16 trials. Then, those
shapes/sounds having been selected, I need them not to be used again
in subsequent blocks.

I am perfectly willing to code -- I just need some help with overall
approach, how to integrate code with the various E-Prime objects,
etc. I would understand how to do this if it were a programming task
in a regular language -- what I don't understand is how to integrate
it in with the prefab E-Prime objects.

I would appreciate any help.

David McFarlane

unread,
May 16, 2011, 3:07:20 PM5/16/11
to e-p...@googlegroups.com
Katie,

Stock reminder: 1) I do not work for PST. 2) PST's trained staff
takes any and all questions at
http://support.pstnet.com/e%2Dprime/support/login.asp , and they
strive to respond to all requests in 24-48 hours -- this is pretty
much their substitute for proper documentation, so make full use of
it. 3) If you do get an answer from PST Web Support, please extend
the courtesy of posting their reply back here for the sake of others.

That said, here is my take...

I couldn't follow all the details of your intricate account, but I
understand that you have already randomized some arrays as desired
and now just want to use those somehow in your program. So here are
a few general thoughts.

1) If you have a randomized array that indicates the order in which
to present levels (rows) of a List, then you can use an ExplicitOrder
object for the presentation order of the List -- see the
ExplicitOrder topic in the E-Basic Help facility (thanks go to Alison
Lauer at PST Web Support for showing me this).

2) If your randomized array contains actual stimulus information,
then you could use it in inline code to explicitly set attributes
that get used in your stimulus object. E.g., if ImageFiles contains
a randomized array of image file names for each trial, and iTrial
keeps track of the trial number, then you could use

c.SetAttribute "ImageFile", ImageFiles( iTrial )

and then use [ImageFile] as an attribute reference for the file name
in an ImageDisplay object.

3) Again, if your randomized array contains actual stimulus
information, then you could populate a List directly from inline code
and then run the List as an ordinary object in the program
structure. The "NoRepeats" examples available from PST provide some
example of how to do that (but beware, PST examples generally also
exhibit poor programming practices), or better, just set any List to
Load Method Script and then look at the generated E-Basic code to see
how it's done (note that List.AddAttrib does not appear in the List
topic of the E-Basic Help, but instead appears under FactorSpace.AddAttrib).

One style note, I am loathe to use inline code to modify a "main"
List (i.e., one that runs Procedures), because it leaves no clue to
the reader that the List they see in the structure is not the List
that will run at run-time. Instead, I prefer to modify a nested
List, which, the way I do it, leaves a "?" in place of the List,
thereby warning readers to look at the code to see what that List
will do. Just one of many ways in which my programming practices
depart from those of PST.

-- David McFarlane, Professional Faultfinder

Reply all
Reply to author
Forward
0 new messages