标签:style blog color os io for re c
PROC TABULATE的一般形式:(主语与FREQ过程不同,这里是table 语句,不是tables)
1 PROC TABULATE FORMAT=options;/*FORMAT=选项改变table中所有cell的格式*/ 2 VAR analysis-variable-list; 3 CLASS classification-variable-list;/*在下面table语句中出现的变量必须预先在VAR语句或CLASS出现过*/ 4 TABLE page-dimension, row-dimension, column-dimension/BOX=option MISSTEXT=option; 5 /*BOX=选项指定输出的tabulate报表的左上角的空格内的句子;MISSTEXT=选项赋特定的值给空的data cells*/ 6 RUN;
特别要注意的是:
1 concatenating: simply list them separated by a space; 2 crossing: list variables或keywords separated by an *; 3 grouping:将变量或关键字列表在括号内
1.keyword ALL is generally concatenated;
2. To request other statistics, cross the keyword with the variable name.
例子:
1 DATA boats; 2 INFILE ‘C:\Myrawdata\boat.dat‘; 3 INPUT Name $ 1-12 port $ 14-20 Locomotion $ 22-26 Type $ 28-30 price 32-36; 4 RUN; 5 *Changing headers; 6 PROC FORMAT;/*若想改变CLASS变量的值做的标题,step1:通过此FORMAT语句定义新格式*/ 7 VALUE $typ ‘cat‘=‘Catamaran‘ 8 ‘sch‘=‘schooner’ 9 ‘yac‘=‘yacht‘; 10 RUN; 11 12 PROC TABULATE DATA=boats FORMAT=DOLLAR9.2; 13 CLASS Locomotion Type; 14 VAR Price; 15 Format Type $ typ.; 16 TABLE Locomotion=‘‘ ALL, /*改变变量的标题*/ 17 MEAN=‘‘*Price=‘Mean price by type of boat‘*(Type=‘‘ ALL)/BOX=’Full day Excursions ‘ MISSTEXT=‘none‘;/*改变关键词的标题*/ 18 TITLE; 19 RUN;
备注:
改变变量或keyword的标题:将此变量或keyword与用单引号括起来的新标题等号相连即可,特别的,若令变量=’’,则标题被消去。
1 TABLE Region, Mean*(Sales*FORMAT=COMMA 8.0 2 Profit*FORMAT=DOLLAR10.2);
【SAS BASE】PROC TABULATE(输出更加精美的tabulate报告),布布扣,bubuko.com
【SAS BASE】PROC TABULATE(输出更加精美的tabulate报告)
标签:style blog color os io for re c
原文地址:http://www.cnblogs.com/chenyn68/p/3866510.html