Stata command to create Fama-French industry classifications based on SIC codes

[Update on January 18, 2023] I was advised that the installation command in the original post didn’t work anymore. The author now instructed users, on his website, to find packages here.

You can download a package, as well as its help file, from the above link and place them in your ado directory.

Please type sysdir in Stata to find your ado directory. You may have multiple ado directories, and I would recommend using either PLUS or Personal.

Thank you Judson for creating this handy command!

[Original post] See ffind written by Judson Caskey. Here is his website:
https://sites.google.com/site/judsoncaskey/data

The syntax is as follows (download Help file here):
ffind sic, newvar(ffi) type(30)

type(30) means Fama_French 30 industries classification. Type must be 5, 10, 12, 17, 30, 38, 48 or 49.

This command does not support installation using ssc install. Type the following in Stata to install the command:
net from https://sites.google.com/site/judsoncaskey/data
net install utilities.pkg

See here for equivalent SAS macro:
http://faculty-gsb.stanford.edu/dehaan/SAS.html

This entry was posted in Stata. Bookmark the permalink.

30 Responses to Stata command to create Fama-French industry classifications based on SIC codes

  1. Jessica says:

    Hi Kai,
    Thank you for your post!
    However, it doesn’t work for me when I tried to install using the way you provided.

    “net from https://sites.google.com/site/judsoncaskey/data
    net install utilities.pkg”

    Please advice.

    Thanks.
    Jessica

  2. chen says:

    Hello Kai

    Your website really helps me . Thanks for this!

    I got a question, how can I divide the industries into two categories by using your tutorial, one is service and one is manufacturing?

    Thank you in advance.

    Chen

  3. Bo says:

    I tested it, and it should be ffind *, gen(**) type(***).
    replace * with the SIC code variable name in your data;
    replace ** with the ff grouping variable name you want to call;
    replace *** with the ff grouping choice, i.e. 12, 48, etc.

  4. mike says:

    if using newvar(), an error appears “option generate() required” so I think Bo was right.

  5. Jong says:

    Successfully installed the addon and used it, but for some reason it can only recognise 1 category? Am I missing something?

    I hope to use the 48 classifications, but it only returns “Almost nothing” or “Agriculture” while I am sure there are other industries in my dataset.

  6. Hang says:

    Hi Kai,
    I’ve recently discovered your blog. It is very helpful. However, I’m very new in data analysis. And I don’t understand why we have compute data by Fama – French industrial classification while we already have standard classification by industry such as SIC Code of America or CSRP data of China. I really appreciate it if you could provide some material for me to take a look in depth. Thanks so much.

    • Kai Chen says:

      A fair question. Oftentimes we follow prior research and don’t ask why, do we? I think this paper is a good source of the answer. Bhojraj, S., Lee, C. M. C. and Oler, D. K. (2003), What’s My Line? A Comparison of Industry Classification Schemes for Capital Market Research. Journal of Accounting Research, 41: 745–774. doi:10.1046/j.1475-679X.2003.00122.x

  7. Elena says:

    Hi Kai,

    I am very new to STATA. I need to transform SIC codes into Fama French classification for the companies in my dataset. Please let me know if my understanding is correct: if the code from the .ado file is to code the ffind command, what is the role of the syntax? I understand that it’s running the command “ffind” but I do not understand how. Could you explain what the output would be? Also, when trying to run the syntax, I encounter the following error: “invalid type”. How can I address that? Thanks!

    • Kai Chen says:

      Do you own homework on how to use ado file in Stata, and what syntax means for a command. The possible answer for your last question: SIC for this command should be of numeric type but SIC from Compustat is of string type. Make conversion before you use the command.

  8. Korinna says:

    Hello Kai,
    When I tried the comment:
    net from https://sites.google.com/site/judsoncaskey/data
    net install utilities.pkg

    stata says the following:
    net from https://sites.google.com/site/judsoncaskey/data
    Java installation not found
    https://sites.google.com/site/judsoncaskey/data/ either
    1) is not a valid URL, or
    2) could not be contacted, or
    3) is not a Stata download site (has no stata.toc file).

    current site is still http://www.stata.com/
    r(5004);

    .
    . net install utilities.pkg
    file http://www.stata.com/utilities.pkg not found
    could not load utilities.pkg from http://www.stata.com/
    r(601);

    Can you please show me how to deal with this? thank you very much!

  9. Norbert Langerak says:

    Dear Kai,

    First of all thank you for the program. I do however have the issue when I run it that I get quite some industry classifications of ‘Almost nothing’ which doesn’t seem to be correct. Upon closer inspection I find that this occurs for the following sic-codes in my sample (note: my sample doesn’t include all sic-codes so this issue could be bigger if my sample had more sic-codes): 9995, 4955, 4953, 9997, 4950, 3990, 4991, 4961, 900 and 9998. I have no idea why it gives the industry classification “48 almost nothing” to these observations. Could you help me ou there?

  10. Arthur Morris says:

    An alternative is SICFF which is available through ssc:

    ssc install sicff

    details here:
    https://ideas.repec.org/c/boc/bocode/s458381.html

    I’ve used both and they seem to be quite similar. Users in areas where access to google is limited may have better luck with the Boston College servers.

  11. Ali Ghalan says:

    Thank you for the useful blog. Just for the future reference, the SAS code has been moved to here:
    https://faculty.washington.edu/edehaan/pages/Programming/industries_ff48
    or
    https://faculty.washington.edu/edehaan/

  12. Bram Reysenberg says:

    Thanks a lot for your help. This saved me like 10 hours of programming myself.
    Super happy with you<3

  13. Khin Phyo Hlaing says:

    Kai, I should have seen this one during my PhD program! you are awesome.

  14. Frederic says:

    Very helpful, thank you very much!
    Do you know whether the classification system by FF gets updated once in a while in order to account for new industry’s?

  15. Annemijn says:

    Hi Kai,

    About half a year ago these commands worked perfectly for me, however, now, I get this error code (using the exact same data as half a year ago):

    net from https://sites.google.com/site/judsoncaskey/data
    file https://sites.google.com/site/judsoncaskey/data/stata.toc not found
    https://sites.google.com/site/judsoncaskey/data/ either
    1) is not a valid URL, or
    2) could not be contacted, or
    3) is not a Stata download site (has no stata.toc file).

    current site is still http://fmwww.bc.edu/repec/bocode/s/
    r(601);

    net install utilities.pkg
    file http://fmwww.bc.edu/repec/bocode/s/utilities.pkg not found
    could not load utilities.pkg from http://fmwww.bc.edu/repec/bocode/s/
    r(601);

    Do you perhaps know what goes wrong?

    Many thanks in advance!

    Kind regards,
    Annemijn

  16. Philippe Dubois says:

    Hi Kai,
    I have the same issue as Annemijn?
    Can you please assist?
    Kind regards,
    Dr. P.

  17. Addie says:

    Thank you so much for the update!

Leave a Reply

Your email address will not be published. Required fields are marked *