08-27-2013 05:10 PM
Looking for a way to insert a row above each section of a table. For example, a table can have Races and Age groups like this:
In the report, I'd like to display this:
R A C E
A G E G R O U P
Appreciate any suggestions.
08-27-2013 05:29 PM
Tables are all generated outside of PROC REPORT using SQL, FREQ, MEANS, etc. It's for the demographics table of a manuscripts with predictors as rows, groups as columns, Ns, p-values, etc. At the moment, I am only interested in making the output prettier and removing the manual step of adding the section headings. I don't think what I am looking for can be made entirely in PROC REPORT or any one procedure for that matter.
08-27-2013 06:27 PM
Proc Tabulate actually does similar to what you want.
Take a look at the output from:
proc tabulate data=sashelp.class;
table sex age,
But without some details of what your data looks like and what you have tried, we can't get much further.
Summarized data can be displayed using FILE Print and Put statements in a data step if you need something other than "simple" tables, but again we need to know what the data looks like.
08-27-2013 07:09 PM
Without more specifics it's hard to say what approach to follow. Adding a "space" between the header/column names and the rest of the table is doable -- all depends on the approach(es) you are using.
08-28-2013 08:23 AM
And thought I was as clear as it gets
Here's the code for full table as well as a PROC REPORT I am currently using--it's a standard table 1 from any medical journal:
input Variable $;
N1 = ranuni(0); N2 = ranuni(0);
Group1 = put(ranuni(0),8.2); Group2 = put(ranuni(0),8.2);
proc report data=have;
column ('Predictor' Variable)
('Number of Patients' N1 N2)
('Mean/STD' Group1 Group2)
define Variable / display '';
define N1 / display center;
define N2 / display center;
define Group1 / display center;
define Group2 / display center;
define Pval / display center '';
Output is the table below (for some reason the (headers are cut off but they don't matter). At the moment I am typing the bold category headings manually and would like to automate it. Tried COMPUTE BEFORE but got lost.
|Other Pt Variables|
08-28-2013 09:26 AM
This paper has several examples of this type of demographic report.
In addition if you search PharmaSUG papers at lexjansen.com, you should find more examples.
08-29-2013 04:53 AM
You can use the COMPUTE BEFORE with a LINE statement to do something like this, see sample code below. For the grouping you need a new variable which is not shown in the report but needed to have "break lines".