由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - if _n_ 和 where _n_ 的区别?
相关主题
二月及三月上Python/R/Hadoop/Tableau课的同学请与我联系sas base 70的两道题
给今年毕业的同学们出一个主意difference between "@" and "@@"
How to selectively plot data in R菜鸟麻烦大家帮我看看sas base 70题的29和123题的15题
如何重复运行sas程序100次,并把100次的结果全部output?Where to download zipcode-level historical weather data?
请教sas base 70题里第29题。。。sas code 求教
弱问SAS题目中 raw data record怎么理解missing data questions
请教一个sas 的basic问题请教一下这个media effect怎么分析? (转载)
70 题中的第29题答案是不是错了啊?SAS问题,关于@和@@的区别
相关话题的讨论汇总
话题: where话题: data话题: 区别话题: enters话题: set
进入Statistics版参与讨论
1 (共1页)
p*****o
发帖数: 543
1
下面两个程序,第一个是通的,第二个是不通的,想请教一下为什么?
data a;
set b;
if _n_ <= 20;
run;
data a;
set b;
where _n_ <= 20;
run;
l***a
发帖数: 12410
2
you just cannot use it in where statement

【在 p*****o 的大作中提到】
: 下面两个程序,第一个是通的,第二个是不通的,想请教一下为什么?
: data a;
: set b;
: if _n_ <= 20;
: run;
: data a;
: set b;
: where _n_ <= 20;
: run;

S******y
发帖数: 1123
3
WHERE conditions are applied before the data enters the input buffer while
IF conditions are applied after the data enters the program data vector.
For more, see
http://www2.sas.com/proceedings/sugi31/238-31.pdf
The _N_ is the temporary variable used to count the iterations of
the DATA step. You cannot reference it in WHERE statement since it has not
been created yet at that time.
p*****o
发帖数: 543
4
Got it.
Thanks a lot!

not

【在 S******y 的大作中提到】
: WHERE conditions are applied before the data enters the input buffer while
: IF conditions are applied after the data enters the program data vector.
: For more, see
: http://www2.sas.com/proceedings/sugi31/238-31.pdf
: The _N_ is the temporary variable used to count the iterations of
: the DATA step. You cannot reference it in WHERE statement since it has not
: been created yet at that time.

1 (共1页)
进入Statistics版参与讨论
相关主题
SAS问题,关于@和@@的区别请教sas base 70题里第29题。。。
请教Base 70 中的一题 关于@弱问SAS题目中 raw data record怎么理解
MCMC算法的Posterior Std. 一定是减少的么?请教一个sas 的basic问题
提高R速度的一些tips70 题中的第29题答案是不是错了啊?
二月及三月上Python/R/Hadoop/Tableau课的同学请与我联系sas base 70的两道题
给今年毕业的同学们出一个主意difference between "@" and "@@"
How to selectively plot data in R菜鸟麻烦大家帮我看看sas base 70题的29和123题的15题
如何重复运行sas程序100次,并把100次的结果全部output?Where to download zipcode-level historical weather data?
相关话题的讨论汇总
话题: where话题: data话题: 区别话题: enters话题: set