BookmarkSubscribeRSS Feed
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!

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.

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!

Opal | Level 21


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.



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg



Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 3 replies
  • 3 in conversation