Embedded expressions within complicated counters


Embedded expressions within complicated counters

Author
Message
psych101
psych101
Respected Member
Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)

Group: Forum Members
Posts: 14, Visits: 73
Hello,

I want to create multiple counters, with embedded expressions within them.  I'm not quite sure where to start with getting the code to work, so any suggestions would be greatly appreciated. 

I'm not sure how to use expressions within counters. Specifically, I want participants to have a total of 80 trials, each trial will have two choices to choose from: choice A and choice B. Each choice has three different numbers called distributions, listed as the maximum, middle, and minimum in that order. Only one of the two options will be manipulated with the expressions "options" below, and the other choice will just have the original distribution values. 

There are four different original distributions, each with three numbers. However, these three numbers will always be present together in a line (hence me naming it distrib#_all to keep them together. I listed them separately because I thought that would be better for the expression manipulation listed below:

Note that distrib1_# refers to the distribution option (1) and then the order it is presented in a line (1st, 2nd, 3rd). 

<values>
/ distrib1_1 = 1000
/ distrib1_2 = 200
/ distrib1_3 = 100
/ distrib1_all = 1000    200    1000

/ distrib2_1 = 1000
/ distrib2_2 = 800
/ distrib2_3 = 100
/ distrib2_all = 1000    800   100

/ distrib3_1 = 1000
/ distrib3_2 = 500
/ distrib3_3 = 400
/ distrib3_all = 1000   500   400

/ distrib4_1 = 600
/ distrib4_2 = 500
/ distrib4_3 = 400
/ distrib4_all = 600   500   4000
</values>

There are five different manipulation options for the three values contained in the choice, listed below. 
                 Max              middle                     min
Option1:    max/.75       middle                      min+(max/.75)
Option2:    max/.50        middle+(max/.25)   min+(max/.25)
Option3: max+.5(min)   middle+.5(min)      0
Option4:  avg.                avg.                      avg.
Option5:  max                middle                  min

I am wondering if there is a way for me to streamline the expressions into the counter? I wrote the following code, which obviously doesn't work. My intention would be for Inquisit to use different distribution values when I indicate "%". Does Inquisit have any tools to handle what I am looking to do?

<expressions options>
/ option1 = values.distrib%_1/0.75, values.distrib%_2, values.distrib%_3 + (values.distrib%_1/0.75)
/ option2 = values.distrib%_1/0.50, values.distrib%_2 +(values.distrib%_1/0.25), values.distrib%_3 + (values.distrib%_1/0.25)
/ option3 = values.distrib%_1 + .5(*values.distrib%_3), values.distrib%_2 + (0.5*values.distrib%_3), values.distrib%_3 *0
/ option4 = (values.distrib%_1 + values.distrib%_2 + values.distrib%_3/3), (values.distrib%_1 + values.distrib%_2 + values.distrib%_3/3), (values.distrib%_1 + values.distrib%_2 + values.distrib%_3/3)
/ option5 = values.distrib%_1, values.distrib%_2, values.distrib%_3
</expressions>

We also want to have one of the four interest conditions for each trial, which are text indicating:
1. You are none
2. you are max
3. you are middle
4. you are min

<item potentialSelfInterests>
/1 = "You are none"
/2 = "You are max"
/3 = "You are middle"
/4 = "You are min"
</item>


In summary, each trial will have the following:
1.  one random distribution values (out of 4)
2. randomly selected option manipulations (out of 5)
3. one random interest condition.

I need to create a counter that includes all 1-3 per trial. Could you please help provide suggestions on how to go about this?



Dave
Dave
Supreme Being
Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)

Group: Administrators
Posts: 9.9K, Visits: 49K
psych101 - 7/11/2019
Hello,

I want to create multiple counters, with embedded expressions within them.  I'm not quite sure where to start with getting the code to work, so any suggestions would be greatly appreciated. 

I'm not sure how to use expressions within counters. Specifically, I want participants to have a total of 80 trials, each trial will have two choices to choose from: choice A and choice B. Each choice has three different numbers called distributions, listed as the maximum, middle, and minimum in that order. Only one of the two options will be manipulated with the expressions "options" below, and the other choice will just have the original distribution values. 

There are four different original distributions, each with three numbers. However, these three numbers will always be present together in a line (hence me naming it distrib#_all to keep them together. I listed them separately because I thought that would be better for the expression manipulation listed below:

Note that distrib1_# refers to the distribution option (1) and then the order it is presented in a line (1st, 2nd, 3rd). 

<values>
/ distrib1_1 = 1000
/ distrib1_2 = 200
/ distrib1_3 = 100
/ distrib1_all = 1000    200    1000

/ distrib2_1 = 1000
/ distrib2_2 = 800
/ distrib2_3 = 100
/ distrib2_all = 1000    800   100

/ distrib3_1 = 1000
/ distrib3_2 = 500
/ distrib3_3 = 400
/ distrib3_all = 1000   500   400

/ distrib4_1 = 600
/ distrib4_2 = 500
/ distrib4_3 = 400
/ distrib4_all = 600   500   4000
</values>

There are five different manipulation options for the three values contained in the choice, listed below. 
                 Max              middle                     min
Option1:    max/.75       middle                      min+(max/.75)
Option2:    max/.50        middle+(max/.25)   min+(max/.25)
Option3: max+.5(min)   middle+.5(min)      0
Option4:  avg.                avg.                      avg.
Option5:  max                middle                  min

I am wondering if there is a way for me to streamline the expressions into the counter? I wrote the following code, which obviously doesn't work. My intention would be for Inquisit to use different distribution values when I indicate "%". Does Inquisit have any tools to handle what I am looking to do?

<expressions options>
/ option1 = values.distrib%_1/0.75, values.distrib%_2, values.distrib%_3 + (values.distrib%_1/0.75)
/ option2 = values.distrib%_1/0.50, values.distrib%_2 +(values.distrib%_1/0.25), values.distrib%_3 + (values.distrib%_1/0.25)
/ option3 = values.distrib%_1 + .5(*values.distrib%_3), values.distrib%_2 + (0.5*values.distrib%_3), values.distrib%_3 *0
/ option4 = (values.distrib%_1 + values.distrib%_2 + values.distrib%_3/3), (values.distrib%_1 + values.distrib%_2 + values.distrib%_3/3), (values.distrib%_1 + values.distrib%_2 + values.distrib%_3/3)
/ option5 = values.distrib%_1, values.distrib%_2, values.distrib%_3
</expressions>

We also want to have one of the four interest conditions for each trial, which are text indicating:
1. You are none
2. you are max
3. you are middle
4. you are min

<item potentialSelfInterests>
/1 = "You are none"
/2 = "You are max"
/3 = "You are middle"
/4 = "You are min"
</item>


In summary, each trial will have the following:
1.  one random distribution values (out of 4)
2. randomly selected option manipulations (out of 5)
3. one random interest condition.

I need to create a counter that includes all 1-3 per trial. Could you please help provide suggestions on how to go about this?



You mention one or several <counter> elements, but the code you provided does not seem to include any counters. It's unclear to me why or how you would use a counter and what exactly for.
(As a tangent: You should not be using <counter> elements at all under Inquisit 5; they are superseded by the more versatile <list> elements).

Please be so kind a provide a stripped down, runable example of what you want your task to look like. I'm unable to infer that from the partial description and the isolated code snippets you posted.

As for

> My intention would be for Inquisit to use different distribution values when I indicate "%". Does Inquisit have any tools to handle what I am looking to do?

the answer is no, it won't work that way. You'll want to copy the values of whatever distribution you've chosen for a given trial in some generic values, and your expressions can then operate on those. Perhaps there is a better way, but I would need you to give me a clearer picture of what exactly you want to do first.

Dave
Dave
Supreme Being
Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)

Group: Administrators
Posts: 9.9K, Visits: 49K
Dave - 7/11/2019
psych101 - 7/11/2019
Hello,

I want to create multiple counters, with embedded expressions within them.  I'm not quite sure where to start with getting the code to work, so any suggestions would be greatly appreciated. 

I'm not sure how to use expressions within counters. Specifically, I want participants to have a total of 80 trials, each trial will have two choices to choose from: choice A and choice B. Each choice has three different numbers called distributions, listed as the maximum, middle, and minimum in that order. Only one of the two options will be manipulated with the expressions "options" below, and the other choice will just have the original distribution values. 

