03-26-2018 12:31 PM - edited 03-26-2018 12:33 PM
I'm trying to change the appearance for the columns in my report
I used this code
proc report data=table4;
column Readable_Time_Points case_assigned Time_points_read Time_points_complete off_study off_study_total Time_Points_Pending ;
define Readable_Time_Points/ "Readable Time Points";
define case_assigned/ "Cases Assigned";
define Time_Points_Pending/ "Time Points Pending";
define off_study/ "Off_study cases requiring adjudication";
define off_study_total/ "Total cases completed(off_study)";
and this is my current result
Readable Time Points
|Cases Assigned||Time_points_read||Time_points_complete||Off_study cases requiring adjudication||Total cases completed(off_study)||Time Points Pending|
and this is the result that I aim for or something simillar
|Time Points Read/Complete: (Complete reads/Contracted)||29||300||9.7%|
|Readable Time Points:||9|
|Time Points Pending||7|
|Off-study cases requiring adjudication:||0|
|Total cases completed (off- study):||0|
03-26-2018 02:19 PM
Proc report doesn't like to mix values within a single column unless it is a summary of the column. It might be possible to generate some of that output with Proc tabulate as it will allow mixing columns a bit but does get picky about what needs to be included to do summaries and it appears that your desired result may not be practical (without data it is hard to tell).
If you provide example input data in the form of a data step you might get a tested solution.
03-26-2018 02:44 PM
You could re-arrange the data in a data step before PROC REPORT, which would then allow PROC REPORT to do different things than it normally does. So the only thing PROC REPORT would do is to create a table, it would not be doing the analysis of the data.
Nevertheless, this would take a bit of work in the data step to get PROC REPORT to produce the final report as you want it.
03-26-2018 11:42 PM
03-27-2018 08:11 AM - edited 03-27-2018 09:41 AM
Since you haven't shown us your data, we can only guess at what you have, and so I would say you could create code that looks something like this (not a complete example)
data table5; set table4; length type $ 16; value=readable_time_points; type='COL1'; output; value=cases_assigned; type='COL1'; output; value=time_points_read; type='COL1'; output; value=time_points_complete; type='COL2'; ouptut; run; proc report data=table5; columns value type; define type/across; run;
03-27-2018 10:08 AM - edited 03-27-2018 10:11 AM
There is a mistake in what I wrote, which should say
data table5; set table4; length type $ 16 label $ 24; label='readable_time_points'; type='COL1'; value=readable_time_points; output; label='cases_assigned'; type='COL1'; value=cases_assigned; output; label='time_points_read_complete'; type='COL1'; value=time_points_read; output; label='time_points_read_complete'; type='COL2' value=time_points_complete; ouptut; run; proc report data=table5; columns label type,value; define type/across; define value/analysis sum; run;
I have not much to go on, as you haven't shared a reasonable subset of your data so we can see what it looks like.
Now, you show us a reasonable portion of your data in table4.
03-27-2018 11:37 AM
Here is a very old school approach:
data garbage; input Readable_Time_Points case_assigned Time_points_read Time_points_complete off_study off_study_total Time_Points_Pending ; datalines; 9 7 29 300 0 0 9 ; run; data _null_; set garbage; file print; rate= Time_points_read/Time_points_complete; put @1 "Time Points Read/Complete: (Complete reads/Contracted)" @56 Time_points_read @60 Time_points_complete @65 rate percent7.1 ; put @1 "Readable Time Points:" @56 Readable_Time_Points ; put @1 "Cases Assigned:" @56 case_assigned ; put @1 "Time Points Pending" @56 Time_Points_Pending ; put @1 "Off-study cases requiring adjudication:" @56 off_study ; put @1 "Total cases completed (off- study):" @56 off_study_total ; run;