j*****7 发帖数: 4348 | 1 假设我有一个很大的数据, 有5000个variable,现在我怀疑有些variable从头到尾都
是missing,有没有什么相对简单的办法把这些全部为missing的variable输出出来?
谢谢 |
l*****8 发帖数: 483 | |
s******y 发帖数: 352 | 3 给几个包子吧。
data class;
if 0 then set sashelp.class;
do i=1 to 10;output;
end;
stop;
run;
proc format;
value allmiss ._-.z=. other=1;
value $allmiss ' '=' ' other='1';
run;
ods select nlevels;
ods output nlevels=nlevels(keep=TableVar NNonMissLevels where=(
NNonMissLevels=0));
proc freq levels;
format _character_ $allmiss. _numeric_ allmiss.;
run;
ods output close; |
j*****7 发帖数: 4348 | 4 转帐完成
转给用户:lguo888,现金(伪币):50,收取手续费:0.50
转帐完成
转给用户:smileguy,现金(伪币):50,收取手续费:0.50
Unfortunately, smileguy的程序没看懂, 惭愧. |
D******n 发帖数: 2836 | 5 proc means
【在 j*****7 的大作中提到】 : 假设我有一个很大的数据, 有5000个variable,现在我怀疑有些variable从头到尾都 : 是missing,有没有什么相对简单的办法把这些全部为missing的variable输出出来? : 谢谢
|
j*****7 发帖数: 4348 | 6 what about character variables?
【在 D******n 的大作中提到】 : proc means
|
D******n 发帖数: 2836 | 7 proc freq with format as upstairs did
【在 j*****7 的大作中提到】 : what about character variables?
|
s******y 发帖数: 352 | 8 我的方法对string 和 number 都适用。
首先用format 使non-missing 的value 使用数值1, missing 为。 或blank。 然后
procfreq with nlevel option. 你得到一个dataset. 如过 NNonMissLevels=0, 那末
这个variable 全部missing.
【在 j*****7 的大作中提到】 : 转帐完成 : 转给用户:lguo888,现金(伪币):50,收取手续费:0.50 : 转帐完成 : 转给用户:smileguy,现金(伪币):50,收取手续费:0.50 : Unfortunately, smileguy的程序没看懂, 惭愧.
|
l*****8 发帖数: 483 | 9 收到, 谢谢。
【在 j*****7 的大作中提到】 : 转帐完成 : 转给用户:lguo888,现金(伪币):50,收取手续费:0.50 : 转帐完成 : 转给用户:smileguy,现金(伪币):50,收取手续费:0.50 : Unfortunately, smileguy的程序没看懂, 惭愧.
|
l*****8 发帖数: 483 | 10 好技巧,收藏
【在 s******y 的大作中提到】 : 给几个包子吧。 : data class; : if 0 then set sashelp.class; : do i=1 to 10;output; : end; : stop; : run; : proc format; : value allmiss ._-.z=. other=1; : value $allmiss ' '=' ' other='1';
|
|
|
j*****7 发帖数: 4348 | 11 牛逼!
佩服!
【在 s******y 的大作中提到】 : 我的方法对string 和 number 都适用。 : 首先用format 使non-missing 的value 使用数值1, missing 为。 或blank。 然后 : procfreq with nlevel option. 你得到一个dataset. 如过 NNonMissLevels=0, 那末 : 这个variable 全部missing.
|
l*********s 发帖数: 5409 | 12 great!
【在 s******y 的大作中提到】 : 给几个包子吧。 : data class; : if 0 then set sashelp.class; : do i=1 to 10;output; : end; : stop; : run; : proc format; : value allmiss ._-.z=. other=1; : value $allmiss ' '=' ' other='1';
|
l***a 发帖数: 12410 | 13 好trick
ods select那句好像不是必需的,加在这里是什么作用
【在 s******y 的大作中提到】 : 我的方法对string 和 number 都适用。 : 首先用format 使non-missing 的value 使用数值1, missing 为。 或blank。 然后 : procfreq with nlevel option. 你得到一个dataset. 如过 NNonMissLevels=0, 那末 : 这个variable 全部missing.
|
P****D 发帖数: 11146 | 14 不要显示proc freq的所有output。
【在 l***a 的大作中提到】 : 好trick : ods select那句好像不是必需的,加在这里是什么作用
|
u****d 发帖数: 23938 | 15 银队好。
【在 j*****7 的大作中提到】 : 转帐完成 : 转给用户:lguo888,现金(伪币):50,收取手续费:0.50 : 转帐完成 : 转给用户:smileguy,现金(伪币):50,收取手续费:0.50 : Unfortunately, smileguy的程序没看懂, 惭愧.
|
j*****7 发帖数: 4348 | 16 Hi,
Is it possible to suppress the PROC FREQ output?
Thanks!
【在 s******y 的大作中提到】 : 我的方法对string 和 number 都适用。 : 首先用format 使non-missing 的value 使用数值1, missing 为。 或blank。 然后 : procfreq with nlevel option. 你得到一个dataset. 如过 NNonMissLevels=0, 那末 : 这个variable 全部missing.
|
s******y 发帖数: 352 | 17 谢谢你的大包子。
ODS LISTING CLOSE;
ods output nlevels=nlevels(keep=TableVar NNonMissLevels where=(
NNonMissLevels=0));
proc freq levels;
format _character_ $allmiss. _numeric_ allmiss.;
run;
ods output close;
ODS LISTING; |
b*****e 发帖数: 223 | |
S********a 发帖数: 359 | 19 请点解一下这个ODS OUTPUT NLEVELS,谢谢,有包子啊:)
ods output nlevels=nlevels(keep=TableVar NNonMissLevels where=(
NNonMissLevels=0));
proc freq levels;
format _character_ $allmiss. _numeric_ allmiss.;
run;
【在 s******y 的大作中提到】 : 谢谢你的大包子。 : ODS LISTING CLOSE; : ods output nlevels=nlevels(keep=TableVar NNonMissLevels where=( : NNonMissLevels=0)); : proc freq levels; : format _character_ $allmiss. _numeric_ allmiss.; : run; : ods output close; : ODS LISTING;
|
s******y 发帖数: 352 | 20 With ODS, you can request the data objects that created from the SAS
procedures. When you specify NLEVELS option in proc freq, data object
nlevels will be generated. wihtin the dataset, you can get the number of
levels for the varaibles specified in the table statement.
if a varaible dosen't have any value, the Nnonmisslevels (number of non-
missing levels) is 0. otherwise it will be the number of the disticnt value
the variable has.
【在 S********a 的大作中提到】 : 请点解一下这个ODS OUTPUT NLEVELS,谢谢,有包子啊:) : ods output nlevels=nlevels(keep=TableVar NNonMissLevels where=( : NNonMissLevels=0)); : proc freq levels; : format _character_ $allmiss. _numeric_ allmiss.; : run;
|
|
|
S********a 发帖数: 359 | 21 这几个nlevels/levels搞得我先后顺序糊涂了,ods output 后面第一个nlevels是SAS
产生的结果,等号后面第二个nlevels是由这个结果产生的sas dataset? 那freq 里的
nlevels是keyword还是文件名?包子已发,谢谢。
ods select nlevels;
ods output nlevels=nlevels(keep=TableVar NNonMissLevels where=(
NNonMissLevels=0));
proc freq nlevels;
format _character_ $allmiss. _numeric_ allmiss.;
run;
ods output close;
value
【在 s******y 的大作中提到】 : With ODS, you can request the data objects that created from the SAS : procedures. When you specify NLEVELS option in proc freq, data object : nlevels will be generated. wihtin the dataset, you can get the number of : levels for the varaibles specified in the table statement. : if a varaible dosen't have any value, the Nnonmisslevels (number of non- : missing levels) is 0. otherwise it will be the number of the disticnt value : the variable has.
|
l***a 发帖数: 12410 | 22 我估计你得先看看ods trace/select/output这几个命令,然后就明白原理了
SAS
【在 S********a 的大作中提到】 : 这几个nlevels/levels搞得我先后顺序糊涂了,ods output 后面第一个nlevels是SAS : 产生的结果,等号后面第二个nlevels是由这个结果产生的sas dataset? 那freq 里的 : nlevels是keyword还是文件名?包子已发,谢谢。 : ods select nlevels; : ods output nlevels=nlevels(keep=TableVar NNonMissLevels where=( : NNonMissLevels=0)); : proc freq nlevels; : format _character_ $allmiss. _numeric_ allmiss.; : run; : ods output close;
|
s******y 发帖数: 352 | 23 ods output nlevels=nlevels;
first nlevels is the data object SAS provided.
the second one can be called whatever you want to name it. it is confusing
because i give it the same name as the data object.
SAS
【在 S********a 的大作中提到】 : 这几个nlevels/levels搞得我先后顺序糊涂了,ods output 后面第一个nlevels是SAS : 产生的结果,等号后面第二个nlevels是由这个结果产生的sas dataset? 那freq 里的 : nlevels是keyword还是文件名?包子已发,谢谢。 : ods select nlevels; : ods output nlevels=nlevels(keep=TableVar NNonMissLevels where=( : NNonMissLevels=0)); : proc freq nlevels; : format _character_ $allmiss. _numeric_ allmiss.; : run; : ods output close;
|
S********a 发帖数: 359 | 24 恩,有书推荐一下吗?貌似output delivery system the basics and beyond by
Lauren E. Haworth 不错,搜了半天找不到PDF版本的 :(
【在 l***a 的大作中提到】 : 我估计你得先看看ods trace/select/output这几个命令,然后就明白原理了 : : SAS
|
l***a 发帖数: 12410 | 25 对这个case来说,little book 足够了
【在 S********a 的大作中提到】 : 恩,有书推荐一下吗?貌似output delivery system the basics and beyond by : Lauren E. Haworth 不错,搜了半天找不到PDF版本的 :(
|
S********a 发帖数: 359 | 26 ods select nlevels;
ods output nlevels=b(keep=TableVar NNonMissLevels where=(
NNonMissLevels=0));
proc freq nlevels;
format _character_ $allmiss. _numeric_ allmiss.;
run;
ods output close;
我已经改了等号后面的nlevels为b, 剩余的3个nlevels还有哪个可以改的?还是必须写
成nlevels (比如作为keyword)?
【在 s******y 的大作中提到】 : ods output nlevels=nlevels; : first nlevels is the data object SAS provided. : the second one can be called whatever you want to name it. it is confusing : because i give it the same name as the data object. : : SAS
|
S********a 发帖数: 359 | 27 谢谢,去看看
【在 l***a 的大作中提到】 : 对这个case来说,little book 足够了
|
s******y 发帖数: 352 | 28 ods select nlevels; -can not be changed, object name was SAS supplied.
ods output nlevels= -can not be changed, object name was SAS supplied.
proc freq nlevels; -SAS option for PROC Freq
【在 S********a 的大作中提到】 : ods select nlevels; : ods output nlevels=b(keep=TableVar NNonMissLevels where=( : NNonMissLevels=0)); : proc freq nlevels; : format _character_ $allmiss. _numeric_ allmiss.; : run; : ods output close; : 我已经改了等号后面的nlevels为b, 剩余的3个nlevels还有哪个可以改的?还是必须写 : 成nlevels (比如作为keyword)?
|
S********a 发帖数: 359 | 29 谢谢不吝赐教!!
【在 s******y 的大作中提到】 : ods select nlevels; -can not be changed, object name was SAS supplied. : ods output nlevels= -can not be changed, object name was SAS supplied. : proc freq nlevels; -SAS option for PROC Freq
|