Investment task


Author
Message
tecnika
tecnika
Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)
Group: Forum Members
Posts: 156, Visits: 790
Hello,

In the attached investment task, a participant will have an initial amount of 1000£. For the first 10 trials (or days, "hold trials") they can just "hold" the share. From trial (or day) 11 to 40 they can choose ("choice trials") if sell it or hold it. If they sell the share the block will end and they will go to the next of the 9 blocks of the first part of the experiment. 
Once they finish the first part of the experiment, after a break they will start the second part of the experiment.

There will be 4 possible experiments, that corresponds to different couples of set of trials.
I have introduced an openended trial that I would like to use to start ExperimentA if the letter "a" is entered (that will run set A and then set B), ExperimentC if the letter "c" is entered (that will run set C and then set D), and so on.
The 4 possible couple of sets are: A-B, C-D, E-F, G-H.
Each part of experiment ("tdcs" or "control") corresponds to a set. Each part of the experiment consists of 3 blocks for each of the 3 conditions (=Flat, Loss, Gain), so each set (or part of the experiment = "tdcs" or "control") will run 9 blocks. 
Each block will run max40 trials (10 hold trials + >=1-30 choice trials).

The 9 blocks of the first part will be randomly selected within the first set (e.g., set A). Differently, I would like the 9 blocks of second part of the experiment to follow the same sequence of the first part (e.g.:
ExperimentA:
- Set A (t-dcs part):
      1. Loss_(block nr 3);
      2. Flat_(block nr 2);
      3. Gain_(block nr 2);
      4. Loss_(block nr 1);
      5. Gain_(block nr 3);
      6. Loss_(block nr 2);
      7. Flat_(block nr 3);
      8. Gain_(block nr 1);
      9. Flat_(block nr 1);
- Set B (control part): 
      1. Loss_(block nr 3);
      2. Flat_(block nr 2);
      3. Gain_(block nr 2);
      4. Loss_(block nr 1);
      5. Gain_(block nr 3);
      6. Loss_(block nr 2);
      7. Flat_(block nr 3);
      8. Gain_(block nr 1);
      9. Flat_(block nr 1);
)

The stimuli are in the Copy of StimulyProgram xlsx file. Do I need to copy all of them? I have just copied the first set and created the correspondent block for it, but it is not a very efficient way to do it.
Is there way to write just the same trials/block and upload different series of stimuli rather than create a different block script for block (E.g. Block_AFlat_1 for the block Flat_1 in the setA)?
Would it be then possible to save in the data in a format that save all the 40 items per block even if the block finishes at trial number 36 for example?

Any suggestion on how to do?



Attachments
Investment Task.iqx (783 views, 16.00 KB)
Copy of StimuliforProgram(1).xlsx (476 views, 26.00 KB)
Sell_ON.png (719 views, 4.00 KB)
Hold_OFF.png (704 views, 4.00 KB)
Hold_ON.png (724 views, 4.00 KB)
Sell_OFF.png (760 views, 4.00 KB)
Next_Stock.png (730 views, 5.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: 13K, Visits: 104K
> Is there way to write just the same trials/block and upload different series of stimuli rather than create a different block script for block

You can either
(1) Work with conditional <include> elements (which precludes the <openended> option though; you must either select the stimuli based on the entered subject or group number): Is there way to write just the same trials/block and upload different series of stimuli rather than create a different block script for block (E.g. Block_AFlat_1 for the block Flat_1 in the setA)?

or

(2) Do something like in the multi-Language-IAT script available at https://www.millisecond.com/download/library/IAT/ (direct link: https://www.millisecond.com/download/library/v4/IAT/MultilanguageIAT/IAT_Multilanguage.iqx ). Whether you select a language and administer different items as a consequence or, as in your case, a condition / set indicator and administer different items based on that amounts to the exact same thing.

> Would it be then possible to save in the data in a format that save all the 40 items per block even if the block finishes at trial number 36
> for example?

No, and I'm not clear why that would be necessary or desirable. Can you explain?



tecnika
tecnika
Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)
Group: Forum Members
Posts: 156, Visits: 790
Hi Dave,

