Calcuate total sum of Likert numerical responses


Author
Message
AnthonyFCollinsSussex
AnthonyFCollinsSussex
Partner Member (769 reputation)Partner Member (769 reputation)Partner Member (769 reputation)Partner Member (769 reputation)Partner Member (769 reputation)Partner Member (769 reputation)Partner Member (769 reputation)Partner Member (769 reputation)Partner Member (769 reputation)
Group: Forum Members
Posts: 52, Visits: 250
Hello! I am back very briefly for one inquiry. I am looking the best piece of code that will calculate the total/sum of numerical Likert responses (a simple headcount, not mean). I have devised the Penn State Worry questionnaire. Each (16) questions require a single Likert response (1-5). Finding out the total in the data output will be a massive help. I paste below the script! Thank you in advance
Anthony

**************************
STIMULI
**************************
<item Title>
/1 = "Questionnaire"
</item>

<item instructionsitem>
/ 1 = "Please rate each of the following statements on a scale of 1 (not at all typical of me) to 5 (very typical of me). Use either the mouse (or number keys + ENTER). Please consider carefully if you are happy with your response before moving on to the next item, as once you have provided a response, you cannot go back and amend your previous answer."
</item>

<item enter>
/1 = "Press SPACEBAR to continue"
</item>

<item questions>
/1 = "If I do not have enough time to do everything, I do not worry about it."
/2 = "My worries overwhelm me."
/3 = "I do not tend to worry about things."
/4 = "Many situations make me worry."
/5 = "I know I should not worry about things, but I just cannot help it."
/6 = "When I am under pressure I worry a lot."
/7 = "I am always worrying about something."
/8 = "I find it easy to dismiss worrisome thoughts."
/9 = "As soon as I finish one task, I start to worry about everything else I have to do."
/10 = "I never worry about anything."
/11 = "When there is nothing more I can do about a concern, I do not worry about it any more."
/12 = "I have been a worrier all my life."
/13 = "I notice that I have been worrying about things."
/14 = "Once I start worrying, I cannot stop."
/15 = "I worry all the time."
/16 = "I worry about projects until they are all done."
</item>

<text PSWQBCK>
/ items = Title
/ position = (50%, 5%)
/ fontstyle = ("Arial", 2.8%, true, false, true, false)
/halign = center
/ valign = top
/size = (1500, 70)
</text>

<text instructionswritten>
/ items = instructionsitem
/ size = (90%, 60%)
/ position = (50%, 70%)
/ fontstyle = ("Arial", 2.8%)
</text>

<text enter>
/ items = enter
/ position = (50%, 95%)
/ valign = bottom
/ fontstyle = ("Arial", 2.8%)
/ txbgcolor = (white)
/ txcolor = red
</text>

<text questions>
/size = (500, 70)
/items = questions
/position = (50, 50)
/halign = center
/select = sequence
/ fontstyle = ("Arial", 2.8%)
</text>

<likert PSWQRATE>
/ anchors = [1="Not at all typical of me"; 5="Very typical of me"]
/ stimulusframes = [1 = questions]
/ inputdevice = mouse
/ numpoints=5
/ position= (50, 80)
</likert>

**************************
TRIALS
**************************
<trial instructions>
/ stimulustimes = [1=instructionswritten, enter]
/ correctresponse = (57)
/ errormessage = false
/ recorddata = false
</trial>
**************************
BLOCKS
**************************
<block welcome>
/ bgstim = (PSWQBCK)
/ trials = [1=instructions]
/ recorddata = false
</block>

<block likertPSWQ>
/ trials = [1-16 = PSWQRATE]
</block>
**************************
EXPERIMENT
**************************
<expt>
/ blocks = [1=welcome; 2=likertPSWQ]
</expt>

<data>
/columns =[subject, trialnum, response]
/format=tab
/ separatefiles = true
</data>

<defaults>
/ screencolor = white
/ txcolor = black
/ txbgcolor = white
/ fontstyle = ("Arial", 2.8%)
</defaults>

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
AnthonyFCollinsSussex - 5/11/2021
Hello! I am back very briefly for one inquiry. I am looking the best piece of code that will calculate the total/sum of numerical Likert responses (a simple headcount, not mean). I have devised the Penn State Worry questionnaire. Each (16) questions require a single Likert response (1-5). Finding out the total in the data output will be a massive help. I paste below the script! Thank you in advance
Anthony

