Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconsider industry selection in CRSP v2 #102

Closed
patrick-weiss opened this issue Apr 15, 2024 · 3 comments · Fixed by #114
Closed

Reconsider industry selection in CRSP v2 #102

patrick-weiss opened this issue Apr 15, 2024 · 3 comments · Fixed by #114
Assignees
Labels
bug Something isn't working python Concerns the python version R Concerns the R version

Comments

@patrick-weiss
Copy link
Member

patrick-weiss commented Apr 15, 2024

We currently use the siccd from msf_db (i.e., in_schema("crsp", "msf_v2")). However, the more accurate way is siccd from stksecurityinfohist_db (i.e., in_schema("crsp", "stksecurityinfohist")). Yes, this variable has the same name but a different meaning depending on the table.

Reasoning: Back-fills in msf_v2's siccd. A simple check to reveal this back-fill (with an active WRDS connection):

siccd_permno_pairs <- msf_db |> select(permno, siccd) |> collect() |> distinct()
nrow(siccd_permno_pairs) == length(unique(siccd_permno_pairs$permno))

This shows that every permno only has a single industry, which implies that no firm ever changed the industry - but they do: contradiction

Relevant for r-tidyfinance

@patrick-weiss patrick-weiss added the bug Something isn't working label Apr 15, 2024
@patrick-weiss patrick-weiss self-assigned this Apr 15, 2024
@patrick-weiss patrick-weiss added python Concerns the python version R Concerns the R version labels Apr 17, 2024
@patrick-weiss
Copy link
Member Author

Additional CRSP v2 implementation issues:

  1. We can do better when filtering exchanges. In particular, the suggestion is to include:

primaryexch in ('N','A', 'Q') and
conditionaltype = 'RW' and
TradingStatusFlg = 'A'

  1. We could consider highlighting that there is no longer a cumulative adjustment factor for prices and shares outstanding (but only an adjustment factor for the day of the change).

First is more relevant, second is just for information. Any thoughts on whether we should implement them?

@christophscheuch
Copy link
Member

Ad 1: I'm in principle in favor of the change, but suggestion from where? We should also add info what those filters mean in human language.

As 2: for whom is 2 relevant? For us, it isn't, is it?

@tidy-finance tidy-finance deleted a comment from voigtstefan Apr 19, 2024
@patrick-weiss
Copy link
Member Author

patrick-weiss commented May 13, 2024

ad 1. Based on the description by WRDS on how the old exchcd maps into primaryexch. We can consider conditionaltype in ('RW', 'NW'), where RW is regular trading and NW for when issued (as we also use exchcd 31, 32, and 33). The TradingStatusFlg is necessary to avoid prices when execution is halted.
--> https://wrds-www.wharton.upenn.edu/pages/support/manuals-and-overviews/crsp/stocks-and-indices/crsp-stock-and-indexes-version-2/crsp-ciz-faq/

ad 2. It is not relevant in the book, but there are many situations where you would need it (anything taking prices as an input without multiplying by shares).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working python Concerns the python version R Concerns the R version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants