![]() |
From | Mark Lunt <mark.lunt@manchester.ac.uk> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Merging to the CRSP header file |
Date | Thu, 17 Apr 2008 16:32:53 +0100 |
Malcolm Wardlaw wrote:
I have a data manipulation question about 1-to-many merging based on tickers and date ranges. It's similar to a previous question, but a much simpler operation and a much more common operation for me. I thought I had solved this problem, but I can't for the life of me figure it out again.I've written an ado-file called tvc_merge that could be helpful here. It was designed for merging files of covariates that change with time, which is not quite what you have here. However, I think that the commands
Basically I have lots of observations by date and ticker in Dataset(A) . Tickers are only unique for companies in the CRSP header file for specific date ranges. The CRSP header file provides for a completely unique company identifier, matching the ID up to the ticker symbol and providing a <start> and <end> date for the period that the ticker is a valid match for that ID. So, I need to merge using the ticker, where the date in Dataset(A) is in between the <start> and <end> dates.
Someone had suggested -nearmrg-, which kind of works, but it seems a bit squirrely for what I'm doing. Plus, I'm unfortunately still on Stata 9. I think I read some comment on the archives somewhere about creating 'bins', but I couldn't tell what they were talking about.
This seems like such a common problem, I figured there must be a stock way to handle this.
© Copyright 1996–2025 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |