BookmarkSubscribeRSS Feed
mbell7
Calcite | Level 5

Hello - I am new to using proc report. I am trying to figure out how to put multiple group variables in the same column. The task: I have 5 binary exposure variable and 5 binary outcomes. All of which I want stratified by gender. I have gender like this "define gender / group;". So withing gender I want the 5 binary exposure variables stacked on top of each other as grouping variables. All I am interested number-wise is the frequencies of the outcomes by the exposure variables, which is stratified by gender.

 

Any help would be greatly appreciated! Thanks!

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Sorry, I can't visualise it.  Post examplpe of data you have (datastep prefereably), and required output.  I tend to create a dataset up front which looks like the output I want, then do a simple report on that.

mbell7
Calcite | Level 5
title "Table 2. Survey Response Categories and OA Status for Knee, Hand, Foot, and 
Cervical Spine (C-Spine) by Gender and Includes Mean (Standard Deviation)of Age and BMI"; columns H1_SEX H1_Q63 X1_KL_Rhand_CMC X1_KL_Rfoot_MTP X1_KL_Rknee X1_KL_C_spine
H1_AGE1, (mean std) BMI, (mean std)
/*H1_Q64 H1_Q62VAR4 H1_Q62VAR5 H1_Q62VAR6*/; define X1_KL_Rhand_CMC / across order=internal; define X1_KL_Rfoot_MTP / across; define X1_KL_Rknee / across; define X1_KL_C_spine / across; define H1_SEX / group; define H1_Q63 / group; define H1_AGE1 / format=4.1; define BMI / format=4.1; run;

Thank you for the reply. I have SAS code above and attached a picture of the table I am trying to create. I basically want a table that displays all of the 2x2 contingency tables for 5 exposures and 4 outcome variables, stratified by gender. I am able to get the 4 outcome variables to appear correctly. I then group/stratify by age. However, the next step of getting the exposure variables to appear in the same column is the tricky part for me. When I click group, the report is trying to group with-in each group variable and not just with-in gender alone.

 

Thanks again for the input!


tbl.png
Patrick
Opal | Level 21

@mbell7

You will get the best and most answers if you also post some sample data which works with your Proc Report. This way people can actually test and verify what they propose and you'll have a good chance to get fully working code as answer.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 732 views
  • 0 likes
  • 3 in conversation