4. 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