SAS:批处理处理缺失值
/*将变量缺失值设置为0*/
DATA S.data;
SET S.data;
ARRAY NUM{*} _NUMERIC_;/*_NUMERIC_可以换成_ALL_,_CHARACTER_*/
DO I=1 TO DIM(NUM);
IF MISSING(NUM{I}) THEN NUM{I}=0;
END;
RUN;
缺失值的填充:
/*缺失值处理*/
PROC STDIZE DATA=data1 REPONLY METHOD=MEAN OUT=data2;
VAR VAR1;
RUN;
method=mean 或median
Stay hungry, stay foolish