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: Merging Time-Invariant Characteristics Into A Panel Dataset


From   Nick Baker <[email protected]>
To   [email protected]
Subject   st: Merging Time-Invariant Characteristics Into A Panel Dataset
Date   29 Mar 2013 13:40:39 +0000

Hi all,

I have data for many mutual funds giving returns in different time periods in a stata dataset that looks like follows:

FundID	Date	ret(t-1)	ret(t-2)
1	2006m1	.	.
1	2006m2	-12.38985	.
1	2006m3	-8.219995	-12.38985
1	2006m4	5.497518	-8.219995
1	2006m5	-0.9465399	5.497518
1	2006m6	2.219898	-0.9465399
2	2006m1	.	.
2	2006m2	10.39785	.
2	2006m3	9.54027	10.39785
2	2006m4	-5.947091	9.54027
2	2006m5	-2.846269	-5.947091
2	2006m6	-12.51931	-2.846269


In a second dataset I have time-invariant characteristics that apply to each fund in every time period:

fund	mgmtfee	perffee	 strategy
1	1.75	20	EM
2	2	20	EM

I want to find a way to merge these two datasets so that the time-invariant characteristics appear in each observation such as:

FundID	Date	ret(t-1)	ret(t-2)	mgmtfee	perffee	strategy
1	2006m1	.	.	                1.75	20	EM
1	2006m2	-12.38985	.	        1.75	20	EM
1	2006m3	-8.219995	-12.38985	1.75	20	EM
1	2006m4	5.497518	-8.219995	1.75	20	EM
1	2006m5	-0.9465399	5.497518	1.75	20	EM
1	2006m6	2.219898	-0.9465399	1.75	20	EM
2	2006m1	.	.	                2	20	EM
2	2006m2	10.39785	.	        2	20	EM
2	2006m3	9.54027	10.39785	        2	20	EM
2	2006m4	-5.947091	9.54027	        2	20	EM
2	2006m5	-2.846269	-5.947091	2	20	EM
2	2006m6	-12.51931	-2.846269	2	20	EM


I think this should be possible using the merge command, but I am not sure how to work it.

Thannks for you help,

Nick Baker

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