0

I was wondering if there is an efficient way to extract data on all the stocks from the CRSP dataset?

In the Query Form I only have the option to enter company codes individually or to upload a .txt file with one company code per line. Both of which is not an efficient option. Is there a way to possibly achieve this goal in R or Python?

yungmist
  • 3
  • 2

1 Answers1

2

You can easily download information about all available stocks from the query form. Simply choose the option Search the entire database (see below).

Furthermore, you should include the exchange code as query variable. NYSE has exchange code 1, AMEX exchange code 2 and NASDAQ exchange code 3. You can delete all other observations or simply implement a conditional statement in the WRDS query form.

enter image description here

Kevin
  • 15,879
  • 4
  • 31
  • 64
  • Wow, much easier than what I thought, thanks. I included the Exchange Code variable, I am not sure what you mean by, "You can delete all other observations or simply implement a conditional statement in the WRDS query form" – yungmist Jul 22 '20 at 21:34
  • 1
    @yungmist Well, there are assets that are traded at different exchanges. If you search the entire database, you obtain data for all assets. You should thus throw out all data you don't want. In empirical asset pricing, you typically only include stocks with shrcd (share codde) 10 and 11 (common equity) and exchcd (exchange code) 1, 2 and 3 (NYSE, AMEX, NASDAQ). – Kevin Jul 22 '20 at 21:46
  • 2
    See this post for further explanation of shrcd and you will see why you most likely want to exclude some, eg. do you really want to include 'closed end funds'? Or oil well participation certificates ? Probably not. https://quant.stackexchange.com/questions/39963/what-does-share-codes-in-fama-and-french-2015-exactly-mean – nbbo2 Jul 22 '20 at 21:57