Dear Stata membets, I have been creating portfolios for the momentum, short term reversal and mean reversion anomalies. The winner and loser portfolio have been done, however I would also like to include the zero cost strategy portfolio. Is there a way to generate the portfolio as potfolio 10-1. I have long data for multiple firms and multiple years The code used for the portfolio constructure is as follows.
egen portfolio1 = xtile(ret1), nquantiles(10) by(mdate)
egen portfolio6 = xtile(ret6), nquantiles(10) by(mdate)
egen portfolio12 = xtile(ret12), nquantiles(10) by(mdate)
egen portfolio24 = xtile(ret24), nquantiles(10) by(mdate)
egen portfolio36 = xtile(ret36), nquantiles(10) by(mdate)
gen double LOGexcesreturn = log(excesreturn+1)
rangestat (sum) LOGexcesreturn (count) LOGexcesreturn, interval(mdate -5 0) by(code)
gen excesreturn6 = exp(LOGexcesreturn_sum) - 1 if LOGexcesreturn_count == 6
gen E_hold6 = f6.excesreturn6
collapse (mean) year five Date BidYieldClose RiskFree marketcap ret1 ret6 ret12 ret24 ret36 E_hold1 E_hold6 E_hold12 E_hold24 E_hold36 EQUALmarketreturn marketpremium marketpremium1 marketpremium6 marketpremium12 marketpremium24 marketpremium36 meanRet6 meanExces6 meanRet12 meanExces12 meanRet24 meanExces24 meanRet36 meanExces36 premiummean6 premiummean12 premiummean24 premiummean36 (sum) P6wmeanRet6 P6wmeanExces6 P6wmeanRet12 P6wmeanExces12 P12wmeanRet6 P12wmeanExces6 P12wmeanRet12 P12wmeanExces12 P24wmeanRet24 P24wmeanExces24 P24wmeanRet36 P24wmeanExces36 P36wmeanRet24 P36wmeanExces24 P36wmeanRet36 P36wmeanExces36 weight6 wreturn6 wexcesreturn6 W_hold6_p6 W_hold12_p6 W_hold24_p6 W_hold36_p6, by(mdate portfolio6)
I will use collapse per portfolio to do the by group regression, These are used to calculate future returns and used to calculate using abnormal returns against the market portfolio. How am i able to either create an extra observation per portfolio for winner minus loser portfolio or vice versa?
Related Posts with Creating zero cost portfolio, from a winner and loser portfolio
Survey Data - Logistic regression with numerical variableArray Array Hello all, I am currently carrying out an analysis on repeated cross sectional data. I c…
Difference between values in different positionsHello, I have one variable which reports the share of immigrants, in four years (2005, 2010, 2015 an…
Fixed and Random Effects with Unit root testHello, I want to ask if I performing the Fixed Effects and Random Effects for the models of the stu…
Count number of occurences by dayDear all, I have a dataset like this with three variables (Start_Day=Start day of a work contract; E…
diagnostic or post-estimation model validity test: Tobit random effect model for Panel dataDear Statalist, I want to estimate the effect of endowment on charity contribution. My dependent va…
Subscribe to:
Post Comments (Atom)
0 Response to Creating zero cost portfolio, from a winner and loser portfolio
Post a Comment