There are four different original distributions, each with three numbers. However, these three numbers will always be present together in a line (hence me naming it distrib#_all to keep them together. I listed them separately because I thought that would be better for the expression manipulation listed below:

Note that distrib1_# refers to the distribution option (1) and then the order it is presented in a line (1st, 2nd, 3rd). 

<values>
/ distrib1_1 = 1000
/ distrib1_2 = 200
/ distrib1_3 = 100
/ distrib1_all = 1000    200    1000

/ distrib2_1 = 1000
/ distrib2_2 = 800
/ distrib2_3 = 100
/ distrib2_all = 1000    800   100

/ distrib3_1 = 1000
/ distrib3_2 = 500
/ distrib3_3 = 400
/ distrib3_all = 1000   500   400

/ distrib4_1 = 600
/ distrib4_2 = 500
/ distrib4_3 = 400
/ distrib4_all = 600   500   4000
</values>

There are five different manipulation options for the three values contained in the choice, listed below. 
                 Max              middle                     min
Option1:    max/.75       middle                      min+(max/.75)
Option2:    max/.50        middle+(max/.25)   min+(max/.25)
Option3: max+.5(min)   middle+.5(min)      0
Option4:  avg.                avg.                      avg.
Option5:  max                middle                  min

I am wondering if there is a way for me to streamline the expressions into the counter? I wrote the following code, which obviously doesn't work. My intention would be for Inquisit to use different distribution values when I indicate "%". Does Inquisit have any tools to handle what I am looking to do?

<expressions options>
/ option1 = values.distrib%_1/0.75, values.distrib%_2, values.distrib%_3 + (values.distrib%_1/0.75)
/ option2 = values.distrib%_1/0.50, values.distrib%_2 +(values.distrib%_1/0.25), values.distrib%_3 + (values.distrib%_1/0.25)
/ option3 = values.distrib%_1 + .5(*values.distrib%_3), values.distrib%_2 + (0.5*values.distrib%_3), values.distrib%_3 *0
/ option4 = (values.distrib%_1 + values.distrib%_2 + values.distrib%_3/3), (values.distrib%_1 + values.distrib%_2 + values.distrib%_3/3), (values.distrib%_1 + values.distrib%_2 + values.distrib%_3/3)
/ option5 = values.distrib%_1, values.distrib%_2, values.distrib%_3
</expressions>

We also want to have one of the four interest conditions for each trial, which are text indicating:
1. You are none
2. you are max
3. you are middle
4. you are min

<item potentialSelfInterests>
/1 = "You are none"
/2 = "You are max"
/3 = "You are middle"
/4 = "You are min"
</item>


In summary, each trial will have the following:
1.  one random distribution values (out of 4)
2. randomly selected option manipulations (out of 5)
3. one random interest condition.

I need to create a counter that includes all 1-3 per trial. Could you please help provide suggestions on how to go about this?



You mention one or several <counter> elements, but the code you provided does not seem to include any counters. It's unclear to me why or how you would use a counter and what exactly for.
(As a tangent: You should not be using <counter> elements at all under Inquisit 5; they are superseded by the more versatile <list> elements).

Please be so kind a provide a stripped down, runable example of what you want your task to look like. I'm unable to infer that from the partial description and the isolated code snippets you posted.

As for

> My intention would be for Inquisit to use different distribution values when I indicate "%". Does Inquisit have any tools to handle what I am looking to do?

the answer is no, it won't work that way. You'll want to copy the values of whatever distribution you've chosen for a given trial in some generic values, and your expressions can then operate on those. Perhaps there is a better way, but I would need you to give me a clearer picture of what exactly you want to do first.

To start with at least a partial response based on what you've outlined, I would frame the selection of distributions and manipulation options like so:

<values>
/ dist_a = 1
/ manip_a = 1
/ max_a = 0
/ mid_a = 0
/ min_a = 0
</values>

// we have 4 distributions to select from
<list distributions>
/ items = (1,2,3,4)
</list>

// we have 5 manipulation options to select from
<list manipulations>
/ items = (1,2,3,4,5)
</list>

// original (unmanipulated) max values for distributions 1 to 4 (left to right)
<list max>
/ items = (1000, 1000, 1000, 600)
/ select = values.dist_a
</list>


// original (unmanipulated) mid values for distributions 1 to 4 (left to right)
<list mid>
/ items = (200, 800, 500, 500)
/ select = values.dist_a
</list>


// original (unmanipulated) min values for distributions 1 to 4 (left to right)
<list min>
/ items = (100, 100, 400, 400)
/ select = values.dist_a
</list>

// expression applies the selected manipulation to the original values of the chosen distribution
<expressions options>
/ apply_manipulation = if (values.manip_a == 1) {
values.max_a = list.max.nextvalue/0.75;
values.mid_a = list.mid.nextvalue;
values.min_a = list.min.nextvalue + (list.max.nextvalue/0.75);
} else if (values.manip_a == 2) {
values.max_a = list.max.nextvalue/0.50;
values.mid_a = list.mid.nextvalue + (list.max.nextvalue/0.25);
values.min_a = list.min.nextvalue + (list.max.nextvalue/0.25);
} else if (values.manip_a == 3) {
values.max_a = list.max.nextvalue + (0.50 * list.min.nextvalue);
values.mid_a = list.mid.nextvalue + (0.50 * list.min.nextvalue);
values.min_a = 0 * list.min.nextvalue;
} else if (values.manip_a == 4) {
values.max_a = (list.max.nextvalue + list.mid.nextvalue + list.min.nextvalue)/3;
values.mid_a = (list.max.nextvalue + list.mid.nextvalue + list.min.nextvalue)/3;
values.min_a = (list.max.nextvalue + list.mid.nextvalue + list.min.nextvalue)/3;
} else if (values.manip_a == 5) {
values.max_a = list.max.nextvalue;
values.mid_a = list.mid.nextvalue;
values.min_a = list.min.nextvalue;
};
</expressions>

// select a random distribution number at the start of each trial
// select a random manipulation option at the start of each trial
// apply chosen manipulation to the distribution values
<trial exampletrial>
/ ontrialbegin = [
list.distributions.reset();
list.manipulations.reset();
values.dist_a = list.distributions.nextvalue;
values.manip_a = list.manipulations.nextvalue;
expressions.apply_manipulation;
]
/ stimulusframes = [1=distribution_a, debug]
/ validresponse = (57)
</trial>

<text debug>
/ items = ("Selected Distribution #<%values.dist_a%> | Selected Manipulation #<%values.manip_a%>")
/ position = (50%, 10%)
</text>

<text distribution_a>
/ items = ("Max: <%values.max_a%>, Mid: <%values.mid_a%>, Min: <%values.min_a%>")
</text>

<block exampleblock>
/ trials = [1-10 = exampletrial]
</block>





psych101
psych101
Respected Member
Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)

Group: Forum Members
Posts: 14, Visits: 73
Hi Dave,

Thank you very much for your help -- it is greatly appreciated. 

Option A and Option B - presentation side by side:
I have made edits to the code to include option B (which should be one of the original distributions, randomly selected regardless of the option A manipulated numbers) on the screen at the same time. However, the block code is not allowing me to show both options at once. Could you please help with this issue? I can combine the trials for a block, but am uncertain about how to go about this with both options because I want them to each be a separate trial (they are being reset differently).

I also don't believe that I should restart values for max_orig mid_orig and min_orig at 0, since they are essentially pasted from the original distributions. However, I want to reset them at the beginning of the trial and therefore am uncertain of how to do this without setting them as a value equal to 0.Dropdown questions to be presented every trial
I have also added a total of six dropdown questions that should appear on the screen below the two options. From my understanding, I can use dropdown questions by creating a survey element and then the survey page. How do I get around this in order to present the questions and stimuli all on the same screen, for the full 80 trials? Currently, the code I have does not do this.

New, randomized self-interest condition 
I added the self-interest conditions indicating the participant's role (You are none, you are max, you are middle, you are min). How do I make sure that this is randomized, independent of the other randomized variables (distribution, manipulation, etc)?

I tried to list it using the <%> text presented to the participant, but understandable since it's not a value, but a text character, it is not showing up. How can I fix this?

Total randomized trial iterations
In addition, I want to ensure that a total of 80 trials with all possible combinations are presented for the experiment (4 distributions,  5 manipulations, 4 self-interest conditions = 80 trials). How do I go about this?

I would greatly appreciate your help. Here is the code below, with the bolded areas of particular interest/concern.

<values>
/ dist_a = 1
/ manip_a = 1
/ max_a = 0
/ mid_a = 0
/ min_a = 0

/ dist_orig = 1
/ max_orig = 0
/ mid_orig = 0
/ min_orig = 0

</values>

// we have 4 distributions to select from
<list distributions>
/ items = (1,2,3,4)
</list>

// we have 5 manipulation options to select from
<list manipulations>
/ items = (1,2,3,4,5)
</list>

// we have 4 self-interest conditions
<list potentialSelfInterests>
/ items = (1,2,3,4)
</list>

<item potentialSelfInterests>
/1 = "You are none"
/2 = "You are max"
/3 = "You are middle"
/4 = "You are min"
</item>

<text potentialSelfInterests>
/ items = potentialSelfInterests
</text>

// original (unmanipulated) max values for distributions 1 to 4 (left to right)
<list max>
/ items = (1000, 1000, 1000, 600)
/ select = values.dist_a
</list>

// original (unmanipulated) mid values for distributions 1 to 4 (left to right)
<list mid>
/ items = (200, 800, 500, 500)
/ select = values.dist_a
</list>

// original (unmanipulated) min values for distributions 1 to 4 (left to right)
<list min>
/ items = (100, 100, 400, 400)
/ select = values.dist_a
</list>


/// original (only for use for second option)

<list max_orig>
/ items = (1000, 1000, 1000, 600)
/ select = values.dist_orig
</list>

<list mid_orig>
/ items = (200, 800, 500, 500)
/ select = values.dist_orig
</list>

<list min_orig>
/ items = (100, 100, 400, 400)
/ select = values.dist_orig
</list>

// expression applies the selected manipulation to the original values of the chosen distribution
<expressions options>
/ apply_manipulation = if (values.manip_a == 1) {
values.max_a = list.max.nextvalue/0.75;
values.mid_a = list.mid.nextvalue;
values.min_a = list.min.nextvalue + (list.max.nextvalue/0.75);
} else if (values.manip_a == 2) {
values.max_a = list.max.nextvalue/0.50;
values.mid_a = list.mid.nextvalue + (list.max.nextvalue/0.25);
values.min_a = list.min.nextvalue + (list.max.nextvalue/0.25);
} else if (values.manip_a == 3) {
values.max_a = list.max.nextvalue + (0.50 * list.min.nextvalue);
values.mid_a = list.mid.nextvalue + (0.50 * list.min.nextvalue);
values.min_a = 0 * list.min.nextvalue;
} else if (values.manip_a == 4) {
values.max_a = (list.max.nextvalue + list.mid.nextvalue + list.min.nextvalue)/3;
values.mid_a = (list.max.nextvalue + list.mid.nextvalue + list.min.nextvalue)/3;
values.min_a = (list.max.nextvalue + list.mid.nextvalue + list.min.nextvalue)/3;
} else if (values.manip_a == 5) {
values.max_a = list.max.nextvalue;
values.mid_a = list.mid.nextvalue;
values.min_a = list.min.nextvalue;
};
</expressions>


// select a random distribution number at the start of each trial
// select a random manipulation option at the start of each trial
// apply chosen manipulation to the distribution values

<trial exampletrial>
/ ontrialbegin = [
list.distributions.reset();
list.manipulations.reset();
list.potentialSelfInterests.reset();
values.dist_a = list.distributions.nextvalue;
values.manip_a = list.manipulations.nextvalue;
expressions.apply_manipulation;
]
/ stimulusframes = [1=distribution_a, debug]
/ validresponse = (57)
</trial>

<trial exampletrial_originals>
/ ontrialbegin = [
list.distributions.reset();
values.dist_orig = list.distributions.nextvalue;
]
/ stimulusframes = [1= distribution_a, debug, distribution_original, debug_original]
/ validresponse = (57)
</trial>


<text debug>
/ items = ("Selected Distribution #<%values.dist_a%> | Selected Manipulation #<%values.manip_a%> | Role: <%item.potentialSelfInterests%>")
/ position = (50%, 10%)
</text>

<text debug_original>
/ items = ("Selected Distribution Option B #<%values.dist_orig%>")
/ position = (50%, 20%)
</text>

<text distribution_a>
/ items = ("Max Option A: <%values.max_a%>, Mid: <%values.mid_a%>, Min: <%values.min_a%>")
/ position = (30%, 40%)
</text>

<text distribution_original>
/ items = ("Max Option B Original: <%values.max_orig%>, Mid: <%values.mid_orig%>, Min: <%values.min_orig%>")
/ position = (40%,50%)
</text>


<dropdown Q1_a >
/ caption = "What category is optionA?"
/ options = ("self-interest", "compassion", "envy", "fairness")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ validresponse = ("self-interest", "compassion", "envy", "fairness")
/ position = (30%, 80%)
</dropdown>

<dropdown Q2_a >
/ caption = "Is optionA potentially something else?"
/ options = ("NA", "self-interest", "compassion", "envy", "fairness")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ validresponse = ("NA", "self-interest", "compassion", "envy", "fairness")
/ position = (30%, 85%)
</dropdown>

<dropdown Q3_a >
/ caption = "OptionA is a great, clear example of your first choice category"
/ options = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ optionvalues = ("1", "2", "3", "4", "5")
/ required = true
/ validresponse = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ position = (30%,90%)
</dropdown>

<dropdown Q1_b >
/ caption = "What category is optionB?"
/ options = ("self-interest", "compassion", "envy", "fairness")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ validresponse = ("self-interest", "compassion", "envy", "fairness")
</dropdown>

<dropdown Q2_b >
/ caption = "Is optionB potentially something else?"
/ options = ("NA", "self-interest", "compassion", "envy", "fairness")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ validresponse = ("NA", "self-interest", "compassion", "envy", "fairness")
</dropdown>

<dropdown Q3_b >
/ caption = "OptionB is a great, clear example of your first choice category"
/ options = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ optionvalues = ("1", "2", "3", "4", "5")
/ required = true
/ validresponse = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
</dropdown>

<list dropdownQuestions>
/ items = (dropdown.Q1_a, dropdown.Q2_a, dropdown.Q3_a, dropdown.Q1_b, dropdown.Q2_b, dropdown.Q3_b)
</list>

<block exampleblock>
/ trials = [1-60 = replace(exampletrial,exampletrial_originals), list.dropdownQuestions]
</block>


Dave
Dave
Supreme Being
Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)

Group: Administrators
Posts: 9.9K, Visits: 49K
psych101 - 7/16/2019
Hi Dave,

Thank you very much for your help -- it is greatly appreciated. 

Option A and Option B - presentation side by side:
I have made edits to the code to include option B (which should be one of the original distributions, randomly selected regardless of the option A manipulated numbers) on the screen at the same time. However, the block code is not allowing me to show both options at once. Could you please help with this issue? I can combine the trials for a block, but am uncertain about how to go about this with both options because I want them to each be a separate trial (they are being reset differently).

I also don't believe that I should restart values for max_orig mid_orig and min_orig at 0, since they are essentially pasted from the original distributions. However, I want to reset them at the beginning of the trial and therefore am uncertain of how to do this without setting them as a value equal to 0.Dropdown questions to be presented every trial
I have also added a total of six dropdown questions that should appear on the screen below the two options. From my understanding, I can use dropdown questions by creating a survey element and then the survey page. How do I get around this in order to present the questions and stimuli all on the same screen, for the full 80 trials? Currently, the code I have does not do this.

New, randomized self-interest condition 
I added the self-interest conditions indicating the participant's role (You are none, you are max, you are middle, you are min). How do I make sure that this is randomized, independent of the other randomized variables (distribution, manipulation, etc)?

I tried to list it using the <%> text presented to the participant, but understandable since it's not a value, but a text character, it is not showing up. How can I fix this?

Total randomized trial iterations
In addition, I want to ensure that a total of 80 trials with all possible combinations are presented for the experiment (4 distributions,  5 manipulations, 4 self-interest conditions = 80 trials). How do I go about this?

I would greatly appreciate your help. Here is the code below, with the bolded areas of particular interest/concern.

<values>
/ dist_a = 1
/ manip_a = 1
/ max_a = 0
/ mid_a = 0
/ min_a = 0

/ dist_orig = 1
/ max_orig = 0
/ mid_orig = 0
/ min_orig = 0

</values>

// we have 4 distributions to select from
<list distributions>
/ items = (1,2,3,4)
</list>

// we have 5 manipulation options to select from
<list manipulations>
/ items = (1,2,3,4,5)
</list>

// we have 4 self-interest conditions
<list potentialSelfInterests>
/ items = (1,2,3,4)
</list>

<item potentialSelfInterests>
/1 = "You are none"
/2 = "You are max"
/3 = "You are middle"
/4 = "You are min"
</item>

<text potentialSelfInterests>
/ items = potentialSelfInterests
</text>

// original (unmanipulated) max values for distributions 1 to 4 (left to right)
<list max>
/ items = (1000, 1000, 1000, 600)
/ select = values.dist_a
</list>

// original (unmanipulated) mid values for distributions 1 to 4 (left to right)
<list mid>
/ items = (200, 800, 500, 500)
/ select = values.dist_a
</list>

// original (unmanipulated) min values for distributions 1 to 4 (left to right)
<list min>
/ items = (100, 100, 400, 400)
/ select = values.dist_a
</list>


/// original (only for use for second option)

<list max_orig>
/ items = (1000, 1000, 1000, 600)
/ select = values.dist_orig
</list>

<list mid_orig>
/ items = (200, 800, 500, 500)
/ select = values.dist_orig
</list>

<list min_orig>
/ items = (100, 100, 400, 400)
/ select = values.dist_orig
</list>

// expression applies the selected manipulation to the original values of the chosen distribution
<expressions options>
/ apply_manipulation = if (values.manip_a == 1) {
values.max_a = list.max.nextvalue/0.75;
values.mid_a = list.mid.nextvalue;
values.min_a = list.min.nextvalue + (list.max.nextvalue/0.75);
} else if (values.manip_a == 2) {
values.max_a = list.max.nextvalue/0.50;
values.mid_a = list.mid.nextvalue + (list.max.nextvalue/0.25);
values.min_a = list.min.nextvalue + (list.max.nextvalue/0.25);
} else if (values.manip_a == 3) {
values.max_a = list.max.nextvalue + (0.50 * list.min.nextvalue);
values.mid_a = list.mid.nextvalue + (0.50 * list.min.nextvalue);
values.min_a = 0 * list.min.nextvalue;
} else if (values.manip_a == 4) {
values.max_a = (list.max.nextvalue + list.mid.nextvalue + list.min.nextvalue)/3;
values.mid_a = (list.max.nextvalue + list.mid.nextvalue + list.min.nextvalue)/3;
values.min_a = (list.max.nextvalue + list.mid.nextvalue + list.min.nextvalue)/3;
} else if (values.manip_a == 5) {
values.max_a = list.max.nextvalue;
values.mid_a = list.mid.nextvalue;
values.min_a = list.min.nextvalue;
};
</expressions>


