就喜欢马 发表于 2014-12-20 23:30 
这个得用proc sql:
上面有个age忘了改成expense。
再补充一下,对列求和、计数、算标准差等可以用proc sql,而data set 数据步只能对行运算,proc sql可用的函数有:
AVG, MEAN mean or average of values
COUNT, FREQ, N number of nonmissing values
CSS corrected sum of squares
CV coefficient of variation (percent)
MAX largest value
MIN smallest value
NMISS number of missing values
PRT probability of a greater absolute value of Student's t
RANGE range of values
STD standard deviation
STDERR standard error of the mean
SUM sum of values
T student's t value for testing the hypothesis that the population mean is zero
USS uncorrected sum of squares
VAR variance