Sum Scoring Questionnaries | Total Scores
To summarize scores from multiple items of a questionnaire into a single total score in Labvanced, follow these simple steps using the Event system:
- Create a
Frame Start
trigger. - Create an array variable and place all of the questionnaire-related items there:
- Set up an
Array Operations
→Add/Remove Array Entries
action. Name the array variable (e.g.,Total Items
) and add all the items you need to sum to the array (e.g.,Q1
,Q2
,Q3
,Q4
).
- Sum all the items in the array and store it in a new variable:
- Add a
Variable Actions
→Math & Statistics
. Set the operation toSum
, select the array you just created as the input and create a new scalar variable to store the output score (e.g.,Total Score
).
These steps will be explained in more detail in the following section.
The process described here can be applied to other contexts as well, such as calculating sub-scales.
Step-by-Step Guide to Summarize and Add Questionnaire Scores
Let us look into the steps to summarize and add the scores of a questionnaire. You can apply the principles below to any questionnaire to calculate the sum of any scores.
Step 1: Add a Canvas Frame + Create a Frame Event
In the Task Editor, click + Canvas
to create a new frame. This is where the scoring will happen and be displayed.
- Go to the Events tab.
- Click
+ Frame Event
. - Name the event something like “Total Score Calculation”.
- Click Next.
Step 2: Set up the Trigger
- Select
Trial and Frame Trigger
. - Choose
Frame Start
as the trigger type (this triggers the event on frame onset). Based on your experimental design, you may specify a different trigger. - Click
Next
.
Step 3: Set up Action to Group and Store Items
First, we need to add all the score values inside a single varriable. For that, we will need an Array.
Click Add Action
→ Array Operations
→ Add/Remove Array Entries
.
Click the link icon and then click Add Variable
. Now define the variable as follows:
Name:
Total Items (or something unique).Format:
ArrayData Type:
Numeric
Click OK
.
In the action now, continue to:
- Set Index Type as
End of Array
. - Insert (
+
) the respective item variables (e.g.,Q1
,Q2
,Q3
,Q4
).
Step 4: Set up Action to Sum the Array for Total Score
Click Add Action
→ Variable Actions
→ Math & Statistics
.
For the action, specify:
- Type:
Array Operations
- Operation:
Sum
- Input Array:
Total Items
(the array you created earlier) - Output Array:
- Click the link icon.
- Choose
+ New Variable
and specify its parameters:- Name: Total Score (or any other unique name)
- Set Format: Array, Data Type: Numeric.
That’s it! You now have a single score calculated by summing up the scores of four questions together.