How to creat logic files for a multiple question
-
- Posts: 20
- Joined: December 12th, 2011, 12:00 pm
Re: How to creat logic files for a multiple question
10 years ago to work in CSPro and thought that you have knowledge about it, but if I send an email I sent him the attached program.
regards
Maria
regards
Maria
-
- Posts: 20
- Joined: December 12th, 2011, 12:00 pm
Re: How to creat logic files for a multiple question
Here is the application, I hope you help ..
Greetings.
Maria
Greetings.
Maria
- Attachments
-
- prueba.zip
- multiple options
- (45.78 KiB) Downloaded 632 times
-
- Posts: 16
- Joined: March 19th, 2012, 11:14 am
Re: How to creat logic files for a multiple question
Thanks for your great help, running section displays very nice but i found some problems, you can make a double check.
One option can receive multiple choices
For example: When i pressed 1 that means option "delay pregnancy" was marked and program displayed like 1 _ _ _ _, beautiful. But when i continue pressing 1 and the program displayed like this 1 1 _ _ _, so that means option "Delay pregnancy" can receive 2 choices at 2 time pressing number 1, and so on.
As you know, 1 option of a multiple choice question just only receive 1 value, that mean if we press 1 for 2 times and then we have to reenter it.
Frankly, i always use epidata for enter data and data management and this is the first time i have used CSpro so, that is its commands (statements) make me so confused.
Best,
Dung
One option can receive multiple choices
For example: When i pressed 1 that means option "delay pregnancy" was marked and program displayed like 1 _ _ _ _, beautiful. But when i continue pressing 1 and the program displayed like this 1 1 _ _ _, so that means option "Delay pregnancy" can receive 2 choices at 2 time pressing number 1, and so on.
As you know, 1 option of a multiple choice question just only receive 1 value, that mean if we press 1 for 2 times and then we have to reenter it.
Frankly, i always use epidata for enter data and data management and this is the first time i have used CSpro so, that is its commands (statements) make me so confused.
Best,
Dung
-
- Posts: 20
- Joined: December 12th, 2011, 12:00 pm
Re: How to creat logic files for a multiple question
It is true that the program lacks more settlement, but as the intention was only to show the option of multiple options to pass it so, I have other programs including the use of census in the PDA in which use multiple options and work perfectly , maybe you need to follow a course of CSPro if interested.
Best regards.
Best regards.
-
- Posts: 16
- Joined: March 19th, 2012, 11:14 am
Re: How to creat logic files for a multiple question
Thank a lot for your help and advice.
Best,
Dung
Best,
Dung
-
- Posts: 1793
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: How to creat logic files for a multiple question
Unfortunately, CSPro is not as good at addressing multiple-checkbox questions as some other software packages. This is something that we are going to address in the new CSPro, version 5, that will come out in a couple months.
But for now, you generally have two options when you want to create such a question:
1) The alphanumeric option with a value set and using extended controls. This will show the user a window and they can click on the applicable values. If the user keys the values though, they will be able to enter 1 twice, which is what you're trying to avoid.
2) Making this question a repeating item (that repeats five times in your example), and the keyer enters 1 for Yes, and 2 for No. This will prevent the above scenario, but is behavior that won't necessarily match the way the question was asked on your questionnaire.
I am not describing these in depth because you can look at the attached application and play with both behaviors.
To address your concern about the keyer entering 1 twice, you can use logic to ensure that no value is entered twice, but this logic will only be executed after they have moved past the field, so it will prevent them from moving on with 1 in the field twice, but it will allow them to temporarily type 1 twice.
Again, see the attached application.
But for now, you generally have two options when you want to create such a question:
1) The alphanumeric option with a value set and using extended controls. This will show the user a window and they can click on the applicable values. If the user keys the values though, they will be able to enter 1 twice, which is what you're trying to avoid.
2) Making this question a repeating item (that repeats five times in your example), and the keyer enters 1 for Yes, and 2 for No. This will prevent the above scenario, but is behavior that won't necessarily match the way the question was asked on your questionnaire.
I am not describing these in depth because you can look at the attached application and play with both behaviors.
To address your concern about the keyer entering 1 twice, you can use logic to ensure that no value is entered twice, but this logic will only be executed after they have moved past the field, so it will prevent them from moving on with 1 in the field twice, but it will allow them to temporarily type 1 twice.
Again, see the attached application.
PROC BENEFITS_CHECKBOX
numeric ctr;
do ctr = 1 while ctr < 5
if BENEFITS_CHECKBOX[ctr:1] in "1":"5" and pos(BENEFITS_CHECKBOX[ctr:1],BENEFITS_CHECKBOX[ctr + 1]) then
errmsg("You have entered %s more than once!",BENEFITS_CHECKBOX[ctr:1]);
reenter;
endif;
enddo;
numeric ctr;
do ctr = 1 while ctr < 5
if BENEFITS_CHECKBOX[ctr:1] in "1":"5" and pos(BENEFITS_CHECKBOX[ctr:1],BENEFITS_CHECKBOX[ctr + 1]) then
errmsg("You have entered %s more than once!",BENEFITS_CHECKBOX[ctr:1]);
reenter;
endif;
enddo;
- Attachments
-
- breastfeedingBenefits.zip
- (3.25 KiB) Downloaded 584 times
-
- Posts: 16
- Joined: March 19th, 2012, 11:14 am
Re: How to creat logic files for a multiple question
Thanks a lot Martin, i will try it and then feedback to you.
best,
Dung
best,
Dung
-
- Posts: 16
- Joined: March 19th, 2012, 11:14 am
Re: How to creat logic files for a multiple question
Dear Martin and Marialange,
Firstly, thank you two guys for helping me. Now, i myself made a logic file for my example, however, there is a barrier that i still can not overcome so could you please take a look at it for me? In this attached file, my logic file is quite diffirent camparing with both of you.
The point is when a respondent decided to choose 2 sub-options (1 and 3) in total 5 sub-options, meaning that we type number 1 and 3 and then to finish the question we type "00" (you will see programming system in my attached file). But the rest of sub-options that respondent did not choose are emty and they are counted as missing when we export to SPSS sofware. Therefore, i am wondering that can we set automatically not chosen sub-options as 0 after typing "00"?
I am looking forward to hearing from you.
Best,
Dung
Firstly, thank you two guys for helping me. Now, i myself made a logic file for my example, however, there is a barrier that i still can not overcome so could you please take a look at it for me? In this attached file, my logic file is quite diffirent camparing with both of you.
The point is when a respondent decided to choose 2 sub-options (1 and 3) in total 5 sub-options, meaning that we type number 1 and 3 and then to finish the question we type "00" (you will see programming system in my attached file). But the rest of sub-options that respondent did not choose are emty and they are counted as missing when we export to SPSS sofware. Therefore, i am wondering that can we set automatically not chosen sub-options as 0 after typing "00"?
I am looking forward to hearing from you.
Best,
Dung
- Attachments
-
- Example.rar
- (3.31 KiB) Downloaded 593 times
-
- Posts: 1793
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: How to creat logic files for a multiple question
Could you write this:
PROC A
if $ in 1:5 then
if A1($) = "1" then A1($) = " ";
else A1($) = "1";
endif;
reenter;
elseif $ = 0 then
numeric ctr;
do ctr = 1 while ctr <= 5
if A1(ctr) = " " then
A1(ctr) = "0";
endif;
enddo;
skip to B;
endif;
if $ in 1:5 then
if A1($) = "1" then A1($) = " ";
else A1($) = "1";
endif;
reenter;
elseif $ = 0 then
numeric ctr;
do ctr = 1 while ctr <= 5
if A1(ctr) = " " then
A1(ctr) = "0";
endif;
enddo;
skip to B;
endif;
-
- Posts: 16
- Joined: March 19th, 2012, 11:14 am
Re: How to creat logic files for a multiple question
OMG! Awesome Martin, it worked well, thanks so much for your help.
Best,
Dung
Best,
Dung