I encountered some problems when generating a report table. I want generating a table in such form (left). But I can only get the form on the right. Here are my codes: data tmp;
input num var $ value group count f $ p $;
cards;
1 LMRN 0 1 0 NA NA
1 LMRN 0 2 0 NA NA
1 LMRN 1 1 72 NA NA
1 LMRN 1 2 72 NA NA
2 LMLN 0 1 0 - 1.0000
2 LMLN 0 2 1 - 1.0000
2 LMLN 1 1 72 - 1.0000
2 LMLN 1 2 71 - 1.0000
3 YYRN 0 1 1 0.6220 0.6220
3 YYRN 0 2 3 0.6220 0.6220
3 YYRN 1 1 70 0.6220 0.6220
3 YYRN 1 2 69 0.6220 0.6220
4 YYLN 0 1 2 1.0000 1.0000
4 YYLN 0 2 2 1.0000 1.0000
4 YYLN 1 1 69 1.0000 1.0000
4 YYLN 1 2 70 1.0000 1.0000
5 YZRN 0 1 61 0.4601 0.4601
5 YZRN 0 2 64 0.4601 0.4601
5 YZRN 1 1 11 0.4601 0.4601
5 YZRN 1 2 8 0.4601 0.4601
6 YZLN 0 1 58 1.0000 1.0000
6 YZLN 0 2 58 1.0000 1.0000
6 YZLN 1 1 14 1.0000 1.0000
6 YZLN 1 2 14 1.0000 1.0000
7 HMRN 0 1 0 NA NA
7 HMRN 0 2 0 NA NA
7 HMRN 1 1 72 NA NA
7 HMRN 1 2 72 NA NA
8 HMLN 0 1 0 NA NA
8 HMLN 0 2 0 NA NA
8 HMLN 1 1 72 NA NA
8 HMLN 1 2 72 NA NA
;
run;
proc format;
value group_label 1="Group1"
2="Group2";
value value_label 0="N"
1="F";
run;
proc report data=tmp split="|" spanrows style(column)={just=center};
column var value (count,group f p n);
define var/group order=data;
define value/group descending format=value_label.;
define group/across order=internal format=group_label. '';
define count/"";
define n/noprint;
define f/group 'F' style(column)={vjust=m};
define p/group 'P value' style(column)={vjust=m};
run;
... View more