[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
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
This works fine on my machine. What error message did you get?
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
Each company on Compustat has a SIC code. Wikipedia SIC and you will get a better idea. Fama and French just regroup SICs into their own industry categories. See their definition at http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html
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.
Hi Bo, thanks for the comment. I find the help file for this command: https://sites.google.com/site/judsoncaskey/ffind.hlp?attredirects=0&d=1. It seems that we should use
newvar
instead ofgen
.Thanks!
if using newvar(), an error appears “option generate() required” so I think Bo was right.
Thanks for the comment. I had no problem with newvar(). Just be curious if this is related to the Stata version.
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.
The only reason I can figure out is that you are using first 3 digits of SIC code. This command requires full 4-digit SIC code.
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.
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
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!
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.
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!
Hi Korinna, can you see a list of packages after typing and running “net from https://sites.google.com/site/judsoncaskey/data“?
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?
Hi Norbert, according to FF’s industry definitions, all the SIC codes you mentioned are Others (i.e., almost nothing) if using 48 industry classification. So, the command works the way it should. You can find all industry definitions at http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/Data_Library/changes_ind.html.
Ah my bad, I was using the old 1997 FF industry definitions so that’s why it didn’t match. THank you for the quick response!
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.
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/
Thanks a lot for your help. This saved me like 10 hours of programming myself.
Super happy with you<3
Kai, I should have seen this one during my PhD program! you are awesome.
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?
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
Please see my update in the post.
Hi Kai,
I have the same issue as Annemijn?
Can you please assist?
Kind regards,
Dr. P.
Please see my update in the post.
Thank you so much for the update!