Page 1 of 1

CONVERTING CHECKBOX RESPONSES INTO YES NO ANSWERS

Posted: March 29th, 2022, 1:36 pm
by Katyetye
Hi forum members!
Need assistance on how to convert checkbox responses from MULT RECORDS into "Yes/No" answers.
Understandably for a singly occ record I could apply the following logic in a batch program to convert into yes/no answers. However in a mult record indeed I need your help.

string code = "ABCDEFGHXY";
do numeric i = 1 while i <= length($)
insert(PERSON_EDT(i));
if ischecked(code[i:1], $) > 0 then
X(i) = i;
Y(i) = 1; errmsg("Yes");
else
X(i) = i;
Y(i) = 2;
endif;
endif;
enddo;

e.g. Items in a roster below how does it work to convert checked/unchecked responses into yes/no answers?

Person # Chkd Answers
1 ABC (Yes/Yes/Yes
2 B (No,Yes,No)
3 C (No,No,Yes)

Best to you all guys,

Saidi

Re: CONVERTING CHECKBOX RESPONSES INTO YES NO ANSWERS

Posted: March 30th, 2022, 11:09 am
by htuser
Dear Saidi,
Josh helped me years ago (even before having the native isChecked function) to solve this issue. There's a sample, part from an old survey (nearly four years ago).
The way is to create subitems (or Items) from the main checkbox question. In subitems (items) each question must have Yes/No valuesets.
And used Ischecked (estChoisi user defined function in the sample) to populate them.
It's a time consuming process. It's why, years ago, i requested this
CSPro Designer/CSPro Dictionary Engine: Automatically create subitems for checkbox response (split a multiple response (checkbox) to discrete variables) viewtopic.php?f=1&t=2114 / viewtopic.php?f=1&t=832
It will be very important to parse checkbox in subitems with Yes/No for each checkbox elements. We can't perform serious analysis without parsing actual CSPro checkbox. And, actually it's very time consuming to do this manually.
But, it's not yet implemented.

My example and comments are in french and creole.
Please help me know if this explanation is clear for you.

Best,
CheckboxToDichotomy.zip
CheckboxToDiscreteVariables
(4.33 KiB) Downloaded 122 times

Re: CONVERTING CHECKBOX RESPONSES INTO YES NO ANSWERS

Posted: March 31st, 2022, 6:56 am
by Katyetye
Dear htuser,

To some extent the explanation is clear, so let me workaround to see whether I will able to implement it.

Thank you very for your kid support.

Best,

Saidi