kclintbe
|
|
Group: Forum Members
Posts: 4,
Visits: 14
|
Hello all!
I’m currently working on an experiment where participants are shown an emotionally ambiguous face. This face is the product of morphing an image of an individual demonstrating anger and an image of the same individual demonstrating another emotion. With mouse input the participant then responds on a line with what percentage of each emotion they believe is mixed.
Example; we show the fully angry face in the top left corner and a fully happy face in the top right corner. If they believe the ambiguous face has higher levels of happiness they make a selection toward the right side of the bar.
In the script we have listed the images between 1 and 42 in the following format:
<item test_emoHex_large> /1 = "F25_Fe35.jpg" /2 = "M43_Di35.jpg" /3 = "F25_Fe100.jpg" /4 = "F41_Ha75.jpg" . . .
I have also created lists of whether the anger is presented in the left corner, and of the actual percentage of the non-anger emotion.
<item an_left> /1 ="1" /2 ="1" /3 ="0" /4 ="1" . . . (where 1 means anger is shown on the left side and 0 means the other emotion is shown on the left side)
<item correctr> /1 ="35" /2 ="35" /3 ="100" /4 ="75" . . .
I want the data output columns to include the deviance from the actual percentage of the mixed faces and the percentage of over/underestimation of anger. We’ve written the expressions I have included below.
<expressions> / correctionvalue = (display.width - shape.line.width) / 2 / correctedscore = (trial.makeresponse_line.responsex - expressions.correctionvalue) / shape.line.width * 100 / roundedvalue = format("%.2f", expressions.correctedscore) / correctedan = if (item.an_left ="1") {expressions.correctedscore;} else if (item.an_left ="0") {100 - expressions.correctedscore;} / deviance = abs(item.correctr - expressions.correctedan) / overunder = (item.correctr - expressions.correctedan) </expressions>
- “correctedscore” calculates the percentage they have selected based on the monitor dimensions and mouse input - “roundedvalue” is shown back to them - “correctedan” normalizes the scores so they are all relative in the same way to anger
What I don’t know how to do is connecting the “an_left” and “correctr” items lists to the pictures lists so that they can be used in the expressions.
When I tried running the experiment and recording all the items lists and the relevant expressions an_left and correctr were blank, correctedscore was correct, correctedan was the same as correctedscore (so it didn’t transform based on the positioning of an), deviance recorded as 0, and overunder was blank.
Please let me know if there are any other parts of the script or other information that would help you. Thank you for your time and I look forward to your response.
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+xHello all!
I’m currently working on an experiment where participants are shown an emotionally ambiguous face. This face is the product of morphing an image of an individual demonstrating anger and an image of the same individual demonstrating another emotion. With mouse input the participant then responds on a line with what percentage of each emotion they believe is mixed.
Example; we show the fully angry face in the top left corner and a fully happy face in the top right corner. If they believe the ambiguous face has higher levels of happiness they make a selection toward the right side of the bar.
In the script we have listed the images between 1 and 42 in the following format:
<item test_emoHex_large> /1 = "F25_Fe35.jpg" /2 = "M43_Di35.jpg" /3 = "F25_Fe100.jpg" /4 = "F41_Ha75.jpg" . . .
I have also created lists of whether the anger is presented in the left corner, and of the actual percentage of the non-anger emotion.
<item an_left> /1 ="1" /2 ="1" /3 ="0" /4 ="1" . . . (where 1 means anger is shown on the left side and 0 means the other emotion is shown on the left side)
<item correctr> /1 ="35" /2 ="35" /3 ="100" /4 ="75" . . .
I want the data output columns to include the deviance from the actual percentage of the mixed faces and the percentage of over/underestimation of anger. We’ve written the expressions I have included below.
<expressions> / correctionvalue = (display.width - shape.line.width) / 2 / correctedscore = (trial.makeresponse_line.responsex - expressions.correctionvalue) / shape.line.width * 100 / roundedvalue = format("%.2f", expressions.correctedscore) / correctedan = if (item.an_left ="1") {expressions.correctedscore;} else if (item.an_left ="0") {100 - expressions.correctedscore;} / deviance = abs(item.correctr - expressions.correctedan) / overunder = (item.correctr - expressions.correctedan) </expressions>
- “correctedscore” calculates the percentage they have selected based on the monitor dimensions and mouse input - “roundedvalue” is shown back to them - “correctedan” normalizes the scores so they are all relative in the same way to anger
What I don’t know how to do is connecting the “an_left” and “correctr” items lists to the pictures lists so that they can be used in the expressions.
When I tried running the experiment and recording all the items lists and the relevant expressions an_left and correctr were blank, correctedscore was correct, correctedan was the same as correctedscore (so it didn’t transform based on the positioning of an), deviance recorded as 0, and overunder was blank.
Please let me know if there are any other parts of the script or other information that would help you. Thank you for your time and I look forward to your response.
<item> elements do not perform any selections -- they merely store items. This is why / correctedan = if (i tem.an_left ="1") {expressions.correctedscore;} else if ( item.an_left ="0") {100 - expressions.correctedscore;} / deviance = abs(item.correctr - expressions.correctedan) / overunder = (item.correctr - expressions.correctedan)
and so forth cannot work. item.an_left does not mean or return anything. Moreover, you are using the wrong operator in your condition -- you ought to use ==, not =. What you need to do is "link" the various stimuli and their attributes as detailed in the "How to present stimulus pairs" topic in the documentation: https://www.millisecond.com/support/docs/v5/html/howto/howtopairs.htmI would recommend using <list> elements to store the various attributes, you can find plenty of examples in the forums, such as https://www.millisecond.com/forums/FindPost11991.aspx
|
|
|
kclintbe
|
|
Group: Forum Members
Posts: 4,
Visits: 14
|
+x+xHello all!
I’m currently working on an experiment where participants are shown an emotionally ambiguous face. This face is the product of morphing an image of an individual demonstrating anger and an image of the same individual demonstrating another emotion. With mouse input the participant then responds on a line with what percentage of each emotion they believe is mixed.
Example; we show the fully angry face in the top left corner and a fully happy face in the top right corner. If they believe the ambiguous face has higher levels of happiness they make a selection toward the right side of the bar.
In the script we have listed the images between 1 and 42 in the following format:
<item test_emoHex_large> /1 = "F25_Fe35.jpg" /2 = "M43_Di35.jpg" /3 = "F25_Fe100.jpg" /4 = "F41_Ha75.jpg" . . .
I have also created lists of whether the anger is presented in the left corner, and of the actual percentage of the non-anger emotion.
<item an_left> /1 ="1" /2 ="1" /3 ="0" /4 ="1" . . . (where 1 means anger is shown on the left side and 0 means the other emotion is shown on the left side)
<item correctr> /1 ="35" /2 ="35" /3 ="100" /4 ="75" . . .
I want the data output columns to include the deviance from the actual percentage of the mixed faces and the percentage of over/underestimation of anger. We’ve written the expressions I have included below.
<expressions> / correctionvalue = (display.width - shape.line.width) / 2 / correctedscore = (trial.makeresponse_line.responsex - expressions.correctionvalue) / shape.line.width * 100 / roundedvalue = format("%.2f", expressions.correctedscore) / correctedan = if (item.an_left ="1") {expressions.correctedscore;} else if (item.an_left ="0") {100 - expressions.correctedscore;} / deviance = abs(item.correctr - expressions.correctedan) / overunder = (item.correctr - expressions.correctedan) </expressions>
- “correctedscore” calculates the percentage they have selected based on the monitor dimensions and mouse input - “roundedvalue” is shown back to them - “correctedan” normalizes the scores so they are all relative in the same way to anger
What I don’t know how to do is connecting the “an_left” and “correctr” items lists to the pictures lists so that they can be used in the expressions.
When I tried running the experiment and recording all the items lists and the relevant expressions an_left and correctr were blank, correctedscore was correct, correctedan was the same as correctedscore (so it didn’t transform based on the positioning of an), deviance recorded as 0, and overunder was blank.
Please let me know if there are any other parts of the script or other information that would help you. Thank you for your time and I look forward to your response.
<item> elements do not perform any selections -- they merely store items. This is why / correctedan = if (i tem.an_left ="1") {expressions.correctedscore;} else if ( item.an_left ="0") {100 - expressions.correctedscore;} / deviance = abs(item.correctr - expressions.correctedan) / overunder = (item.correctr - expressions.correctedan)
and so forth cannot work. item.an_left does not mean or return anything. Moreover, you are using the wrong operator in your condition -- you ought to use ==, not =. What you need to do is "link" the various stimuli and their attributes as detailed in the "How to present stimulus pairs" topic in the documentation: https://www.millisecond.com/support/docs/v5/html/howto/howtopairs.htmI would recommend using <list> elements to store the various attributes, you can find plenty of examples in the forums, such as https://www.millisecond.com/forums/FindPost11991.aspx Hello again! Thank you for your reply. Is there a way I can use that method though for recording traits that aren't shown to the participant in the experiments? Looking through the pages you suggested it seemed that the function is usually used to choose stimuli to display in the experiment. I only want to use the other traits for expressions that then help display the statistics I need in the output file. For example, in trial one I may be using image1. I want to have in the output file the deviance between the correct answer, and the answer the participant inputs. Let's say the correct answer is 35%, and the participant says 40%. I want to find a way for the code to know that for trial one, the correct answer is 35%, so that it can record that the deviance is 5%. The correct answer varies based on which trial number it is, but the trials are static, always in the same order. Could you show me an example of how I could use the stimulus pairs function for this or if there is another function that could work for me? Thanks, Katrien
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+x+x+xHello all!
I’m currently working on an experiment where participants are shown an emotionally ambiguous face. This face is the product of morphing an image of an individual demonstrating anger and an image of the same individual demonstrating another emotion. With mouse input the participant then responds on a line with what percentage of each emotion they believe is mixed.
Example; we show the fully angry face in the top left corner and a fully happy face in the top right corner. If they believe the ambiguous face has higher levels of happiness they make a selection toward the right side of the bar.
In the script we have listed the images between 1 and 42 in the following format:
<item test_emoHex_large> /1 = "F25_Fe35.jpg" /2 = "M43_Di35.jpg" /3 = "F25_Fe100.jpg" /4 = "F41_Ha75.jpg" . . .
I have also created lists of whether the anger is presented in the left corner, and of the actual percentage of the non-anger emotion.
<item an_left> /1 ="1" /2 ="1" /3 ="0" /4 ="1" . . . (where 1 means anger is shown on the left side and 0 means the other emotion is shown on the left side)
<item correctr> /1 ="35" /2 ="35" /3 ="100" /4 ="75" . . .
I want the data output columns to include the deviance from the actual percentage of the mixed faces and the percentage of over/underestimation of anger. We’ve written the expressions I have included below.
<expressions> / correctionvalue = (display.width - shape.line.width) / 2 / correctedscore = (trial.makeresponse_line.responsex - expressions.correctionvalue) / shape.line.width * 100 / roundedvalue = format("%.2f", expressions.correctedscore) / correctedan = if (item.an_left ="1") {expressions.correctedscore;} else if (item.an_left ="0") {100 - expressions.correctedscore;} / deviance = abs(item.correctr - expressions.correctedan) / overunder = (item.correctr - expressions.correctedan) </expressions>
- “correctedscore” calculates the percentage they have selected based on the monitor dimensions and mouse input - “roundedvalue” is shown back to them - “correctedan” normalizes the scores so they are all relative in the same way to anger
What I don’t know how to do is connecting the “an_left” and “correctr” items lists to the pictures lists so that they can be used in the expressions.
When I tried running the experiment and recording all the items lists and the relevant expressions an_left and correctr were blank, correctedscore was correct, correctedan was the same as correctedscore (so it didn’t transform based on the positioning of an), deviance recorded as 0, and overunder was blank.
Please let me know if there are any other parts of the script or other information that would help you. Thank you for your time and I look forward to your response.
<item> elements do not perform any selections -- they merely store items. This is why / correctedan = if (i tem.an_left ="1") {expressions.correctedscore;} else if ( item.an_left ="0") {100 - expressions.correctedscore;} / deviance = abs(item.correctr - expressions.correctedan) / overunder = (item.correctr - expressions.correctedan)
and so forth cannot work. item.an_left does not mean or return anything. Moreover, you are using the wrong operator in your condition -- you ought to use ==, not =. What you need to do is "link" the various stimuli and their attributes as detailed in the "How to present stimulus pairs" topic in the documentation: https://www.millisecond.com/support/docs/v5/html/howto/howtopairs.htmI would recommend using <list> elements to store the various attributes, you can find plenty of examples in the forums, such as https://www.millisecond.com/forums/FindPost11991.aspx Hello again! Thank you for your reply. Is there a way I can use that method though for recording traits that aren't shown to the participant in the experiments? Looking through the pages you suggested it seemed that the function is usually used to choose stimuli to display in the experiment. I only want to use the other traits for expressions that then help display the statistics I need in the output file. For example, in trial one I may be using image1. I want to have in the output file the deviance between the correct answer, and the answer the participant inputs. Let's say the correct answer is 35%, and the participant says 40%. I want to find a way for the code to know that for trial one, the correct answer is 35%, so that it can record that the deviance is 5%. The correct answer varies based on which trial number it is, but the trials are static, always in the same order. Could you show me an example of how I could use the stimulus pairs function for this or if there is another function that could work for me? Thanks, Katrien > Is there a way I can use that method though for recording traits that aren't shown to the participant in the experiments? Yes, absolutely. Put the traits in <list>s, in the same order as the stimulus items (images in your case) the respective trait belongs to. Pair the <list>s to the stimulus element. Then you can do something like this: For the sake of example and simplicity, suppose you have four items A to D. The "trait" / value 50 is associated with "A", the value 32 with "B", the value 78 with "C", and the value 12 with D. <text mytext> / items = myitems / select = sequence / position = (50%, 40%) </text> <item myitems> / 1 = "A" / 2 = "B" / 1 = "C" / 2 = "D" </item>
<list correctanswer> / items = ("50", "32", "78", "12") / selectionmode = text.mytext.currentindex </list>You can then store the "correct answer" (= "trait") associated with the stimulus item as well as the given answer in a bunch of variables, <openended myopenended> / ontrialend = [values.correctanswer = list.correctanswer.nextvalue; values.givenanswer = openended.myopenended.response;]/ stimulusframes = [1=mytext] / range = (0,100) </openended> <values> / correctanswer = 0 / givenanswer = 0 </values>calculate the difference / deviance <expressions> / deviance = (values.correctanswer - values.givenanswer)</expressions> and log all that to the data file <data> / columns = (date time subject group blocknum blockcode trialnum trialcode stimulusitem response latency values.correctanswer values.givenanswer expressions.deviance) / separatefiles = true </data> <block myblock> / trials = [1-4 = myopenended] </block> Hope this helps.
|
|
|
kclintbe
|
|
Group: Forum Members
Posts: 4,
Visits: 14
|
+x+x+x+xHello all!
I’m currently working on an experiment where participants are shown an emotionally ambiguous face. This face is the product of morphing an image of an individual demonstrating anger and an image of the same individual demonstrating another emotion. With mouse input the participant then responds on a line with what percentage of each emotion they believe is mixed.
Example; we show the fully angry face in the top left corner and a fully happy face in the top right corner. If they believe the ambiguous face has higher levels of happiness they make a selection toward the right side of the bar.
In the script we have listed the images between 1 and 42 in the following format:
<item test_emoHex_large> /1 = "F25_Fe35.jpg" /2 = "M43_Di35.jpg" /3 = "F25_Fe100.jpg" /4 = "F41_Ha75.jpg" . . .
I have also created lists of whether the anger is presented in the left corner, and of the actual percentage of the non-anger emotion.
<item an_left> /1 ="1" /2 ="1" /3 ="0" /4 ="1" . . . (where 1 means anger is shown on the left side and 0 means the other emotion is shown on the left side)
<item correctr> /1 ="35" /2 ="35" /3 ="100" /4 ="75" . . .
I want the data output columns to include the deviance from the actual percentage of the mixed faces and the percentage of over/underestimation of anger. We’ve written the expressions I have included below.
<expressions> / correctionvalue = (display.width - shape.line.width) / 2 / correctedscore = (trial.makeresponse_line.responsex - expressions.correctionvalue) / shape.line.width * 100 / roundedvalue = format("%.2f", expressions.correctedscore) / correctedan = if (item.an_left ="1") {expressions.correctedscore;} else if (item.an_left ="0") {100 - expressions.correctedscore;} / deviance = abs(item.correctr - expressions.correctedan) / overunder = (item.correctr - expressions.correctedan) </expressions>
- “correctedscore” calculates the percentage they have selected based on the monitor dimensions and mouse input - “roundedvalue” is shown back to them - “correctedan” normalizes the scores so they are all relative in the same way to anger
What I don’t know how to do is connecting the “an_left” and “correctr” items lists to the pictures lists so that they can be used in the expressions.
When I tried running the experiment and recording all the items lists and the relevant expressions an_left and correctr were blank, correctedscore was correct, correctedan was the same as correctedscore (so it didn’t transform based on the positioning of an), deviance recorded as 0, and overunder was blank.
Please let me know if there are any other parts of the script or other information that would help you. Thank you for your time and I look forward to your response.
<item> elements do not perform any selections -- they merely store items. This is why / correctedan = if (i tem.an_left ="1") {expressions.correctedscore;} else if ( item.an_left ="0") {100 - expressions.correctedscore;} / deviance = abs(item.correctr - expressions.correctedan) / overunder = (item.correctr - expressions.correctedan)
and so forth cannot work. item.an_left does not mean or return anything. Moreover, you are using the wrong operator in your condition -- you ought to use ==, not =. What you need to do is "link" the various stimuli and their attributes as detailed in the "How to present stimulus pairs" topic in the documentation: https://www.millisecond.com/support/docs/v5/html/howto/howtopairs.htmI would recommend using <list> elements to store the various attributes, you can find plenty of examples in the forums, such as https://www.millisecond.com/forums/FindPost11991.aspx Hello again! Thank you for your reply. Is there a way I can use that method though for recording traits that aren't shown to the participant in the experiments? Looking through the pages you suggested it seemed that the function is usually used to choose stimuli to display in the experiment. I only want to use the other traits for expressions that then help display the statistics I need in the output file. For example, in trial one I may be using image1. I want to have in the output file the deviance between the correct answer, and the answer the participant inputs. Let's say the correct answer is 35%, and the participant says 40%. I want to find a way for the code to know that for trial one, the correct answer is 35%, so that it can record that the deviance is 5%. The correct answer varies based on which trial number it is, but the trials are static, always in the same order. Could you show me an example of how I could use the stimulus pairs function for this or if there is another function that could work for me? Thanks, Katrien > Is there a way I can use that method though for recording traits that aren't shown to the participant in the experiments? Yes, absolutely. Put the traits in <list>s, in the same order as the stimulus items (images in your case) the respective trait belongs to. Pair the <list>s to the stimulus element. Then you can do something like this: For the sake of example and simplicity, suppose you have four items A to D. The "trait" / value 50 is associated with "A", the value 32 with "B", the value 78 with "C", and the value 12 with D. <text mytext> / items = myitems / select = sequence / position = (50%, 40%) </text> <item myitems> / 1 = "A" / 2 = "B" / 1 = "C" / 2 = "D" </item>
<list correctanswer> / items = ("50", "32", "78", "12") / selectionmode = text.mytext.currentindex </list>You can then store the "correct answer" (= "trait") associated with the stimulus item as well as the given answer in a bunch of variables, <openended myopenended> / ontrialend = [values.correctanswer = list.correctanswer.nextvalue; values.givenanswer = openended.myopenended.response;]/ stimulusframes = [1=mytext] / range = (0,100) </openended> <values> / correctanswer = 0 / givenanswer = 0 </values>calculate the difference / deviance <expressions> / deviance = (values.correctanswer - values.givenanswer)</expressions> and log all that to the data file <data> / columns = (date time subject group blocknum blockcode trialnum trialcode stimulusitem response latency values.correctanswer values.givenanswer expressions.deviance) / separatefiles = true </data> <block myblock> / trials = [1-4 = myopenended] </block> Hope this helps. Excellent, that does help. Thank you!
|
|
|
kclintbe
|
|
Group: Forum Members
Posts: 4,
Visits: 14
|
When I tried validating the script it said "error: Expression ' ' is invalid. Expression is empty."
Here's what I did based on your example:
<list correct_percent> / items = ("35" ,"35" ,"100" ,"75" ,"35" ,"35" ,"100" ,"75" ,"35" ,"75" ,"55" ,"75" ,"35" ,"55" ,"55" ,"35" ,"55" ,"75" ,"100" ,"100" ,"55" ,"75" ,"100" ,"35" ,"75" ,"55" ,"55" ,"75" ,"55" ,"75" ,"100" ,"100" ,"55" ,"100" ,"35" ,"35" ,"100" ,"100" ,"55" ,"75" ,"100" ,"100") / selectionmode = picture.test_emoHex_large.currentindex </list>
How do I fix this? Thank you again for your continued assistance.
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+xWhen I tried validating the script it said "error: Expression ' ' is invalid. Expression is empty." Here's what I did based on your example: <list correct_percent> / items = ("35" ,"35" ,"100" ,"75" ,"35" ,"35" ,"100" ,"75" ,"35" ,"75" ,"55" ,"75" ,"35" ,"55" ,"55" ,"35" ,"55" ,"75" ,"100" ,"100" ,"55" ,"75" ,"100" ,"35" ,"75" ,"55" ,"55" ,"75" ,"55" ,"75" ,"100" ,"100" ,"55" ,"100" ,"35" ,"35" ,"100" ,"100" ,"55" ,"75" ,"100" ,"100") / selectionmode = picture.test_emoHex_large.currentindex </list> How do I fix this? Thank you again for your continued assistance. Something off with the spaces in your list. Try <list correct_percent> / items = ("35","35","100","75","35","35","100","75","35","75","55","75","35","55","55","35","55","75","100","100","55","75","100","35","75","55","55","75","55","75","100","100","55","100","35","35","100","100","55","75","100","100") / selectionmode = picture.test_emoHex_large.currentindex </list>
|
|
|