Dear Forum,
I have a question on how to create a sample of S&P 1500 firms.
What I need:
I need to collect a sample of all firms in the S&P1500 from 1990 to 2010. I use WRDS and Stata and I need information on accounting and stock data.
More specifically:
If a firm was in the S&P1500 for at least one year (= t0) I would need data on this firm in the range from t-3 to t4.
Example 1: Firm A appears in the S&P1500 in the year 2000 (any month). Than, I would need data on this firm from 1997 to 2004.
Example 2: Firm B appears in the S&P1500 in the years 1995, 1996 and 1997. Than, I would need data on this firm from 1992 to 2001.
What I have done so far:
As I need accounting and stock data I turned to the CRSP-Compustat-Merged database, searched for all firms in the database and merged it with CRSP.
In WRDS, I used the „Compustat Monthly Updates - Index Constituents“ and searched for all firms from Jan 1990 to December 2010, using the „i0020“-ticker (which is for the S&P1500).
As a result, I get a list of all companies with a „from“ and „thru“ date constituting the entry and exit date in/from the S&P1500. The variables „from“ and „thru“ are in the format: „14feb2010“
My idea on how to solve this
- transform the two variables „from“ and „thru“ to a „long“ format on a yearly base
Current format:
Target format:
- use (or create a) an unique identifier for the S&P1500 firms
- merge the index data with my CRSP/Compustat merged database on gvkey and year (fyear = year)
- question: the crsp-compustat-merged and compustat data which I merged before are merged on permno. is it a problem if I use gvkey for the
S&P1500-„merge“?
My questions
—> does this approach make sense?
—> if so, how could I do the transformation part. I have tried several ways but was not able to do it
Any guidance on how to do this is highly appreciated!
Thanks a lot,
Samuel
I have a question on how to create a sample of S&P 1500 firms.
What I need:
I need to collect a sample of all firms in the S&P1500 from 1990 to 2010. I use WRDS and Stata and I need information on accounting and stock data.
More specifically:
If a firm was in the S&P1500 for at least one year (= t0) I would need data on this firm in the range from t-3 to t4.
Example 1: Firm A appears in the S&P1500 in the year 2000 (any month). Than, I would need data on this firm from 1997 to 2004.
Example 2: Firm B appears in the S&P1500 in the years 1995, 1996 and 1997. Than, I would need data on this firm from 1992 to 2001.
What I have done so far:
As I need accounting and stock data I turned to the CRSP-Compustat-Merged database, searched for all firms in the database and merged it with CRSP.
In WRDS, I used the „Compustat Monthly Updates - Index Constituents“ and searched for all firms from Jan 1990 to December 2010, using the „i0020“-ticker (which is for the S&P1500).
As a result, I get a list of all companies with a „from“ and „thru“ date constituting the entry and exit date in/from the S&P1500. The variables „from“ and „thru“ are in the format: „14feb2010“
My idea on how to solve this
- transform the two variables „from“ and „thru“ to a „long“ format on a yearly base
Current format:
gvkey | From | Thru | Index |
001 | 10sep1999 | 03aug2001 | S&P1500 |
002 | 04jan1996 | 24mar1997 | S&P 1500 |
Target format:
gvkey | year | index (changed to dummy var) |
001 | 1999 | 1 |
001 | 2000 | 1 |
001 | 2001 | 1 |
002 | 1996 | 1 |
002 | 1997 | 1 |
- use (or create a) an unique identifier for the S&P1500 firms
- merge the index data with my CRSP/Compustat merged database on gvkey and year (fyear = year)
- question: the crsp-compustat-merged and compustat data which I merged before are merged on permno. is it a problem if I use gvkey for the
S&P1500-„merge“?
My questions
—> does this approach make sense?
—> if so, how could I do the transformation part. I have tried several ways but was not able to do it
Any guidance on how to do this is highly appreciated!
Thanks a lot,
Samuel
Comment