// select a random distribution number at the start of each trial
// select a random manipulation option at the start of each trial
// apply chosen manipulation to the distribution values

<trial exampletrial>
/ ontrialbegin = [
list.distributions.reset();
list.manipulations.reset();
list.potentialSelfInterests.reset();
values.dist_a = list.distributions.nextvalue;
values.manip_a = list.manipulations.nextvalue;
expressions.apply_manipulation;
]
/ stimulusframes = [1=distribution_a, debug]
/ validresponse = (57)
</trial>

<trial exampletrial_originals>
/ ontrialbegin = [
list.distributions.reset();
values.dist_orig = list.distributions.nextvalue;
]
/ stimulusframes = [1= distribution_a, debug, distribution_original, debug_original]
/ validresponse = (57)
</trial>


<text debug>
/ items = ("Selected Distribution #<%values.dist_a%> | Selected Manipulation #<%values.manip_a%> | Role: <%item.potentialSelfInterests%>")
/ position = (50%, 10%)
</text>

<text debug_original>
/ items = ("Selected Distribution Option B #<%values.dist_orig%>")
/ position = (50%, 20%)
</text>

<text distribution_a>
/ items = ("Max Option A: <%values.max_a%>, Mid: <%values.mid_a%>, Min: <%values.min_a%>")
/ position = (30%, 40%)
</text>

<text distribution_original>
/ items = ("Max Option B Original: <%values.max_orig%>, Mid: <%values.mid_orig%>, Min: <%values.min_orig%>")
/ position = (40%,50%)
</text>


<dropdown Q1_a >
/ caption = "What category is optionA?"
/ options = ("self-interest", "compassion", "envy", "fairness")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ validresponse = ("self-interest", "compassion", "envy", "fairness")
/ position = (30%, 80%)
</dropdown>

<dropdown Q2_a >
/ caption = "Is optionA potentially something else?"
/ options = ("NA", "self-interest", "compassion", "envy", "fairness")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ validresponse = ("NA", "self-interest", "compassion", "envy", "fairness")
/ position = (30%, 85%)
</dropdown>

<dropdown Q3_a >
/ caption = "OptionA is a great, clear example of your first choice category"
/ options = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ optionvalues = ("1", "2", "3", "4", "5")
/ required = true
/ validresponse = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ position = (30%,90%)
</dropdown>

<dropdown Q1_b >
/ caption = "What category is optionB?"
/ options = ("self-interest", "compassion", "envy", "fairness")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ validresponse = ("self-interest", "compassion", "envy", "fairness")
</dropdown>

<dropdown Q2_b >
/ caption = "Is optionB potentially something else?"
/ options = ("NA", "self-interest", "compassion", "envy", "fairness")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ validresponse = ("NA", "self-interest", "compassion", "envy", "fairness")
</dropdown>

<dropdown Q3_b >
/ caption = "OptionB is a great, clear example of your first choice category"
/ options = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ optionvalues = ("1", "2", "3", "4", "5")
/ required = true
/ validresponse = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
</dropdown>

<list dropdownQuestions>
/ items = (dropdown.Q1_a, dropdown.Q2_a, dropdown.Q3_a, dropdown.Q1_b, dropdown.Q2_b, dropdown.Q3_b)
</list>

<block exampleblock>
/ trials = [1-60 = replace(exampletrial,exampletrial_originals), list.dropdownQuestions]
</block>


> I have made edits to the code to include option B (which should be one of the original distributions, randomly selected regardless of the option A manipulated numbers)
> on the screen at the same time. However, the block code is not allowing me to show both options at once

You need a single trial element, not two, and you need to add <text> etc. elements for option B and display those stimuli per the existing trial's /stimulusframes or -times.

> I also don't believe that I should restart values for max_orig mid_orig and min_orig at 0, since they are essentially pasted from the original distributions. However, I want to reset them at the beginning of the trial and therefore am uncertain of how to do this without setting them as a value equal to 0

I don't understand what you mean here.

> I have also added a total of six dropdown questions that should appear on the screen below the two options. From my understanding, I can use dropdown questions by creating a survey element and then the survey page.

No. A <surveypage> is a special kind of <trial> element. If you want dropdowns displayed with your two distributions (A and B), you need to set up a single <surveypage> with the <text> elements or <caption>s for the distribution options and the six dropdowns. Then run that surveypage via your <block>'s /trials attribute, just like any regular trial.

> I added the self-interest conditions indicating the participant's role (You are none, you are max, you are middle, you are min). How do I make sure that this is randomized, independent of the other randomized variables (distribution, manipulation, etc)?

In the same way the other, already existing things (distributions, manipulations) are randomized? I don't understand what the actual question is here.

> In addition, I want to ensure that a total of 80 trials with all possible combinations are presented for the experiment (4 distributions,  5 manipulations, 4 self-interest conditions = 80 trials). How do I go about this?

You need to encode the combinations you want using the three <list> elements and then you need to pair those lists. See e.g. https://www.millisecond.com/forums/FindPost18268.aspx

Dave
Dave
Supreme Being
Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)

Group: Administrators
Posts: 9.9K, Visits: 49K
Dave - 7/16/2019
psych101 - 7/16/2019
Hi Dave,

Thank you very much for your help -- it is greatly appreciated. 

Option A and Option B - presentation side by side:
I have made edits to the code to include option B (which should be one of the original distributions, randomly selected regardless of the option A manipulated numbers) on the screen at the same time. However, the block code is not allowing me to show both options at once. Could you please help with this issue? I can combine the trials for a block, but am uncertain about how to go about this with both options because I want them to each be a separate trial (they are being reset differently).

I also don't believe that I should restart values for max_orig mid_orig and min_orig at 0, since they are essentially pasted from the original distributions. However, I want to reset them at the beginning of the trial and therefore am uncertain of how to do this without setting them as a value equal to 0.Dropdown questions to be presented every trial
I have also added a total of six dropdown questions that should appear on the screen below the two options. From my understanding, I can use dropdown questions by creating a survey element and then the survey page. How do I get around this in order to present the questions and stimuli all on the same screen, for the full 80 trials? Currently, the code I have does not do this.

New, randomized self-interest condition 
I added the self-interest conditions indicating the participant's role (You are none, you are max, you are middle, you are min). How do I make sure that this is randomized, independent of the other randomized variables (distribution, manipulation, etc)?

I tried to list it using the <%> text presented to the participant, but understandable since it's not a value, but a text character, it is not showing up. How can I fix this?

Total randomized trial iterations
In addition, I want to ensure that a total of 80 trials with all possible combinations are presented for the experiment (4 distributions,  5 manipulations, 4 self-interest conditions = 80 trials). How do I go about this?

I would greatly appreciate your help. Here is the code below, with the bolded areas of particular interest/concern.

<values>
/ dist_a = 1
/ manip_a = 1
/ max_a = 0
/ mid_a = 0
/ min_a = 0

/ dist_orig = 1
/ max_orig = 0
/ mid_orig = 0
/ min_orig = 0

</values>

// we have 4 distributions to select from
<list distributions>
/ items = (1,2,3,4)
</list>

// we have 5 manipulation options to select from
<list manipulations>
/ items = (1,2,3,4,5)
</list>

// we have 4 self-interest conditions
<list potentialSelfInterests>
/ items = (1,2,3,4)
</list>

<item potentialSelfInterests>
/1 = "You are none"
/2 = "You are max"
/3 = "You are middle"
/4 = "You are min"
</item>

<text potentialSelfInterests>
/ items = potentialSelfInterests
</text>

// original (unmanipulated) max values for distributions 1 to 4 (left to right)
<list max>
/ items = (1000, 1000, 1000, 600)
/ select = values.dist_a
</list>

// original (unmanipulated) mid values for distributions 1 to 4 (left to right)
<list mid>
/ items = (200, 800, 500, 500)
/ select = values.dist_a
</list>

// original (unmanipulated) min values for distributions 1 to 4 (left to right)
<list min>
/ items = (100, 100, 400, 400)
/ select = values.dist_a
</list>


/// original (only for use for second option)

<list max_orig>
/ items = (1000, 1000, 1000, 600)
/ select = values.dist_orig
</list>

<list mid_orig>
/ items = (200, 800, 500, 500)
/ select = values.dist_orig
</list>

<list min_orig>
/ items = (100, 100, 400, 400)
/ select = values.dist_orig
</list>

