BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
GregBond
Obsidian | Level 7

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!


1 ACCEPTED SOLUTION

Accepted Solutions
data_null__
Jade | Level 19

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.

View solution in original post

7 REPLIES 7
data_null__
Jade | Level 19

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.

GregBond
Obsidian | Level 7

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

GregBond
Obsidian | Level 7

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 q141r2

Kidney problems q141r3

Lung problems

Heart problems

Blood vessels problems

Stomach, intestine or liver problems

Muscle, bone, and joint problems

Skin problems

Diabetes

Cancer

Mental health problems

I don't have any health problems other than lupus

TOTAL RESPONSES

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

Haikuo
Onyx | Level 15

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

new=max(of q141r1 q141r2 q141r3);

or for more information to use:

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

GregBond
Obsidian | Level 7

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

GregBond
Obsidian | Level 7

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

data_null__
Jade | Level 19

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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