Creating list or vector with numerical values & getting n-th element out of this list


Author
Message
Olga Kunina
Olga Kunina
Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)
Group: Forum Members
Posts: 4, Visits: 1

Hi everyone,


I am trying
to expand the source code for the IOWA-Gambling task available at the Inquisit
website. In this version the loss-values are selected randomly as follows:


 <expressions>


/ getlossdeck1
= noreplace(0, 0, 0, 0, 0, 150, 200, 250, 300, 350) 


</expressions>


By contrast,
I want to define a fixed sequence of loss values for loss values for each trail.
I want to choose the current value depending on how many cards were already
taken from the deck. Speaking more technically - I want to get the nth element
out of an array, vector or list with numerical values.


Therefore I
am trying to define something like a list or a vector with loss values (integer
values) for each trail.


 / loss_deck1
= (0, 0, 0, 0, 0, 150, 200, 250, 300, 350) 


 Since that
did not work I have defined a counter


 <counter
deck1_loss>


/ items = (0,
0, 0, 0, 0, 150, 200, 250, 300, 350)


/ select = sequence(1-10)


</counter>


 Additionally,
I have introduced a variable "values.cards_deck1" that counts how
often deck1 was chosen. This counter is updated in each trial.


In the last
step I try to define the loss value for the current trial as:


/ getlossdeck1
= getitem(counter.deck1_loss.items, values.cards_deck1)


But each
time I get the error message "Expression is not valid. Item not found".


Does
someone have an idea whether it is possible to create a list or vector with
numerical values & get back a specific element out of this list?


Thanks a
lot for your help in advance.


Best regards, 


Olga Kunina


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Olga Kunina - 15 Years Ago
Dave - 15 Years Ago
Olga Kunina - 15 Years Ago
Dave - 15 Years Ago
Dave - 15 Years Ago
                         Dear Dave,
thank you so much for your help. That is indeed a...
Olga Kunina - 15 Years Ago
                             [quote]Can you tell me how one would have to define "counter.deck",...
Dave - 15 Years Ago
                                 Dear Dave,
thanks for these examples and your answers. They were...
Olga Kunina - 15 Years Ago
                                     You're welcome. BTW, if you're into risk-taking card tasks, definitely...
Dave - 15 Years Ago
fasteddie9141 - 10 Years Ago
Dave - 10 Years Ago
fasteddie9141 - 10 Years Ago
             No problem. Let me know how it goes!
Dave - 10 Years Ago

Reading This Topic

Explore
Messages
Mentions
Search