Solved
Contributor
Posts: 26

# Determining the number of subjects who chose from select all that apply question

Hopefully this wont confuse those who attempt to help...

Here is the question:

variable names in "(  )"

X% of persons with lupus receiving corticosteroids (q131) reported having at least 1 co-morbidity (q141r1 q141r2 q141r3......)other than lupus; of which X% had at least one outpatient visit with a healthcare provider in the past three months (q111), X% were admitted at least once to the hospital in the past 12 months (q115), and X% have been to the emergency room at least once in the past 12 months (q118).

I suppose I have to make q141r1 q141r2... into one variable then run a crosstab, but I'm not entirely sure.

Any suggestions? Thanks!

Accepted Solutions
Solution
‎04-18-2014 11:20 AM
Posts: 3,852

## Re: Determining the number of subjects who chose from select all that apply question

I usually use PROC SUMMARY when I have binary data: n=Denom sum=Count mean=percent.  You can also use PROC TABULATE but the output from tabulated is not suited to the arcane requirements of my reporting environment, so I use PROC REPORT.

The variable labels are the row labels with the stats displayed in columns defining groups if necessary.

I would be easier to give you ideas about how you might do it if you supplied some sample data that more or less realistically models your actual data.

All Replies
Posts: 3,852

## Re: Determining the number of subjects who chose from select all that apply question

It could be as simple as

new=max(of q141r1 q141r2 q141r3);

assuming numeric 0/1 variables.  Example and details of your data will make it easier to determine exactly.

Contributor
Posts: 26

## Re: Determining the number of subjects who chose from select all that apply question

Posted in reply to data_null__

Thank for your response!

You are correct in that the data are binary 0/1. Essentially, i need to find out if any patients reported not having a comorbidic condition which are listed (check all that apply) as q141r1 q141r2 q141r3.... and are 0=no 1=yes. Hope this helps and thanks again!

Regards,

Greg

Contributor
Posts: 26

## Re: Determining the number of subjects who chose from select all that apply question

 In addition to having XXXX; have you ever been told by a healthcare provider that you have:            Eye problems more than needing glasses q141r1 Brain or spinal cord problems q141r2Kidney problems q141r3Lung problems Heart problems Blood vessels problems Stomach, intestine or liver problems Muscle, bone, and joint problems Skin problems DiabetesCancerMental health problems I don't have any health problems other than lupusTOTAL RESPONSES

I would need to know how to tell if an individual patient did not chose any of these items.

Posts: 3,167

## Re: Determining the number of subjects who chose from select all that apply question

The answer from should work for your problem if they are binary:

new=max(of q141r1 q141r2 q141r3);

new=sum(q141r1, q141r2, q141r3);

So when new=0 meaning the patient has not chosen any of these options, and the value of 'new' indicates how many options have been selected.

Haikuo

Contributor
Posts: 26

## Re: Determining the number of subjects who chose from select all that apply question

Thanks for you help Haikuo!

There are 827 people in the dataset

I ran the following code and had a question as to how I can tell the percentage of people who did no chose one answer. Notice in the output there are 11 variables when the code there are 13 because two options must be '0'.

data work.pwl_spss;

set work.pwl_spss;

new2=sum(q42r1 , q42r2 , q42r3 , q42r4 , q42r5 , q42r6 , q42r7 , q42r8 , q42r9 , q42r10 , q42r11, q42r12 , q42r13);

run;

proc freq data=work.pwl_spss;

tables new2;

run;

and got the following output...

The FREQ Procedure

new2 Frequency      Percent      Cumulative Frequency      Cumulative Percent

1      110                13.30           110                                         13.30

2      100                12.09           210 2                                        5.39

3      134                16.20           344                                         41.60

4      118                14.27           462                                         55.86

5       129                15.60           591                                         71.46

6          92                11.12           683                                         82.59

7      69                     8.34           752                                              90.93

8      37                     4.47           789                                        95.41

9      24                     2.90              813                                    98.31

10      10                1.21                  823                                    99.52

11      4                    0.48                827                                    100.00

Contributor
Posts: 26

## Re: Determining the number of subjects who chose from select all that apply question

NVM Haikuo, I seemed to have figured out the issue, thank you for your assistance!

Solution
‎04-18-2014 11:20 AM
Posts: 3,852

## Re: Determining the number of subjects who chose from select all that apply question

I usually use PROC SUMMARY when I have binary data: n=Denom sum=Count mean=percent.  You can also use PROC TABULATE but the output from tabulated is not suited to the arcane requirements of my reporting environment, so I use PROC REPORT.

The variable labels are the row labels with the stats displayed in columns defining groups if necessary.

I would be easier to give you ideas about how you might do it if you supplied some sample data that more or less realistically models your actual data.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
• 7 replies
• 320 views
• 8 likes
• 3 in conversation