// expression applies the selected manipulation to the original values of the chosen distribution
<expressions options>
/ apply_manipulation = if (values.manip_a == 1) {
values.max_a = list.max.nextvalue/0.75;
values.mid_a = list.mid.nextvalue;
values.min_a = list.min.nextvalue + (list.max.nextvalue/0.75);
} else if (values.manip_a == 2) {
values.max_a = list.max.nextvalue/0.50;
values.mid_a = list.mid.nextvalue + (list.max.nextvalue/0.25);
values.min_a = list.min.nextvalue + (list.max.nextvalue/0.25);
} else if (values.manip_a == 3) {
values.max_a = list.max.nextvalue + (0.50 * list.min.nextvalue);
values.mid_a = list.mid.nextvalue + (0.50 * list.min.nextvalue);
values.min_a = 0 * list.min.nextvalue;
} else if (values.manip_a == 4) {
values.max_a = (list.max.nextvalue + list.mid.nextvalue + list.min.nextvalue)/3;
values.mid_a = (list.max.nextvalue + list.mid.nextvalue + list.min.nextvalue)/3;
values.min_a = (list.max.nextvalue + list.mid.nextvalue + list.min.nextvalue)/3;
} else if (values.manip_a == 5) {
values.max_a = list.max.nextvalue;
values.mid_a = list.mid.nextvalue;
values.min_a = list.min.nextvalue;
};
</expressions>


// select a random distribution number at the start of each trial
// select a random manipulation option at the start of each trial
// apply chosen manipulation to the distribution values

<trial exampletrial>
/ ontrialbegin = [
list.distributions.reset();
list.manipulations.reset();
list.potentialSelfInterests.reset();
values.dist_a = list.distributions.nextvalue;
values.manip_a = list.manipulations.nextvalue;
expressions.apply_manipulation;
]
/ stimulusframes = [1=distribution_a, debug]
/ validresponse = (57)
</trial>

<trial exampletrial_originals>
/ ontrialbegin = [
list.distributions.reset();
values.dist_orig = list.distributions.nextvalue;
]
/ stimulusframes = [1= distribution_a, debug, distribution_original, debug_original]
/ validresponse = (57)
</trial>


<text debug>
/ items = ("Selected Distribution #<%values.dist_a%> | Selected Manipulation #<%values.manip_a%> | Role: <%item.potentialSelfInterests%>")
/ position = (50%, 10%)
</text>

<text debug_original>
/ items = ("Selected Distribution Option B #<%values.dist_orig%>")
/ position = (50%, 20%)
</text>

<text distribution_a>
/ items = ("Max Option A: <%values.max_a%>, Mid: <%values.mid_a%>, Min: <%values.min_a%>")
/ position = (30%, 40%)
</text>

<text distribution_original>
/ items = ("Max Option B Original: <%values.max_orig%>, Mid: <%values.mid_orig%>, Min: <%values.min_orig%>")
/ position = (40%,50%)
</text>


<dropdown Q1_a >
/ caption = "What category is optionA?"
/ options = ("self-interest", "compassion", "envy", "fairness")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ validresponse = ("self-interest", "compassion", "envy", "fairness")
/ position = (30%, 80%)
</dropdown>

<dropdown Q2_a >
/ caption = "Is optionA potentially something else?"
/ options = ("NA", "self-interest", "compassion", "envy", "fairness")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ validresponse = ("NA", "self-interest", "compassion", "envy", "fairness")
/ position = (30%, 85%)
</dropdown>

<dropdown Q3_a >
/ caption = "OptionA is a great, clear example of your first choice category"
/ options = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ optionvalues = ("1", "2", "3", "4", "5")
/ required = true
/ validresponse = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ position = (30%,90%)
</dropdown>

<dropdown Q1_b >
/ caption = "What category is optionB?"
/ options = ("self-interest", "compassion", "envy", "fairness")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ validresponse = ("self-interest", "compassion", "envy", "fairness")
</dropdown>

<dropdown Q2_b >
/ caption = "Is optionB potentially something else?"
/ options = ("NA", "self-interest", "compassion", "envy", "fairness")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ validresponse = ("NA", "self-interest", "compassion", "envy", "fairness")
</dropdown>

<dropdown Q3_b >
/ caption = "OptionB is a great, clear example of your first choice category"
/ options = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ optionvalues = ("1", "2", "3", "4", "5")
/ required = true
/ validresponse = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
</dropdown>

<list dropdownQuestions>
/ items = (dropdown.Q1_a, dropdown.Q2_a, dropdown.Q3_a, dropdown.Q1_b, dropdown.Q2_b, dropdown.Q3_b)
</list>

<block exampleblock>
/ trials = [1-60 = replace(exampletrial,exampletrial_originals), list.dropdownQuestions]
</block>


> I have made edits to the code to include option B (which should be one of the original distributions, randomly selected regardless of the option A manipulated numbers)
> on the screen at the same time. However, the block code is not allowing me to show both options at once

You need a single trial element, not two, and you need to add <text> etc. elements for option B and display those stimuli per the existing trial's /stimulusframes or -times.

> I also don't believe that I should restart values for max_orig mid_orig and min_orig at 0, since they are essentially pasted from the original distributions. However, I want to reset them at the beginning of the trial and therefore am uncertain of how to do this without setting them as a value equal to 0

I don't understand what you mean here.

> I have also added a total of six dropdown questions that should appear on the screen below the two options. From my understanding, I can use dropdown questions by creating a survey element and then the survey page.

No. A <surveypage> is a special kind of <trial> element. If you want dropdowns displayed with your two distributions (A and B), you need to set up a single <surveypage> with the <text> elements or <caption>s for the distribution options and the six dropdowns. Then run that surveypage via your <block>'s /trials attribute, just like any regular trial.

> I added the self-interest conditions indicating the participant's role (You are none, you are max, you are middle, you are min). How do I make sure that this is randomized, independent of the other randomized variables (distribution, manipulation, etc)?

In the same way the other, already existing things (distributions, manipulations) are randomized? I don't understand what the actual question is here.

> In addition, I want to ensure that a total of 80 trials with all possible combinations are presented for the experiment (4 distributions,  5 manipulations, 4 self-interest conditions = 80 trials). How do I go about this?

You need to encode the combinations you want using the three <list> elements and then you need to pair those lists. See e.g. https://www.millisecond.com/forums/FindPost18268.aspx

I have no idea what page layout you're going for (and I'm unclear whether option B is supposed to be a different distribution or the same distribution as selected for option A, but without the manipulation), but putting the above together will yield something like this:

<values>
/ dist_a = 1
/ manip_a = 1
/ max_a = 0
/ mid_a = 0
/ min_a = 0

/ selfinterest = 1

/ dist_orig = 1
/ max_orig = 0
/ mid_orig = 0
/ min_orig = 0
</values>

// we have 4 distributions to select from
<list distributions_a>
/ items = (
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4)
</list>

// we have 5 manipulation options to select from
<list manipulations>
/ items = (
1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,
1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,
1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,
1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5)
/ selectionmode = list.distributions_a.currentindex
</list>

// we have 4 self-interest conditions
<list potentialSelfInterests>
/ items = (
1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,
1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,
1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,
1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4)
/ selectionmode = list.distributions_a.currentindex
</list>

<list distributions_orig>
/ items = (1,2,3,4)
/ selectionmode = random
/ replace = true
/ not = (values.dist_a)
</list>

<item potentialSelfInterests>
/1 = "You are none"
/2 = "You are max"
/3 = "You are middle"
/4 = "You are min"
</item>

// original (unmanipulated) max values for distributions 1 to 4 (left to right)
<list max>
/ items = (1000, 1000, 1000, 600)
/ select = values.dist_a
</list>

// original (unmanipulated) mid values for distributions 1 to 4 (left to right)
<list mid>
/ items = (200, 800, 500, 500)
/ select = values.dist_a
</list>

// original (unmanipulated) min values for distributions 1 to 4 (left to right)
<list min>
/ items = (100, 100, 400, 400)
/ select = values.dist_a
</list>


/// original (only for use for second option)

<list max_orig>
/ items = (1000, 1000, 1000, 600)
/ select = values.dist_orig
</list>

<list mid_orig>
/ items = (200, 800, 500, 500)
/ select = values.dist_orig
</list>

<list min_orig>
/ items = (100, 100, 400, 400)
/ select = values.dist_orig
</list>

// expression applies the selected manipulation to the original values of the chosen distribution
<expressions options>
/ apply_manipulation = if (values.manip_a == 1) {
values.max_a = list.max.nextvalue/0.75;
values.mid_a = list.mid.nextvalue;
values.min_a = list.min.nextvalue + (list.max.nextvalue/0.75);
} else if (values.manip_a == 2) {
values.max_a = list.max.nextvalue/0.50;
values.mid_a = list.mid.nextvalue + (list.max.nextvalue/0.25);
values.min_a = list.min.nextvalue + (list.max.nextvalue/0.25);
} else if (values.manip_a == 3) {
values.max_a = list.max.nextvalue + (0.50 * list.min.nextvalue);
values.mid_a = list.mid.nextvalue + (0.50 * list.min.nextvalue);
values.min_a = 0 * list.min.nextvalue;
} else if (values.manip_a == 4) {
values.max_a = (list.max.nextvalue + list.mid.nextvalue + list.min.nextvalue)/3;
values.mid_a = (list.max.nextvalue + list.mid.nextvalue + list.min.nextvalue)/3;
values.min_a = (list.max.nextvalue + list.mid.nextvalue + list.min.nextvalue)/3;
} else if (values.manip_a == 5) {
values.max_a = list.max.nextvalue;
values.mid_a = list.mid.nextvalue;
values.min_a = list.min.nextvalue;
};
</expressions>


// select a random distribution number at the start of each trial
// select a random manipulation option at the start of each trial
// apply chosen manipulation to the distribution values

<surveypage examplepage>
/ ontrialbegin = [
values.dist_a = list.distributions_a.nextvalue;
values.manip_a = list.manipulations.nextvalue;
values.selfinterest = list.potentialSelfInterests.nextvalue;
expressions.apply_manipulation;
values.dist_orig = list.distributions_orig.nextvalue;
values.min_orig = list.min_orig.nextvalue;
values.mid_orig = list.mid_orig.nextvalue;
values.max_orig = list.max_orig.nextvalue;
]
/ questions = [1=distribution_a, distribution_original, selfinterest, Q1_a, Q1_b, Q2_a, Q2_b, Q3_a, Q3_b]
/ showpagenumbers = false
/ showquestionnumbers = false
/ nextbuttonposition = (40%, 95%)
</surveypage>

<caption distribution_a>
/ caption = "Max Option A: <%values.max_a%>, Mid: <%values.mid_a%>, Min: <%values.min_a%>"
/ position = (10%, 30%)
</caption>

<caption distribution_original>
/ caption = "Max Option B Original: <%values.max_orig%>, Mid: <%values.mid_orig%>, Min: <%values.min_orig%>"
/ position = (55%,30%)
</caption>

<caption selfinterest>
/ caption = "<%item.potentialSelfInterests.item(values.selfinterest)%>"
/ position = (40%, 40%)
</caption>

<dropdown Q1_a >
/ caption = "What category is optionA?"
/ options = ("self-interest", "compassion", "envy", "fairness")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ validresponse = ("self-interest", "compassion", "envy", "fairness")
/ position = (10%, 65%)
</dropdown>

<dropdown Q2_a >
/ caption = "Is optionA potentially something else?"
/ options = ("NA", "self-interest", "compassion", "envy", "fairness")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ validresponse = ("NA", "self-interest", "compassion", "envy", "fairness")
/ position = (10%, 75%)
</dropdown>

<dropdown Q3_a >
/ caption = "OptionA is a great, clear example of your first choice category"
/ options = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ optionvalues = ("1", "2", "3", "4", "5")
/ required = true
/ validresponse = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ position = (10%,85%)
</dropdown>

<dropdown Q1_b >
/ caption = "What category is optionB?"
/ options = ("self-interest", "compassion", "envy", "fairness")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ validresponse = ("self-interest", "compassion", "envy", "fairness")
/ position = (55%, 65%)
</dropdown>

<dropdown Q2_b >
/ caption = "Is optionB potentially something else?"
/ options = ("NA", "self-interest", "compassion", "envy", "fairness")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ validresponse = ("NA", "self-interest", "compassion", "envy", "fairness")
/ position = (55%, 75%)
</dropdown>

<dropdown Q3_b >
/ caption = "OptionB is a great, clear example of your first choice category"
/ options = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ optionvalues = ("1", "2", "3", "4", "5")
/ required = true
/ validresponse = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ position = (55%, 85%)
</dropdown>

<block exampleblock>
/ trials = [1-80 = examplepage]
</block>

<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode response latency
values.dist_a, values.max_a, values.mid_a, values.min_a,
values.dist_orig, values.max_orig, values.mid_orig, values.min_orig,
values.manip_a, values.selfinterest)
/ separatefiles = true
</data>


psych101
psych101
Respected Member
Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)

Group: Forum Members
Posts: 14, Visits: 73
Thank you so much for your help, Dave. It is greatly appreciated.

I noticed that the maximum, mid, and minimum don't always correspond to the number value for the manipulated Option A values. Do you know how I can go about making the highest number the max, etc.?

Thank you 


Dave
Dave
Supreme Being
Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)

Group: Administrators
Posts: 9.9K, Visits: 49K
psych101 - 7/17/2019
Thank you so much for your help, Dave. It is greatly appreciated.

I noticed that the maximum, mid, and minimum don't always correspond to the number value for the manipulated Option A values. Do you know how I can go about making the highest number the max, etc.?

Thank you 


> I noticed that the maximum, mid, and minimum don't always correspond to the number value for the manipulated Option A values.

That's an effect of your manipulations. Inquisit has min() and max() functions, so you might use those. https://www.millisecond.com/support/docs/v5/html/language/expressions/functions.htm

Dave
Dave
Supreme Being
Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)Supreme Being (752K reputation)

Group: Administrators
Posts: 9.9K, Visits: 49K
Dave - 7/17/2019
psych101 - 7/17/2019
Thank you so much for your help, Dave. It is greatly appreciated.

I noticed that the maximum, mid, and minimum don't always correspond to the number value for the manipulated Option A values. Do you know how I can go about making the highest number the max, etc.?

Thank you 


> I noticed that the maximum, mid, and minimum don't always correspond to the number value for the manipulated Option A values.

That's an effect of your manipulations. Inquisit has min() and max() functions, so you might use those. https://www.millisecond.com/support/docs/v5/html/language/expressions/functions.htm

Come to think of it, sorting a list is probably the better option:

<values>
/ dist_a = 1
/ manip_a = 1
/ max_a = 0
/ mid_a = 0
/ min_a = 0

/ selfinterest = 1

/ dist_orig = 1
/ max_orig = 0
/ mid_orig = 0
/ min_orig = 0
</values>

// we have 4 distributions to select from
<list distributions_a>
/ items = (
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4)
</list>

// we have 5 manipulation options to select from
<list manipulations>
/ items = (
1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,
1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,
1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,
1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5)
/ selectionmode = list.distributions_a.currentindex
</list>

// we have 4 self-interest conditions
<list potentialSelfInterests>
/ items = (
1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,
1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,
1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,
1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4)
/ selectionmode = list.distributions_a.currentindex
</list>

<list distributions_orig>
/ items = (1,2,3,4)
/ selectionmode = random
/ replace = true
/ not = (values.dist_a)
</list>

<item potentialSelfInterests>
/1 = "You are none"
/2 = "You are max"
/3 = "You are middle"
/4 = "You are min"
</item>

// original (unmanipulated) max values for distributions 1 to 4 (left to right)
<list max>
/ items = (1000, 1000, 1000, 600)
/ select = values.dist_a
</list>

// original (unmanipulated) mid values for distributions 1 to 4 (left to right)
<list mid>
/ items = (200, 800, 500, 500)
/ select = values.dist_a
</list>

// original (unmanipulated) min values for distributions 1 to 4 (left to right)
<list min>
/ items = (100, 100, 400, 400)
/ select = values.dist_a
</list>


/// original (only for use for second option)

<list max_orig>
/ items = (1000, 1000, 1000, 600)
/ select = values.dist_orig
</list>

<list mid_orig>
/ items = (200, 800, 500, 500)
/ select = values.dist_orig
</list>

<list min_orig>
/ items = (100, 100, 400, 400)
/ select = values.dist_orig
</list>

// expression applies the selected manipulation to the original values of the chosen distribution
<list sort>
</list>

<expressions options>
/ apply_manipulation = if (values.manip_a == 1) {
list.sort.reset();
list.sort.appenditem(list.max.nextvalue/0.75);
list.sort.appenditem(list.mid.nextvalue);
list.sort.appenditem(list.min.nextvalue + (list.max.nextvalue/0.75));
list.sort.sort(true, false);
values.max_a = list.sort.item(3);
values.mid_a = list.sort.item(2);
values.min_a = list.sort.item(1);
} else if (values.manip_a == 2) {
list.sort.reset();
list.sort.appenditem(list.max.nextvalue/0.50);
list.sort.appenditem(list.mid.nextvalue + (list.max.nextvalue/0.25));
list.sort.appenditem(list.min.nextvalue + (list.max.nextvalue/0.25));
list.sort.sort(true, false);
values.max_a = list.sort.item(3);
values.mid_a = list.sort.item(2);
values.min_a = list.sort.item(1);
} else if (values.manip_a == 3) {
list.sort.reset();
list.sort.appenditem(list.max.nextvalue + (0.50 * list.min.nextvalue));
list.sort.appenditem(list.mid.nextvalue + (0.50 * list.min.nextvalue));
list.sort.appenditem(0 * list.min.nextvalue);
list.sort.sort(true, false);
values.max_a = list.sort.item(3);
values.mid_a = list.sort.item(2);
values.min_a = list.sort.item(1);
} else if (values.manip_a == 4) {
values.max_a = (list.max.nextvalue + list.mid.nextvalue + list.min.nextvalue)/3;
values.mid_a = (list.max.nextvalue + list.mid.nextvalue + list.min.nextvalue)/3;
values.min_a = (list.max.nextvalue + list.mid.nextvalue + list.min.nextvalue)/3;
} else if (values.manip_a == 5) {
values.max_a = list.max.nextvalue;
values.mid_a = list.mid.nextvalue;
values.min_a = list.min.nextvalue;
};
</expressions>


// select a random distribution number at the start of each trial
// select a random manipulation option at the start of each trial
// apply chosen manipulation to the distribution values

<surveypage examplepage>
/ ontrialbegin = [
values.dist_a = list.distributions_a.nextvalue;
values.manip_a = list.manipulations.nextvalue;
values.selfinterest = list.potentialSelfInterests.nextvalue;
expressions.apply_manipulation;
values.dist_orig = list.distributions_orig.nextvalue;
values.min_orig = list.min_orig.nextvalue;
values.mid_orig = list.mid_orig.nextvalue;
values.max_orig = list.max_orig.nextvalue;
]
/ questions = [1=distribution_a, distribution_original, selfinterest, Q1_a, Q1_b, Q2_a, Q2_b, Q3_a, Q3_b]
/ showpagenumbers = false
/ showquestionnumbers = false
/ nextbuttonposition = (40%, 95%)
</surveypage>

<caption distribution_a>
/ caption = "Max Option A: <%values.max_a%>, Mid: <%values.mid_a%>, Min: <%values.min_a%>"
/ position = (10%, 30%)
</caption>

<caption distribution_original>
/ caption = "Max Option B Original: <%values.max_orig%>, Mid: <%values.mid_orig%>, Min: <%values.min_orig%>"
/ position = (55%,30%)
</caption>

<caption selfinterest>
/ caption = "<%item.potentialSelfInterests.item(values.selfinterest)%>"
/ position = (40%, 40%)
</caption>

<dropdown Q1_a >
/ caption = "What category is optionA?"
/ options = ("self-interest", "compassion", "envy", "fairness")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ position = (10%, 65%)
</dropdown>

<dropdown Q2_a >
/ caption = "Is optionA potentially something else?"
/ options = ("NA", "self-interest", "compassion", "envy", "fairness")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ position = (10%, 75%)
</dropdown>

<dropdown Q3_a >
/ caption = "OptionA is a great, clear example of your first choice category"
/ options = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ optionvalues = ("1", "2", "3", "4", "5")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ position = (10%,85%)
</dropdown>

<dropdown Q1_b >
/ caption = "What category is optionB?"
/ options = ("self-interest", "compassion", "envy", "fairness")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ position = (55%, 65%)
</dropdown>

<dropdown Q2_b >
/ caption = "Is optionB potentially something else?"
/ options = ("NA", "self-interest", "compassion", "envy", "fairness")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ position = (55%, 75%)
</dropdown>

<dropdown Q3_b >
/ caption = "OptionB is a great, clear example of your first choice category"
/ options = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ optionvalues = ("1", "2", "3", "4", "5")
/ required = true
/ responsefontstyle = ("Arial", 1.4%, false, false, false, false, 5, 0)
/ position = (55%, 85%)
</dropdown>

<block exampleblock>
/ trials = [1-80 = examplepage]
</block>

<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode response latency
values.dist_a, values.max_a, values.mid_a, values.min_a,
values.dist_orig, values.max_orig, values.mid_orig, values.min_orig,
values.manip_a, values.selfinterest)
/ separatefiles = true
</data>


Edited
5 Months Ago by Dave
psych101
psych101
Respected Member
Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)Respected Member (430 reputation)

Group: Forum Members
Posts: 14, Visits: 73
Thank you Dave, this worked well. I have one more question below -- it's quite complicated.

I made a few updates to the code, created an "original values" or starting point that will be shown at the top for each trial (formerly called option b, original unmanipulated distributions), and created a new, manipulated option b, which is pretty much the same as option a but is randomized separately. 

For each trial, I would like the program to calculate the total of the randomized original values (max + mid + min) selected. Then, use this total to adjust the three values for each of the randomized option a and option b manipulations. The goal is for the original value total and the two option totals to be the same, while keeping the same ratios between the values so we don't lose the manipulations. Again, this would be adjusted every single trial. Since the original values have different totals,  and since there are multiple different option a's and different option b's depending on the random selection, it does not seem feasible to manually create every single combination and code it that way. 

I'm not sure if there is a way to do this in Inquisit. Could you please let me know if it is possible, and if so, how to make each trial's option a and b have the same total of the original values? 

Thank you for your time.


<defaults >
/ fontstyle = ("Arial", 2.22%, false, false, false, false, 5, 0)
</defaults>


<values>
/ dist_a = 1
/ manip_a = 1
/ max_a = 0
/ mid_a = 0
/ min_a = 0

/ selfinterest = 1

/ dist_orig = 1
/ max_orig = 0
/ mid_orig = 0
/ min_orig = 0

/ dist_b = 1
/ manip_b = 1
/ max_b = 0
/ mid_b = 0
/ min_b = 0
</values>

// we have 4 distributions to select from
<list distributions_a>
/ items = (
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4)
</list>

<list distributions_b>
/ items = (
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4)
</list>

// we have 5 manipulation options to select from
<list manipulations_a>
/ items = (
1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,
1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,
1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,
1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5)
/ selectionmode = list.distributions_a.currentindex
</list>

<list manipulations_b>
/ items = (
1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,
1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,
1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,
1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5)
/ selectionmode = list.distributions_b.currentindex
</list>


<list potentialSelfInterests>
/ items = (
1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,
1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,
1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,
1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4)
/ selectionmode = list.distributions_a.currentindex
</list>

<list distributions_orig>
/ items = (1,2,3,4)
/ selectionmode = random
/ replace = true
/ not = (values.dist_a)
</list>

<item potentialSelfInterests>
/1 = "You are none"
/2 = "You are max"
/3 = "You are middle"
/4 = "You are min"
</item>

// original (unmanipulated) max values for distributions 1 to 4 (left to right)
<list list_max_a>
/ items = (1000, 1000, 1000, 600)
/ select = values.dist_a
</list>

// original (unmanipulated) mid values for distributions 1 to 4 (left to right)
<list list_mid_a>
/ items = (200, 800, 500, 500)
/ select = values.dist_a
</list>

// original (unmanipulated) min values for distributions 1 to 4 (left to right)
<list list_min_a>
/ items = (100, 100, 400, 400)
/ select = values.dist_a
</list>


// original values for distib b
<list list_max_b>
/ items = (1000, 1000, 1000, 600)
/ select = values.dist_b
</list>

<list list_mid_b>
/ items = (200, 800, 500, 500)
/ select = values.dist_b
</list>

<list list_min_b>
/ items = (100, 100, 400, 400)
/ select = values.dist_b
</list>

/// original (only for use for second option)

<list list_max_orig>
/ items = (1000, 1000, 1000, 600)
/ select = values.dist_orig
</list>

<list list_mid_orig>
/ items = (200, 800, 500, 500)
/ select = values.dist_orig
</list>

<list list_min_orig>
/ items = (100, 100, 400, 400)
/ select = values.dist_orig
</list>

/ expression applies the selected manipulation to the original values of the chosen distribution
<list sort>
</list>


// expression applies the selected manipulation to the original values of the chosen distribution - option A
<expressions options_a>
/ apply_manipulation_a = if (values.manip_a == 1) {
list.sort.reset();
list.sort.appenditem(list.list_max_a.nextvalue/0.75);
list.sort.appenditem(list.list_mid_a.nextvalue);
list.sort.appenditem(list.list_min_a.nextvalue + (list.list_max_a.nextvalue/0.75));
list.sort.sort(true, false);
values.max_a = list.sort.item(3);
values.mid_a = list.sort.item(2);
values.min_a = list.sort.item(1);
} else if (values.manip_a == 2) {
list.sort.reset();
list.sort.appenditem(list.list_max_a.nextvalue/0.50);
list.sort.appenditem(list.list_mid_a.nextvalue + (list.list_max_a.nextvalue/0.25));
list.sort.appenditem(list.list_min_a.nextvalue + (list.list_max_a.nextvalue/0.25));
list.sort.sort(true, false);
values.max_a = list.sort.item(3);
values.mid_a = list.sort.item(2);
values.min_a = list.sort.item(1);
} else if (values.manip_a == 3) {
list.sort.reset();
list.sort.appenditem(list.list_max_a.nextvalue + (0.50 * list.list_min_a.nextvalue));
list.sort.appenditem(list.list_mid_a.nextvalue + (0.50 * list.list_min_a.nextvalue));
list.sort.appenditem(0 * list.list_min_a.nextvalue);
list.sort.sort(true, false);
values.max_a = list.sort.item(3);
values.mid_a = list.sort.item(2);
values.min_a = list.sort.item(1);
} else if (values.manip_a == 4) {
values.max_a = (list.list_max_a.nextvalue + list.list_mid_a.nextvalue + list.list_min_a.nextvalue)/3;
values.mid_a = (list.list_max_a.nextvalue + list.list_mid_a.nextvalue + list.list_min_a.nextvalue)/3;
values.min_a = (list.list_max_a.nextvalue + list.list_mid_a.nextvalue + list.list_min_a.nextvalue)/3;
} else if (values.manip_a == 5) {
values.max_a = list.list_max_a.nextvalue;
values.mid_a = list.list_mid_a.nextvalue;
values.min_a = list.list_min_a.nextvalue;
};
</expressions>