Thank you for your reply.

About the result file this was an external request. I guess it would be to have matrix of the same size and analyse the file in Matlab. Just a guess tho.

Thank you for your help, I will let you know if I will be able to implement the IAT solution to my script.

Elena
tecnika
tecnika
Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)
Group: Forum Members
Posts: 156, Visits: 790
Hi Dave,

I don't understand how to assign the group number to each file.

For instance if I want that group A starts with Sets_AB how can I do?

Many thanks,

Elena
Attachments
Selection.iqx (741 views, 6.00 KB)
Set_AB.iqx (763 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: 13K, Visits: 104K
#1: If you want to work with the conditional <include> approach, it is advisable to keep the group id numeric (i.e., instead of "A", use 1, and so forth).
#2: If you have for sets A-B, C-D, E-F, and G-H, you need four <include> elements in the main script:

//1st condition: AB
<include>
/ precondition = [mod(script.groupid,4) == 1]
/ file="Set_AB.iqx"
</include>

//2nd condition: CD
<include>
/ precondition = [mod(script.groupid,4) == 2]
/ file="Set_CD.iqx"
</include>

//3rd condition: EF
<include>
/ precondition = [mod(script.groupid,4) == 3]
/ file="Set_EF.iqx"
</include>

//4th condition: GH
<include>
/ precondition = [mod(script.groupid,4) == 0]
/ file="Set_GH.iqx"
</include>

where Set_AB.iqx, Set_CD.iqx, etc. contain the things that are specific to the respective condition (e.g. different items).

In Inquisit Lab, you then simply enter the condition you wish to run in the group id corresponding to the set you wish to administer.

https://www.millisecond.com/forums/uploads/images/6509662d-db16-46cf-bcbf-4e85.jpg

On the web, you can either go for sequential group numbers, random group numbers or supply the condition via a URL query parameter. The logic in the above <include> elements' /precondition attributes works the same way condition assignment in <expt>s or <batch> elements works: http://www.millisecond.com/forums/Topic13856.aspx
tecnika
tecnika
Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)
Group: Forum Members
Posts: 156, Visits: 790
Thanks, Dave. That's help.

Another couple of queries, sorry...

1. For each set I have 9 blocks of 40 trials each. In total 18 blocks (multiplied by 4 couple of series).
At the moment, I have just done ONE block (A_Flat_1, that means series A, Flat condition, first block), and the script looks already quite long.
Many trials and items has A_Flat_1 as variable and if I copy them just replacing A_Flat_1 with the correspondent variable, the script will become huge.... 
How can I use the same script for different blocks? ... I hope there is a way..

2. How can I randomise the lists of item selected? For instance if I want to select randomly the item lists (e.g., A_Flat_3,  A_Flat_1, A_Gain_2, etc) and at the same time run sequentially the items in the condition selected (items 1,2,3...etc)?

Then, how can I follow the same order for the second set (e.g., B_Flat_3,  B_Flat_1, B_Gain_2) randomly selected in the previous set?

Many thanks,

Elena



Attachments
Set_AB.iqx (787 views, 15.00 KB)
tecnika
tecnika
Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)
Group: Forum Members
Posts: 156, Visits: 790
Hi Dave,

Still me. I managed to do points 1 and 2. Still one question remaining.

Then, how can I follow the same order for the second set (e.g., B_Flat_3,  B_Flat_1, B_Gain_2) randomly selected in the previous set?

Many thanks,

Elena
Attachments
Set_AB.iqx (805 views, 54.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: 13K, Visits: 104K
#1: Do *not* create condition-specifc blocks. You do not need them. With the conditional <include> elements, all you switch out are the things that are *different* for each condition / set, mainly the items. Take a look at this minimal example https://www.millisecond.com/forums/FindPost19046.aspx . Notice that the "main" script has all the trials and blocks in it. The only thing that gets included conditionally is a different set of items, here based on the subject number.

#2: You should consolidate all the items into a single <item> element. Then select the different sub-sets (A_Flat_1, etc.) based on their item numbers only. You encode those item numbers in <list>s. You set those lists to sequential selection, and -- at the start of a block -- chose one of the lists at random. Similarly, you record that random list order from the 1st part (e.g. A) in another list. You then use the latter list to reproduce the same order in the 2nd part (e.g. B).

<values>
/ selectedlist = 1
</values>

<expt>
/ blocks = [1-2 = pt1_block; 3-4 = pt2_block]
</expt>

//blocks
//part 1 (e.g. A)
<block pt1_block>
/ onblockbegin = [values.selectedlist = list.pt1_listorder.nextvalue;
    list.pt2_listorder.appenditem(list.pt1_listorder.currentvalue);]
/ trials = [1-4 = pt1_trial]
</block>

//part 2 (e.g. B)
<block pt2_block>
/ onblockbegin = [values.selectedlist = list.pt2_listorder.nextvalue;]
/ trials = [1-4 = pt2_trial]
</block>

//part 1 trial
<trial pt1_trial>
/ stimulusframes = [1=pt1]
/ validresponse = (57)
</trial>

//part 2 trial
<trial pt2_trial>
/ stimulusframes = [1=pt2]
/ validresponse = (57)
</trial>

<text pt1>
/ items = pt1_items
/ select = list.pt1_itemnumber.nextvalue
</text>

<text pt2>
/ items = pt2_items
/ select = list.pt2_itemnumber.nextvalue
</text>

<item pt1_items>
/ 1 = "A_Flat_1_Item_1"
/ 2 = "A_Flat_1_Item_2"
/ 3 = "A_Flat_1_Item_3"
/ 4 = "A_Flat_1_Item_4"

/ 5 = "A_Flat_2_Item_1"
/ 6 = "A_Flat_2_Item_2"
/ 7 = "A_Flat_2_Item_3"
/ 8 = "A_Flat_2_Item_4"
</item>

<item pt2_items>
/ 1 = "B_Flat_1_Item_1"
/ 2 = "B_Flat_1_Item_2"
/ 3 = "B_Flat_1_Item_3"
/ 4 = "B_Flat_1_Item_4"

/ 5 = "B_Flat_2_Item_1"
/ 6 = "B_Flat_2_Item_2"
/ 7 = "B_Flat_2_Item_3"
/ 8 = "B_Flat_2_Item_4"
</item>

//select a list at random for part 1
<list pt1_listorder>
/ items = (1,2)
/ selectionmode = random
/ replace = false
</list>

//records the random list order from part 1
//reproduces the same list order in part 2
//via sequential selection
<list pt2_listorder>
/ selectionmode = sequence
</list>

//returns the item # numbers for the selected list in the block
//part 1 (e.g. A)
<list pt1_itemnumber>
/ items = (list.flat_1.nextvalue, list.flat_2.nextvalue)
/ selectionmode = values.selectedlist
</list>

//returns the item # numbers for the selected list in the block
//part 1 (e.g. B)
<list pt2_itemnumber>
/ items = (list.flat_1.nextvalue, list.flat_2.nextvalue)
/ selectionmode = values.selectedlist
</list>

//flat 1 item #s are 1 to 4
<list flat_1>
/ items = (1,2,3,4)
/ selectionmode = sequence
</list>

//flat 2 item #s are 5 to 8
<list flat_2>
/ items = (5,6,7,8)
/ selectionmode = sequence
</list>


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: 13K, Visits: 104K
FYI, i was in the process of writing a reply to your previous post in this thread while you were submitting that update. The response https://www.millisecond.com/forums/FindPost19981.aspx tackles the various selection questions, including how to record the random order of (sub-)lists administered in the 1st part (e.g. A) and reproduce it in the 2nd part (e.g. B). If you code the "mechanics" (the selection logic, etc.) of the script abstractly, you then only need to flip out the few <item> elements via <include>.

tecnika
tecnika
Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)
Group: Forum Members
Posts: 156, Visits: 790
Thank you Dave, I finally got it right.
Your help is very very appreciated!

Elena

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search