Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: how to merge three dataset to facilitate subsequent calculation


From   李 梦佳 <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: how to merge three dataset to facilitate subsequent calculation
Date   Tue, 16 Apr 2013 12:46:18 +0800

Dear statalist,

I want to replicate Huang, Sialm, Zhang (JF, 2012) to use" risk shifting" to measure mutual fund's risk taking. To start with, I need to calculate the holdings return (RHf,t)of mutual fund and its volatility (sigma). As the authors point out, it's easier to first calculate the holdings return of the past 36 months and then use these values to reach the sigma. For each fund i at each month t in the past 36 month:

RH i,t= si * Rstockt + b1*Rbondt + ci*Rcasht
         = si * sum(Rstockj,t * pj,t) + b1*Rbondt + ci*Rcasht

I've collected the data needed in calculation but they exist in 3 different files whose structures are like the following:

(1) Asset composition file: (where si+bi+ci=100%)
Fund	|stock%	|bond%	|cash%		| Time	
-------------+--------------------------------------------------------
Fund001		s1		b1		c1		200506
⋯⋯
Fund299		s299		b299	c299	200506
Fund001		s1		b1		c1		200512
⋯⋯
Fund299		s299		b299	c299	200512
⋯⋯
Fund001		s1		b1		c1		201012
⋯⋯
Fund299		s299		b299	c299	201012



(2) Stock Holding file: (where for each Fund at each time, sum of the second column equals 100%)
Fund	|stockholding	|%of all stock		|Time	
-------------+--------------------------------------------------------------
Fund001		stock001			0.3			200506	
⋯⋯
Fund001		stock050			1.8			200506
⋯⋯
Fund299									200506
⋯⋯
Fund001		stock001			2.5			201012	
⋯⋯
Fund001		stock095			0.7			201012
⋯⋯
Fund299									201012



(3) Stock Return File:
stock	|Month	|Return
-------------+--------------------------
stock001	2002-01	r1
stock001	2002-02	r2
⋯⋯
stock001	2010-12	r108
⋯⋯
stocknnn 2010-12  rnnn


How can I "merge" (probably not appropriate term here) these 3 data set to calculate the RH and its volatility (sigma) using the RHs of past 36 month?

Many thanks and best regards,
Mengjia

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index