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 on April 23, and its replacement, statalist.org is already up and running.


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

st: How to Define MDY Variable Given Separate Y and MD Variables


From   Muhammad Anees <aneesmkhattak@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: How to Define MDY Variable Given Separate Y and MD Variables
Date   Mon, 30 May 2011 13:44:52 +0500

Hi All!

I have been trying to define a singe data variable from the given two
date variables named YEAR and DATE-MONTH for data from from Jan 01,
2005 to Dec 31, 2010. Also the month variable has breaks for holidays.
I need to merge the two variable so I could define the yearly specific
date with month to compare trends of stocks across the years.

The data looks like

. li	year day-month in	1/20

	+-----------------+
	year   day-month
	-----------------
1.	2010     31-Dec
2.	2010     30-Dec
3.	2010     29-Dec
4.	2010     28-Dec
5.	2010     27-Dec
	-----------------
6.	2010     24-Dec
7.	2010     23-Dec
8.	2010     22-Dec
9.	2010     21-Dec
10.	2010     20-Dec
	-----------------
11.	2010     15-Dec
12.	2010     14-Dec
13.	2010     13-Dec
14.	2010     10-Dec
15.	2010     09-Dec
	-----------------
16.	2010     08-Dec
17.	2010     07-Dec
18.	2010     06-Dec
19.	2010     03-Dec
20.	2010     02-Dec
	+-----------------+


-- 
---
Best,


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


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