由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - 请教一个sas的基本问题
相关主题
请教一个sas的sort date变量问题如何建立多重变量回归模型?
怎样检查俩个大的dataset一样[合集] └ Re: 关于stepwise programming
which route in SAS is faster?关于读数据紧急求助,包子答谢,谢谢了先
请教sas code问题问个genmod的问题,包子答谢
求教一个sas读data的问题如何在一个dataset里加一个变量?
请教个菜鸟r code问题,一晚上也没搞明白,痛苦。。。简单的code 奇怪的结果
SAS data merge求助请问如何判断一个dataset里的一个变量的值全为空?
sas question about positionquestion about r code "order"
相关话题的讨论汇总
话题: note话题: 变量话题: begindate话题: 观测话题: 初始化
进入Statistics版参与讨论
1 (共1页)
H***y
发帖数: 340
1
为什么不能用first.和last.呢?
log
NOTE: 变量 first.ticker 未初始化。
NOTE: 变量 last.ticker 未初始化。
NOTE: 从数据集 STARTUP.REGTEST 读取了 26 个观测。
NOTE: 数据集 STARTUP.REGBEGIN 有 0 个观测和 6 个变量。
NOTE: 数据集 STARTUP.REGEND 有 0 个观测和 6 个变量。
code
data startup.regbegin startup.regend;
set startup.regtest;
if first.ticker
then do;
begindate=date;
format begindate date9.;
output startup.regbegin;
end;
if last.ticker
then do;
d*******1
发帖数: 854
2
after set startup.regtest;
you need to add the following:
by ticker;

【在 H***y 的大作中提到】
: 为什么不能用first.和last.呢?
: log
: NOTE: 变量 first.ticker 未初始化。
: NOTE: 变量 last.ticker 未初始化。
: NOTE: 从数据集 STARTUP.REGTEST 读取了 26 个观测。
: NOTE: 数据集 STARTUP.REGBEGIN 有 0 个观测和 6 个变量。
: NOTE: 数据集 STARTUP.REGEND 有 0 个观测和 6 个变量。
: code
: data startup.regbegin startup.regend;
: set startup.regtest;

H***y
发帖数: 340
3
got it. thanks.
but, in fact, the data was sorted by ticker,
why "by" again?
d*******1
发帖数: 854
4
you dataset startup.regtest has been pre-sorted. The ordering information is
embeded in the dataset. when you do
data startup.regtest;
set startup.regtest;
you are actually recreating the dataset startup.regtest, you would lose the
ordering information during this recreation process if you do not tell SAS
to keep the ordering information by using by statement again.

【在 H***y 的大作中提到】
: got it. thanks.
: but, in fact, the data was sorted by ticker,
: why "by" again?

H***y
发帖数: 340
5
thanks a lot
very clear

is
the

【在 d*******1 的大作中提到】
: you dataset startup.regtest has been pre-sorted. The ordering information is
: embeded in the dataset. when you do
: data startup.regtest;
: set startup.regtest;
: you are actually recreating the dataset startup.regtest, you would lose the
: ordering information during this recreation process if you do not tell SAS
: to keep the ordering information by using by statement again.

1 (共1页)
进入Statistics版参与讨论
相关主题
question about r code "order"求教一个sas读data的问题
regression prediction问题请教个菜鸟r code问题,一晚上也没搞明白,痛苦。。。
sas macro 问题请教。。SAS data merge求助
请教一个简单SAS问题sas question about position
请教一个sas的sort date变量问题如何建立多重变量回归模型?
怎样检查俩个大的dataset一样[合集] └ Re: 关于stepwise programming
which route in SAS is faster?关于读数据紧急求助,包子答谢,谢谢了先
请教sas code问题问个genmod的问题,包子答谢
相关话题的讨论汇总
话题: note话题: 变量话题: begindate话题: 观测话题: 初始化