/ I switched the manipulation order for option b.
<expressions options_b>
/ apply_manipulation_b = if (values.manip_b == 1) {
values.max_b = list.list_max_b.nextvalue;
values.mid_b = list.list_mid_b.nextvalue;
values.min_b = list.list_min_b.nextvalue;
} else if (values.manip_b == 2) {
values.max_b = (list.list_max_b.nextvalue + list.list_mid_b.nextvalue + list.list_min_b.nextvalue)/3;
values.mid_b = (list.list_max_b.nextvalue + list.list_mid_b.nextvalue + list.list_min_b.nextvalue)/3;
values.min_b = (list.list_max_b.nextvalue + list.list_mid_b.nextvalue + list.list_min_b.nextvalue)/3;
} else if (values.manip_b == 3) {
list.sort.reset();
list.sort.appenditem(list.list_max_b.nextvalue/0.75);
list.sort.appenditem(list.list_mid_b.nextvalue);
list.sort.appenditem(list.list_min_b.nextvalue + (list.list_max_b.nextvalue/0.75));
list.sort.sort(true, false);
values.max_b = list.sort.item(3);
values.mid_b = list.sort.item(2);
values.min_b = list.sort.item(1);
} else if (values.manip_b == 4) {
list.sort.reset();
list.sort.appenditem(list.list_max_b.nextvalue/0.50);
list.sort.appenditem(list.list_mid_b.nextvalue + (list.list_max_b.nextvalue/0.25));
list.sort.appenditem(list.list_min_b.nextvalue + (list.list_max_b.nextvalue/0.25));
list.sort.sort(true, false);
values.max_b = list.sort.item(3);
values.mid_b = list.sort.item(2);
values.min_b = list.sort.item(1);
} else if (values.manip_b == 5) {
list.sort.reset();
list.sort.appenditem(list.list_max_b.nextvalue + (0.50 * list.list_min_b.nextvalue));
list.sort.appenditem(list.list_mid_b.nextvalue + (0.50 * list.list_min_b.nextvalue));
list.sort.appenditem(0 * list.list_min_b.nextvalue);
list.sort.sort(true, false);
values.max_b = list.sort.item(3);
values.mid_b = list.sort.item(2);
values.min_b = list.sort.item(1);
};
</expressions>


// select a random distribution number at the start of each trial
// select a random manipulation option at the start of each trial
// apply chosen manipulation to the distribution values
<surveypage examplepage>
/ ontrialbegin = [
values.dist_a = list.distributions_a.nextvalue;
values.manip_a = list.manipulations_a.nextvalue;
values.selfinterest = list.potentialSelfInterests.nextvalue;
expressions.apply_manipulation_a;

values.dist_orig = list.distributions_orig.nextvalue;
values.min_orig = list.list_min_orig.nextvalue;
values.mid_orig = list.list_mid_orig.nextvalue;
values.max_orig = list.list_max_orig.nextvalue;

values.dist_b = list.distributions_b.nextvalue;
values.manip_b = list.manipulations_b.nextvalue;
expressions.apply_manipulation_b;
]

/ questions = [1=distribution_original, distribution_a, distribution_b, selfinterest, Q1_a, Q1_b, Q2_a, Q2_b, Q3_a, Q3_b, Q4_a, Q4_b, Q5_a, Q5_b, Q6_a, Q6_b]
/ showpagenumbers = false
/ showquestionnumbers = false
/ nextbuttonposition = (40%, 95%)
/ recorddata = true
</surveypage>

<caption distribution_original>
/ caption = "Original Values: <%values.max_orig%>, <%values.mid_orig%>, <%values.min_orig%>"
/ position = (35%,2%)
/ fontstyle = ("Arial", 3%, true, false, false, false, 5, 0)
</caption>

<caption distribution_a>
/ caption = "OPTION A:<%values.max_a%>, <%values.mid_a%>, <%values.min_a%>"
/ position = (35%, 15%)
/ fontstyle = ("Arial", 3%, true, false, false, false, 5, 0)
</caption>

<caption distribution_b>
/ caption = "OPTION B:<%values.max_b%>, <%values.mid_b%>, <%values.min_b%>"
/ position = (35%, 20%)
/ fontstyle = ("Arial", 3%, true, false, false, false, 5, 0)
</caption>



<caption selfinterest>
/ caption = "<%item.potentialSelfInterests.item(values.selfinterest)%>"
/ position = (10%, 10%)
/ fontstyle = ("Arial", 3%, false, false, true, false, 5, 0)
</caption>

<dropdown Q1_a >
/ caption = "What category is option A?"
/ options = ("self-interest", "compassion", "envy", "fairness", "unsure")
/ required = true
/ validresponse = ("self-interest", "compassion", "envy", "fairness", "unsure")
/ position = (10%, 35%)
/ responsefontstyle = ("Arial", 1.67%, false, false, false, false, 5, 0)
</dropdown>

<dropdown Q2_a >
/ caption = "Is option A potentially something else?"
/ options = ("NA", "self-interest", "compassion", "envy", "fairness", "unsure")
/ required = true
/ validresponse = ("NA", "self-interest", "compassion", "envy", "fairness", "unsure")
/ position = (10%, 45%)
/ responsefontstyle = ("Arial", 1.67%, false, false, false, false, 5, 0)
</dropdown>

<dropdown Q3_a >
/ caption = "Is option A potentially also a third category?"
/ options = ("NA", "self-interest", "compassion", "envy", "fairness", "unsure")
/ required = true
/ validresponse = ("NA", "self-interest", "compassion", "envy", "fairness", "unsure")
/ position = (10%, 55%)
/ responsefontstyle = ("Arial", 1.67%, false, false, false, false, 5, 0)
</dropdown>

<dropdown Q4_a >
/ caption = "Is option A potentially also a fourth category?"
/ options = ("NA", "self-interest", "compassion", "envy", "fairness", "unsure")
/ required = true
/ validresponse = ("NA", "self-interest", "compassion", "envy", "fairness", "unsure")
/ position = (10%, 65%)
/ responsefontstyle = ("Arial", 1.67%, false, false, false, false, 5, 0)
</dropdown>

<dropdown Q5_a >
/ caption = "Option A is a great, clear example of your first choice category"
/ options = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ required = true
/ validresponse = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ position = (10%, 75%)
/ responsefontstyle = ("Arial", 1.67%, false, false, false, false, 5, 0)
</dropdown>

<textbox Q6_a>
/ caption = "Could this be characterized as something undefined?"
/ validresponse = ("character")
/ required = false
/ position = (10%, 85%)
</textbox>


// Option B Questions

<dropdown Q1_b >
/ caption = "What category is option B?"
/ options = ("self-interest", "compassion", "envy", "fairness", "unsure")
/ required = true
/ validresponse = ("self-interest", "compassion", "envy", "fairness", "unsure")
/ position = (55%, 35%)
/ responsefontstyle = ("Arial", 1.67%, false, false, false, false, 5, 0)
</dropdown>

<dropdown Q2_b >
/ caption = "Is option B potentially something else?"
/ options = ("NA", "self-interest", "compassion", "envy", "fairness", "unsure")
/ required = true
/ validresponse = ("NA", "self-interest", "compassion", "envy", "fairness", "unsure")
/ position = (55%, 45%)
/ responsefontstyle = ("Arial", 1.67%, false, false, false, false, 5, 0)
</dropdown>

<dropdown Q3_b >
/ caption = "Is option B potentially also a third category?"
/ options = ("NA", "self-interest", "compassion", "envy", "fairness", "unsure")
/ required = true
/ validresponse = ("NA", "self-interest", "compassion", "envy", "fairness", "unsure")
/ position = (55%, 55%)
/ responsefontstyle = ("Arial", 1.67%, false, false, false, false, 5, 0)
</dropdown>

<dropdown Q4_b >
/ caption = "Is option B potentially also a fourth category?"
/ options = ("NA", "self-interest", "compassion", "envy", "fairness", "unsure")
/ required = true
/ validresponse = ("NA", "self-interest", "compassion", "envy", "fairness", "unsure")
/ position = (55%, 65%)
/ responsefontstyle = ("Arial", 1.67%, false, false, false, false, 5, 0)
</dropdown>

<dropdown Q5_b >
/ caption = "Option B is a great, clear example of your first choice category"
/ options = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ required = true
/ validresponse = ("Strongly Agree", "Agree", "Unsure", "Disagree", "Strongly Disagree")
/ position = (55%, 75%)
/ responsefontstyle = ("Arial", 1.67%, false, false, false, false, 5, 0)
</dropdown>

<textbox Q6_b>
/ caption = "Could this be characterized as something undefined?"
/ validresponse = ("character")
/ required = false
/ position = (55%, 85%)
</textbox>


// instruct page

<page Intro>
^ ....
</page>

<block exampleblock>
/ trials = [1-80 = examplepage]
</block>

<expt>
/ preinstructions = (page.Intro)
/ blocks = [1=exampleblock]
</expt>


<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode response latency
values.dist_a, values.max_a, values.mid_a, values.min_a,
values.dist_b, values.max_b, values.mid_b, values.min_b,
values.dist_orig, values.max_orig, values.mid_orig, values.min_orig,
values.manip_a, values.manip_b, values.selfinterest, dropdown.Q1_a.response, dropdown.Q1_b.response, dropdown.Q2_a.response
dropdown.Q2_b.response, dropdown.Q3_a.response, dropdown.Q3_b.response, dropdown.Q4_a.response, dropdown.Q4_b.response,
dropdown.Q5_a.response, dropdown.Q5_b.response, textbox.Q6_a.response, textbox.Q6_b.response)
/ separatefiles = true
</data>


GO


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....






Millisecond Forums


Search