Total score hidden (not appearing) if skip pattern is used in a 9 item questionnaire

Hello ODK forum,
I am new to ODK and was developing a form. My tool consists 9 items. Each item has preceding 9 Yes/No questions. If the screening (preceding) question is "No", each of the 9 main (follow up) questions will be skipped. I can't visualize total score from 9 questions if at least one is skipped, and the next question that depends based on the total score is not appearing due to total score is not generated. Any solution please?odk_checking sheet25.xlsx (16.8 KB)

Hi @kiefdag

I assume you are assigning a value of 1 to Yes and 0 to No in your responses and then adding up the values to get a total score.

Are your screening questions mandatory? To avoid skipping screening questions I would suggest making the screening questions mandotory.

The community will be in a better position to assist if you can share your form or a subsection of the form that is not working. Please also describe your use case in detail if possible provide information on what you have done, what you expected and what you got.

Hello @kiefdag,

Any summation or calculation process that refers to a skipped question might not give you expected results simply because there is no value to complete the calculations. The function coalesce() helps you fill alternative answer for missing/skipped question

Assuming you have variables var1 and var2 to be summarized using addition as a result of var3 you will add this pattern coalesce(${var1},0) + coalesce(${var2},0) in the calculation column of variable var3

You notice the zero put after comma in coalesce construct, that can be any value you want to consider in lieu of missing or skipped answers. This will always give you a score even if your 9 questions are all skipped

Give it a try .. hopefully it solves the issue

Happy ODKing,

Jules R

Thank you @Ronald_Munjoma, you are right responses are 1 = yes, 0 = no for primary questions; and 1 = several days, 2 = more than half the days, 3 = nearly every day for main questions that total score is needed. I am sharing the sample data for more help.

Hi @jules_rugwiro. I have tried it, but can't do that, may be I am not sure if I am correct. As an example I tried for question 9 and add it with all other variables to see if it works. here what I tried on the calculation column of interest ==>
${phq1} + ${phq2} + ${phq3} + ${phq4} + ${phq5} + ${phq6} + ${phq7} + ${phq8} + ${phq9} + coalesce(${phq9},0).
For your information, responses are are 1 = yes, 0 = no for primary questions; and 1 = several days, 2 = more than half the days, 3 = nearly every day.
I also tried to convert null to zero on defaults [attempted manually filling "0", and ${phq9} = 0 each at once?? I am not sure its fine for default value...but still doesn't calculate 0 and doesn't bring score].

Hi @kiefdag

I did code something similar years back it was for depression randomised controlled trial. I will upload my form when on the computer

That is great and that might help more @Ronald_Munjoma.

Hi @kiefdag

The PHQ9 is a validated tool and as such you have to present the questions to the client as they are in the original tool, unless you have adapted and validated your adaption.

According to the PHQ 9 scoring rubric each of the 9 items can be scored from 0 (not at all) to 3 (nearly every day. The PHQ-9 score can range from 0 to 27

I have coded the XLSForm for you. I cleaned your choices sheet and changed the English text to the validated text.

odk_checking sheet25.xlsx (13.8 KB)

Dear @Ronald_Munjoma, I appreciate for your time and energy, devoting to help me. I am very surprised to share what I know that @Friendship_Bench is Zimbabwe's well known mental health study by Prof. Dixon Chibanda (I am fellow by Chibanda et al project).
On to my problem, you rightly converted well what I was thinking finally. PHQ9 is a bit validated here in Ethiopia for respondents to understand well. The first option (not at all) is omitted from the original version and replaced by screening question to be (Yes/No), and main questions (phq1-phq9, follow up questions) will be asked based on previous yes/no response. If the answer is No for primary questions, follow up questions will not be asked. That is why calculation becomes difficult. As an example:
Phq1_screening: Little interest or pleasure in doing things? response: Yes (1), No (0)
Phq1 (part of total score, main question): If yes to previous question, how often did you feel during those two weeks? response: Several days (1), More than half the days (2), Nearly every day (3). So, not at all (0) from original version is omitted here and replaced by screening question Yes (1), No (0).
I have seen SSQ14, and its made ready to be asked for all eligible participants, e.g., male only (right?) and if response is not male, survey ends (?) and seems there is no skip interference for summation as survey it doesn't apply for females?
We will see if others have a solution for the type of mine Yes/No (screening) followed by other questions (skipped if No), and the total score could be generated. coalesce(${var1},0) or default (null to zero) attempted and didn't work.
Further clarity from @Ronald_Munjoma: to be more sure if you could drop more suggestion (I have seen in your form), I am not using "Groups" totally in my ODK form as a response out of one group might affect responses in another group. Does it matter if I don't apply groups?
*I am not clear of using ==> selected(${gender}, '2') OR ${gender} = 2 (in your form)? as I am using the later one, ${gender} = 2, in my form.

What I understand finally is using the original version type of PHQ9 as you recommended for this ODK form as far as it doesn't affect the responses.
Really, thank you @Ronald_Munjoma

I will give a look to the form you shared, but before doing so, your calculations looks like it's repeating phq9

Use the below instead. just removed the duplicate, Hoping it's the only question with skips set on it otherwise all variables should be wrapped in coalesce()

${phq1} + ${phq2} + ${phq3} + ${phq4} + ${phq5} + ${phq6} + ${phq7} + ${phq8} + coalesce(${phq9},0)

Best regards,
Jules R

Hi @kiefdag

You are most welcome

Its been a while since i last worked Prof Chibanda.

In my opinion you are complicating things. In the primary questions Not at all (the equivalent of No in your screening question) is assigned a weight of 0 which is the same weight you are assigning to the NO response. Why not then administer the PHQ9 in its original validated format?

Here is the form coded the way you want : odk_checking sheet25 (1).xlsx (15.3 KB)

I have tried it but doesn't work. The best option is avoiding skipping pattern and using an option recommended by @Ronald_Munjoma. You can see the form if you can experiment it.
Thanks indeed @jules_rugwiro!

Thumbs up!! @Ronald_Munjoma!! It works but was struggling to understand how you came up with type/name combination. Now, I can prefer the easiest one suggested by you. Its a big solution for such similar issues to my whole large questionnaire which is under formation.

@jules_rugwiro, you were right coalesce() made it but I was wrong writing correct type, name and choices that @Ronald_Munjoma tried his all best troubleshoots and it worked!!

Thank you brothers!!

1 Like