由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - 问个sas编程的题
相关主题
中级SAS问题老问题如何产生missing table
排序的问题,请问高手用SAS怎么做?求SAS code,有包子
请教这种freq 该用什么code算(sas)?Thanks!关于 proc means output 里的_freq_的小问题
sas proc means/freq问题请教请问如何删除这样的丢失数据。
[SAS] number of missing values for character vars问个应用问题:选美
用 sas 分组问题问个简单的SAS如何找出某个变量最大之所在的行?
sas问题问个sas循环的问题
help for sas program问个proc merge问题。
相关话题的讨论汇总
话题: nlevels话题: allmiss话题: 变量话题: test话题: end
进入Statistics版参与讨论
1 (共1页)
EA
发帖数: 3965
1
我想删除那些都是missing value的变量,有什么办法么?
比如有一组数据,有很多变量,其中一些char type变量都是空的,我想找到这些变量
然后删除.用array怎么做?
EA
发帖数: 3965
2
I google some code and made some changes, but it didn't work, can anyone
help me out?
data _null_;
array test(*) _character_;
array allmiss (*) $ _temporary_ ('true');
length list $ 50;
set missing end=end;
do i=1 to dim(test);
if test(i) ne '' then allmiss(i)='false';
end;
if end=1 then
do i= 1 to dim(test);
if allmiss(i) ='true' then list=trim(list)||' '||trim(vname(test(i)));
end;
call symput('mlist',list);
run;
data notmiss;
set missing;
drop &mlist;
run;
h***x
发帖数: 586
3
The following codes should works,
say you have dataset named 'aaa' and you want to get rid of the character
variables whose values are all missing,
ods output NLevels=_out_;
proc freq data=aaa nlevels; run;
ods output close;
data _out_;
set _out_;
if NLevels=1 and NMissLevels=1;
run;
proc sql ;
select tablevar into: cvar
separated by ' '
from _out_;
quit;
data aaa;
set aaa(drop=&cvar);
run;

【在 EA 的大作中提到】
: 我想删除那些都是missing value的变量,有什么办法么?
: 比如有一组数据,有很多变量,其中一些char type变量都是空的,我想找到这些变量
: 然后删除.用array怎么做?

l***a
发帖数: 12410
4
a simple proc freq and merge will do it

【在 EA 的大作中提到】
: 我想删除那些都是missing value的变量,有什么办法么?
: 比如有一组数据,有很多变量,其中一些char type变量都是空的,我想找到这些变量
: 然后删除.用array怎么做?

1 (共1页)
进入Statistics版参与讨论
相关主题
问个proc merge问题。[SAS] number of missing values for character vars
sas coding problem(help!!!)用 sas 分组问题
请问如果用SAS 解决这个问题sas问题
SAS 求助:如何根据变量值输出变量名help for sas program
中级SAS问题老问题如何产生missing table
排序的问题,请问高手用SAS怎么做?求SAS code,有包子
请教这种freq 该用什么code算(sas)?Thanks!关于 proc means output 里的_freq_的小问题
sas proc means/freq问题请教请问如何删除这样的丢失数据。
相关话题的讨论汇总
话题: nlevels话题: allmiss话题: 变量话题: test话题: end