10-08-2015 07:38 PM
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!
10-09-2015 05:32 AM
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.
10-11-2015 06:09 PM - edited 10-11-2015 06:44 PM
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!
10-11-2015 07:12 PM - edited 10-11-2015 07:13 PM
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.