Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Value Weighted Portfolios Momentum Strategy


From   "Anna Steinforth" <ASteinforth@gmx.de>
To   statalist@hsphsun2.harvard.edu
Subject   st: Value Weighted Portfolios Momentum Strategy
Date   Tue, 19 Mar 2013 00:19:35 +0100

Hi everyone,

I am trying to implement a Momentum Strategy in Stata. I am very happy, that statalist already helped me with a code for the beginning! :-)

Now I am trying to form value weighted portfolios, but all my trials failed! Now I feel like a stupid girl! :-( 

the table at the beginning looks like this:

date    stock    price    mv
1992m1    1    14.17    28.08
1992m2    1    17.5    34.69
1992m3    1    16.88    33.45

i have stocks from 1 to 300 and dates until 2012m12

I am using this code to build equal weighted portfolios:

gen return6 = ln(price/l6.price)
drop if return6==.
egen portfolio6_6 = xtile(return6), nquantiles(4) by(date)
collapse (mean) f6.return6, by(date portfolio6_6)
gen monthly_r6_6 = F6return6/6
tsset date portfolio6_6                                                                   
gen momentum6_6 = S3.monthly_r6_6 

now,when i use: 

collapse (mean) f6.return6, by(date portfolio6_6)

i need that the return of every reit in the portfolio is weighted with its market value.

How can I change the collapse code to value weight? Is that possible at all? Any idea would be highly appreciated!

Thanks a lot!!! :-)

Best, Anna 
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index