**************************
STIMULI
**************************
<item Title>
/1 = "Questionnaire"
</item>

<item instructionsitem>
/ 1 = "Please rate each of the following statements on a scale of 1 (not at all typical of me) to 5 (very typical of me). Use either the mouse (or number keys + ENTER). Please consider carefully if you are happy with your response before moving on to the next item, as once you have provided a response, you cannot go back and amend your previous answer."
</item>

<item enter>
/1 = "Press SPACEBAR to continue"
</item>

<item questions>
/1 = "If I do not have enough time to do everything, I do not worry about it."
/2 = "My worries overwhelm me."
/3 = "I do not tend to worry about things."
/4 = "Many situations make me worry."
/5 = "I know I should not worry about things, but I just cannot help it."
/6 = "When I am under pressure I worry a lot."
/7 = "I am always worrying about something."
/8 = "I find it easy to dismiss worrisome thoughts."
/9 = "As soon as I finish one task, I start to worry about everything else I have to do."
/10 = "I never worry about anything."
/11 = "When there is nothing more I can do about a concern, I do not worry about it any more."
/12 = "I have been a worrier all my life."
/13 = "I notice that I have been worrying about things."
/14 = "Once I start worrying, I cannot stop."
/15 = "I worry all the time."
/16 = "I worry about projects until they are all done."
</item>

<text PSWQBCK>
/ items = Title
/ position = (50%, 5%)
/ fontstyle = ("Arial", 2.8%, true, false, true, false)
/halign = center
/ valign = top
/size = (1500, 70)
</text>

<text instructionswritten>
/ items = instructionsitem
/ size = (90%, 60%)
/ position = (50%, 70%)
/ fontstyle = ("Arial", 2.8%)
</text>

<text enter>
/ items = enter
/ position = (50%, 95%)
/ valign = bottom
/ fontstyle = ("Arial", 2.8%)
/ txbgcolor = (white)
/ txcolor = red
</text>

<text questions>
/size = (500, 70)
/items = questions
/position = (50, 50)
/halign = center
/select = sequence
/ fontstyle = ("Arial", 2.8%)
</text>

<likert PSWQRATE>
/ anchors = [1="Not at all typical of me"; 5="Very typical of me"]
/ stimulusframes = [1 = questions]
/ inputdevice = mouse
/ numpoints=5
/ position= (50, 80)
</likert>

**************************
TRIALS
**************************
<trial instructions>
/ stimulustimes = [1=instructionswritten, enter]
/ correctresponse = (57)
/ errormessage = false
/ recorddata = false
</trial>
**************************
BLOCKS
**************************
<block welcome>
/ bgstim = (PSWQBCK)
/ trials = [1=instructions]
/ recorddata = false
</block>

<block likertPSWQ>
/ trials = [1-16 = PSWQRATE]
</block>
**************************
EXPERIMENT
**************************
<expt>
/ blocks = [1=welcome; 2=likertPSWQ]
</expt>

<data>
/columns =[subject, trialnum, response]
/format=tab
/ separatefiles = true
</data>

<defaults>
/ screencolor = white
/ txcolor = black
/ txbgcolor = white
/ fontstyle = ("Arial", 2.8%)
</defaults>

<values>
/ sum = 0
</values>

<likert PSWQRATE>
/ ontrialend = [values.sum += likert.PSWQRATE.response]
/ anchors = [1="Not at all typical of me"; 5="Very typical of me"]
/ stimulusframes = [1 = questions]
/ inputdevice = mouse
/ numpoints=5
/ position= (50, 80)
</likert>

and log values.sum to the data file.

AnthonyFCollinsSussex
AnthonyFCollinsSussex
Partner Member (769 reputation)Partner Member (769 reputation)Partner Member (769 reputation)Partner Member (769 reputation)Partner Member (769 reputation)Partner Member (769 reputation)Partner Member (769 reputation)Partner Member (769 reputation)Partner Member (769 reputation)
Group: Forum Members
Posts: 52, Visits: 250
Dave - 5/11/2021
AnthonyFCollinsSussex - 5/11/2021
Hello! I am back very briefly for one inquiry. I am looking the best piece of code that will calculate the total/sum of numerical Likert responses (a simple headcount, not mean). I have devised the Penn State Worry questionnaire. Each (16) questions require a single Likert response (1-5). Finding out the total in the data output will be a massive help. I paste below the script! Thank you in advance
Anthony

**************************
STIMULI
**************************
<item Title>
/1 = "Questionnaire"
</item>

<item instructionsitem>
/ 1 = "Please rate each of the following statements on a scale of 1 (not at all typical of me) to 5 (very typical of me). Use either the mouse (or number keys + ENTER). Please consider carefully if you are happy with your response before moving on to the next item, as once you have provided a response, you cannot go back and amend your previous answer."
</item>

<item enter>
/1 = "Press SPACEBAR to continue"
</item>

<item questions>
/1 = "If I do not have enough time to do everything, I do not worry about it."
/2 = "My worries overwhelm me."
/3 = "I do not tend to worry about things."
/4 = "Many situations make me worry."
/5 = "I know I should not worry about things, but I just cannot help it."
/6 = "When I am under pressure I worry a lot."
/7 = "I am always worrying about something."
/8 = "I find it easy to dismiss worrisome thoughts."
/9 = "As soon as I finish one task, I start to worry about everything else I have to do."
/10 = "I never worry about anything."
/11 = "When there is nothing more I can do about a concern, I do not worry about it any more."
/12 = "I have been a worrier all my life."
/13 = "I notice that I have been worrying about things."
/14 = "Once I start worrying, I cannot stop."
/15 = "I worry all the time."
/16 = "I worry about projects until they are all done."
</item>

<text PSWQBCK>
/ items = Title
/ position = (50%, 5%)
/ fontstyle = ("Arial", 2.8%, true, false, true, false)
/halign = center
/ valign = top
/size = (1500, 70)
</text>

<text instructionswritten>
/ items = instructionsitem
/ size = (90%, 60%)
/ position = (50%, 70%)
/ fontstyle = ("Arial", 2.8%)
</text>

<text enter>
/ items = enter
/ position = (50%, 95%)
/ valign = bottom
/ fontstyle = ("Arial", 2.8%)
/ txbgcolor = (white)
/ txcolor = red
</text>

<text questions>
/size = (500, 70)
/items = questions
/position = (50, 50)
/halign = center
/select = sequence
/ fontstyle = ("Arial", 2.8%)
</text>

<likert PSWQRATE>
/ anchors = [1="Not at all typical of me"; 5="Very typical of me"]
/ stimulusframes = [1 = questions]
/ inputdevice = mouse
/ numpoints=5
/ position= (50, 80)
</likert>

**************************
TRIALS
**************************
<trial instructions>
/ stimulustimes = [1=instructionswritten, enter]
/ correctresponse = (57)
/ errormessage = false
/ recorddata = false
</trial>
**************************
BLOCKS
**************************
<block welcome>
/ bgstim = (PSWQBCK)
/ trials = [1=instructions]
/ recorddata = false
</block>

<block likertPSWQ>
/ trials = [1-16 = PSWQRATE]
</block>
**************************
EXPERIMENT
**************************
<expt>
/ blocks = [1=welcome; 2=likertPSWQ]
</expt>

<data>
/columns =[subject, trialnum, response]
/format=tab
/ separatefiles = true
</data>

<defaults>
/ screencolor = white
/ txcolor = black
/ txbgcolor = white
/ fontstyle = ("Arial", 2.8%)
</defaults>

<values>
/ sum = 0
</values>

<likert PSWQRATE>
/ ontrialend = [values.sum += likert.PSWQRATE.response]
/ anchors = [1="Not at all typical of me"; 5="Very typical of me"]
/ stimulusframes = [1 = questions]
/ inputdevice = mouse
/ numpoints=5
/ position= (50, 80)
</likert>

and log values.sum to the data file.

Thank you kindly Dave, I will implement this and ensure I log the values.sum to the data file. Really very much appreciated!
Yours Sincerely
Anthony
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search