请问关于缺失值的处理,如何用SAS的宏语言进行处理啊?data missing;input n1 n2 n3 n4 n5 n6 n7 n8 c1$ c2$ c3$c4$;datalines;1 .1 .1 .1 4 a .c .1 1 ..2 ..5 e .g h1 .1 .3 ..6 ..k l1 .......a b c d;%let thres=0.7;data_null_;set missing en

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/28 21:05:38
请问关于缺失值的处理,如何用SAS的宏语言进行处理啊?data missing;input n1 n2 n3 n4 n5 n6 n7 n8 c1$ c2$ c3$c4$;datalines;1 .1 .1 .1 4 a .c .1 1 ..2 ..5 e .g h1 .1 .3 ..6 ..k l1 .......a b c d;%let thres=0.7;data_null_;set missing en
xTnQ- }4SfgFj-5`5h"sF.}1&9{^'YH;Qo_٭~q?Ae}iw/.h49e{|zAM&+Z"i(PQhHh Py|KГd3+!>mhʁ $H(}DX {l *jJ$ FQr+k##<ae>b0: r \~ܵljMEY@U3E!n*+a>os(>Yaɣx Hp,O $-xiMF9KM5-A,ȃZy~uͫ,A~ !Kw' >r(8N!x^.Hb!<(:a ]0r k9&0eORR֑ˁ]Z`Z_\7j}i`n:2 QDn'IamHZ̢%N5b k )N09ݓq̬7|N]zLqbjn^ym}u=|y M烓')Z;2+:ح >8/ޫ+oy߾ί3W/e/?kL2lDr

请问关于缺失值的处理,如何用SAS的宏语言进行处理啊?data missing;input n1 n2 n3 n4 n5 n6 n7 n8 c1$ c2$ c3$c4$;datalines;1 .1 .1 .1 4 a .c .1 1 ..2 ..5 e .g h1 .1 .3 ..6 ..k l1 .......a b c d;%let thres=0.7;data_null_;set missing en
请问关于缺失值的处理,如何用SAS的宏语言进行处理啊?
data missing;
input n1 n2 n3 n4 n5 n6 n7 n8 c1$ c2$ c3$c4$;
datalines;
1 .1 .1 .1 4 a .c .
1 1 ..2 ..5 e .g h
1 .1 .3 ..6 ..k l
1 .......a b c d
;
%let thres=0.7;
data_null_;
set missing end=finished nobs=obs;
array num_vars{8} n1-n8;
array char_vars{4} c1-c4;
array num_miss [8] (8*0);
array char_miss [4] (4*0);
length list $ 50;
do i=1to8;
if num_vars(i) eq .then num_miss(i)+1;
end;
do i=1to4;
if char_vars(i) eq ''then char_miss(i)+1;
end;
if finished thendo;
do i= 1to8;
if num_miss(i)/obs ge&thres then list=trim(list)||' '||trim(vname(num_vars(i)));
end;
do i= 1to4;
if char_miss(i)/obs ge&thres then list=trim(list)||' '||trim(vname(char_vars(i)));
end;
call symputx('mlist',list);
end;
run;
%put &mlist;
data notmiss;
set missing(drop=&mlist);
run;
这是用宏语言处理之前的程序,如何编写成宏程序呢?感激不尽~

请问关于缺失值的处理,如何用SAS的宏语言进行处理啊?data missing;input n1 n2 n3 n4 n5 n6 n7 n8 c1$ c2$ c3$c4$;datalines;1 .1 .1 .1 4 a .c .1 1 ..2 ..5 e .g h1 .1 .3 ..6 ..k l1 .......a b c d;%let thres=0.7;data_null_;set missing en
删除缺失值过多的变量?不是写好了吗?
想写怎么样的宏?达到什么样的目的?