08-22-2011 03:16 AM
Current Residence Status
Applicants (per cent)
Hi, the above is what I get when I perform the proc report:
TITLE 'Table 4.1:Characteristic Analysis:&var';
ods rtf file="reportstyles.html" style=Journal;
proc report data=vha_acr.graph_curr_resistatus nowd
style(header) = [font=(Arial,3) just=center]
style(report) = [font=(Arial,2) borderwidth=1 CELLSPACING=5 just=center WIDTH=1000]
style(column) = [font=(Arial,2)just=center];
define Good / computed;
column ('&var' curr_resistatus total_bad Good count bad participants Index);
rbreak after / summarize UL OL;
ods rtf close;
I want to define a new numeric variable called good defined by good=count-total_bad;
How would you do this? When I try to do it, I keep getting 0 for all entries and SAS says
total_bad is uninitialised.
I am also trying to put a label called "total" in the last row of the column Current Residence Status.
08-22-2011 10:24 AM
There are many previous forum postings on the use of PROC REPORT. To get TOTAL on the last summary line of your report, you will need a COMPUTE AFTER section. You will also need to look up "left-to-right" processing with PROC REPORT (also in previous postings), and you will need to look up how to use a COMPOUND name. For example, if for some silly reason, I wanted to subtract AGE from HEIGHT for SASHELP.CLASS, and I did NOT have any DEFINE statements for either AGE or HEIGHT, the default usage of those variables would be ANALYSIS with the SUM statistic. The COLUMN statement and COMPUTE block using the compound name for calculating the difference would be:
column name sex height age diff;
diff = height.sum - age.sum;
In the COLUMN statement, DIFF would have to appear after HEIGHT and AGE in the COLUMN order and then the compound name:var.statistic would need to be used.