Hi: Nobody can run your code because you did not provide your format for "variable". Also, I'm having a hard time with your PROC REPORT output because I don't see how the code you've posted could have produced the output you've posted. The column headers don't look right. And, it's not clear to me why you have so many -2 values for NEWRACE and SEX. And this description of what you want "I want sex alone to be grouped together as race alone is grouped before showing sex*race." doesn't make sense to me. You have both SEX and NEWRACE in your column statement so that's what you'll get on the final report. If you want a report that shows sex only or a report that shows newrace only, then that would be a different PROC REPORT step because your column statement would have to change. Here's what I think you want (I used SASHELP.CLASSFIT to make some FAKE data.)
Here's the code I used:
data fakedata;
length variable $10;
set sashelp.classfit;
where age in (12, 13, 14);
do variable = 'Insured', 'Uninsured';
output;
end;
run;
proc report data=fakedata;
column sex variable, (predict height weight);
define sex / group;
define variable / across;
define predict / mean;
define height / mean;
define weight / mean;
run;
proc report data=fakedata;
column age variable, (predict height weight);
define age / group;
define variable / across;
define predict / mean;
define height / mean;
define weight / mean;
run;
proc report data=fakedata;
column sex age variable, (predict height weight);
define sex / group;
define age / group;
define variable / across;
define predict / mean;
define height / mean;
define weight / mean;
run;
Cynthia
... View more