03-28-2017 03:06 PM - edited 03-28-2017 03:06 PM
I need to generate a complicated table regarding race, age group, education and their scores. I need to do analysis first. So usually I would use sas to generate output and copy and paste in excel, and then present in a powerpoint or excel or word document.
I know someone can directly use SAS to do that, I would like to get advice from you if you can do that
if you need a sample data set, I have attached one. So previoulsy I need to generate five tables and then do copy and paste into one single table. If anyone can help to genearte the big table using SAS, please share.
03-28-2017 03:13 PM
03-28-2017 03:25 PM
Search LexJansen.com for sample code for either 'demographic' table or clinical reports. Your output looks similar though its hard to tell what you're actually trying to do.
SAS is capable of creating very complex reports, but its not necessarily easy to do.
It looks like just a big count table, so I have some code here that shows how to generate this in one table:
There's a worked example at the end that shows how to use the macro.
03-28-2017 04:32 PM
Thank you. If I want to calculate realtive risk and 95%Ci instead of chisq, how and where I should replace, using your code as a template?
table &varcross/chisq out=temp1;
ods output OneWayChiSq=chisq;
set chisq (where=(Statistic="Chi-Square") keep=prob statistic rename=(prob=chisq));
03-28-2017 04:36 PM
Yes, you can change the ODS output to capture the data required and to report that instead.
If you're making changes, I suggest making one change, check if it works and then go forward step by step to change it to what you need.