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]

Re: st: how to merge three dataset to facilitate subsequent calculation


From   "Darren White" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: how to merge three dataset to facilitate subsequent calculation
Date   Tue, 16 Apr 2013 14:53:56 +1000

Hi Mengjia

This may not be your answer but data merging can be achieved by using
the function in the menu/data/combine datasets/ (list of merging
options)

The dialogue windows are pretty strait-forward.

Darren


>>> 李 梦佳<[email protected]> 4/16/2013 2:46 pm >>>
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
-------------+--------------------------------------------------------
Fund001s1b1c1200506
⋯⋯
Fund299s299b299c299200506
Fund001s1b1c1200512
⋯⋯
Fund299s299b299c299200512
⋯⋯
Fund001s1b1c1201012
⋯⋯
Fund299s299b299c299201012



(2) Stock Holding file: (where for each Fund at each time, sum of the
second column equals 100%)
Fund|stockholding|%of all stock|Time
-------------+--------------------------------------------------------------
Fund001stock0010.3200506
⋯⋯
Fund001stock0501.8200506
⋯⋯
Fund299200506
⋯⋯
Fund001stock0012.5201012
⋯⋯
Fund001stock0950.7201012
⋯⋯
Fund299201012



(3) Stock Return File:
stock|Month|Return
-------------+--------------------------
stock0012002-01r1
stock0012002-02r2
⋯⋯
stock0012010-12r108
⋯⋯
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/

********************************************************************************
This email, including any attachments sent with it, is confidential and for the sole use of the intended recipient(s). This confidentiality is not waived or lost, if you receive it and you are not the intended recipient(s), or if it is transmitted/received in error.
Any unauthorised use, alteration, disclosure, distribution or review of this email is strictly prohibited.  The information contained in this email, including any attachment sent with it, may be subject to a statutory duty of confidentiality if it relates to health service matters.
If you are not the intended recipient(s), or if you have received this email in error, you are asked to immediately notify the sender by telephone collect on Australia +61 1800 198 175 or by return email.  You should also delete this email, and any copies, from your computer system network and destroy any hard copies produced.
If not an intended recipient of this email, you must not copy, distribute or take any action(s) that relies on it; any form of disclosure, modification, distribution and/or publication of this email is also prohibited.
Although Queensland Health takes all reasonable steps to ensure this email does not contain malicious software, Queensland Health does not accept responsibility for the consequences if any person's computer inadvertently suffers any disruption to services, loss of information, harm or is infected with a virus, other malicious computer programme or code that may occur as a consequence of receiving this email.
Unless stated otherwise, this email represents only the views of the sender and not the views of the Queensland Government.
**********************************************************************************

*
*   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