县创建了一个名为shiyan数据集
data shiyan;
input name$ sex$ math chinese;
cards;
张三 1 34 43
高空 2 87 64
李四 1 89 34
莫非 2 98 67
;
run;
先用format语句对变量分组,再使用Freq过程:
程序1:
proc format;
value F_sex 1='nansheng' 2='nvsheng';
value F_math 30<-50='30~50'
50<-80='50~80'
80<-100='80~100';
run;
程序2:
proc freq data=shiyan;
tables sex math;
format sex f_sex. math f_math.;
run;
log中说有如下错误:
ERROR: You are trying to use the numeric format F_SEX with the character variable sex.
怎么解决,我只是想列出sex 分别为1,2 的百分比和math各区间百分比~