由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - 中级SAS问题
相关主题
问个sas编程的题问个SAS PROC CORR的问题
关于SAS里面 PROC MODEL 的output,急!!如何从sas output里读入数据。
[SAS] data set options (obs=) in output tablessas proc means/freq问题
a SAS questionods rtf startpage=never does not work anymore in SAS9.2?
[SAS] ODS output with by statementrw一个关于保存simple logistic分析结果的问题
弱问sas问题about loglinear model请教proc freq 的chisq 分析
急,ENTRY LEVEL SAS PROGRAMER明天On-site,需要注意什么啊老问题如何产生missing table
如何比较两个proc contents的结果?神奇的proc means
相关话题的讨论汇总
话题: nlevels话题: ods话题: allmiss话题: output
进入Statistics版参与讨论
1 (共1页)
j*****7
发帖数: 4348
1
假设我有一个很大的数据, 有5000个variable,现在我怀疑有些variable从头到尾都
是missing,有没有什么相对简单的办法把这些全部为missing的variable输出出来?
谢谢
l*****8
发帖数: 483
2
http://support.sas.com/resources/papers/proceedings10/048-2010.
然后通过proc contents 看两个dataset 变量的区别, 就能找出来想要的
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';

相关主题
弱问sas问题about loglinear model问个SAS PROC CORR的问题
急,ENTRY LEVEL SAS PROGRAMER明天On-site,需要注意什么啊如何从sas output里读入数据。
如何比较两个proc contents的结果?sas proc means/freq问题
进入Statistics版参与讨论
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
18
你们都好牛
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;

相关主题
ods rtf startpage=never does not work anymore in SAS9.2?老问题如何产生missing table
rw一个关于保存simple logistic分析结果的问题神奇的proc means
请教proc freq 的chisq 分析关于 proc means output 里的_freq_的小问题
进入Statistics版参与讨论
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

1 (共1页)
进入Statistics版参与讨论
相关主题
神奇的proc means[SAS] ODS output with by statement
关于 proc means output 里的_freq_的小问题弱问sas问题about loglinear model
受不了EXCEL了(包子请教 proc report ods excel file)急,ENTRY LEVEL SAS PROGRAMER明天On-site,需要注意什么啊
Re: 请问SAS如何学起?如何比较两个proc contents的结果?
问个sas编程的题问个SAS PROC CORR的问题
关于SAS里面 PROC MODEL 的output,急!!如何从sas output里读入数据。
[SAS] data set options (obs=) in output tablessas proc means/freq问题
a SAS questionods rtf startpage=never does not work anymore in SAS9.2?
相关话题的讨论汇总
话题: nlevels话题: ods话题: allmiss话题: output