由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - daily data 求助 coding correct?
相关主题
sas questionSas programming help
一个关于macro的问题,多谢。proc lifereg,distribution selection
请教:get next record using BY group (SAS code data manipulation)一道ADV 130 题目
笨人求问sas function请问SAS advanced macro global 和local
这段产生bivariate normal的简单程序怎么理解?求一个简单点的方法写一段SAS
How to the macro regression with if?proc iml help!
请帮忙看3道SAS题。如何在用SAS给多个data step 和proc step 做循环语句呢?
请教:sas 循环SAS ADVANCED 一道题求助
相关话题的讨论汇总
话题: return话题: datadate话题: year话题: raw话题: day
进入Statistics版参与讨论
1 (共1页)
e****o
发帖数: 690
1
data input;
seed = 1245;
do id = 10000 to 99009 by 52;
do year = 2001 to 2008;
do i = 1 to 300 ;
return = abs(34.45 + rannor(seed*4)*5)/100 - rannor(seed*100)/5.05;;
if id < 50000 then datadate = mdy(12, 31, year) ; else datadate = mdy(6, 30
, year);
trade_date = datadate + i ;
output ;end; end; end;
drop seed i;
format datadate trade_date date9. ;
run ;
proc sort data = input; by permno trade_date ; run ;
%macro daily_return;
proc expand data = input out = i2 ;
id trade_date ;
by id ;
%do i = 1 %to 252 ;
convert return = return_day&i / transformout = (lag &i) ;
%end;
run ;
%mend;
%daily_return ;
My purpose is to :
ret1 = first day raw return in the year
ret2 = second day raw return in the year
ret3 = third day raw return in the year
**************
ret251 = 251th day raw return in the year
ret252 = 252th day raw return in the year
1 (共1页)
进入Statistics版参与讨论
相关主题
SAS ADVANCED 一道题求助这段产生bivariate normal的简单程序怎么理解?
求助,SAS ADV 130 中94How to the macro regression with if?
ask for help (urgent): A SAS question请帮忙看3道SAS题。
a question about SAS请教:sas 循环
sas questionSas programming help
一个关于macro的问题,多谢。proc lifereg,distribution selection
请教:get next record using BY group (SAS code data manipulation)一道ADV 130 题目
笨人求问sas function请问SAS advanced macro global 和local
相关话题的讨论汇总
话题: return话题: datadate话题: year话题: raw话题: day