我想做类似于Jegadeesh and Titman (Momentum) 的数据分析, 他们的文章在http://www.scribd.com/doc/35798557/Jegadeesh-Titman-Momentum
基本概念是按过去J个月的收益给所有哦股票排序,分成比如说10个portfolio,在接下来的K个月,买入最高排序的卖出最低排序的portfolio,看return是多少
但是我sas是现学的基本不会!新注册分不多希望各位大神帮一把
原帖发在悬赏区
https://bbs.pinggu.org/forum.php?mod=viewthread&tid=1527975&page=1&extra=#pid13765170
这段代码是什么完全不能运行啊
. Assign Ranks to the Next 6 (K) Months After Portfolio Formation
* Portfolio return are average monthly returns rebalanced monthly;proc sql;create table msfx2as select distinct a.momr, a.date as form_date, a.permno, b.date, b.retfrom umd2 as a, msex2 as bwhere a.permno=b.permnoand 0<INTCK('MONTH',A.DATE,B.DATE)<=&K; title="" pre < endrsubmit;*************************************************************************************; run; Buy_Sell; Buy Sell var probt; t mean="ret;" n data="msfx2;"means proc BUY_SELL="Buy-Sell;" ewretdat2; set ewretdat3; ewret; momr; date;by _10="BUY));" _9="PORT9" _8="PORT8" _7="PORT7" _6="PORT6" _5="PORT5"_4="PORT4" _3="PORT3" _2="PORT2" (rename="(_1=SELL" out="msfx3" transposedate sort Returns Portfolio Buy-Sell Calculate 6.************************************************************************************* months?; &K for held and return lagged month &J on based ?Portfolios Title2 Portfolios?; Strength Relative of 1: Table (1993) Titman ?Jegadeesh ; momr std="ewretstd;" output ret; noprint; &endyear; &begyearbetween year(date) where return; monthly average * form_date; series;Monthly Average Equally-Weighted