通过SAS格式传递多个变量

通过SAS格式传递多个变量,sas,Sas,下面的代码创建下表 proc format; value income_format low -< 0 = "low" 1 -< 30 = "low-medium" 30 -< 60 = "average" 60 -< 90 = "high" 90 - high = "excellent"; run; proc freq data = lib1.all; format

下面的代码创建下表

proc format;
value income_format
low -< 0 = "low"
1 -< 30 = "low-medium"
30 -< 60 = "average"
60 -< 90 = "high"
90 - high = "excellent";
run;



proc freq data = lib1.all;
format income income_format.; /* assign IncomeFmt format to Income variable */
tables income
/OUT = income_table outcum ;
run;

格式
仅告诉SAS如何向您显示内容。由于要按日期制作频率表,因此需要使用
by
语句。确保首先按日期对数据进行排序或索引

proc freq data = lib1.all;
    format income income_format. DATE YYMMD7.; /* assign IncomeFmt format to Income variable and dateformat to date variable */
    by date;

    tables income /OUT = income_table outcum ;
run;
proc freq data = lib1.all;
    format income income_format. DATE YYMMD7.; /* assign IncomeFmt format to Income variable and dateformat to date variable */
    by date;

    tables income /OUT = income_table outcum ;
run;