Hey guys,
I would like to create a variable for the Fama French 12 industry classifications (ffinds) with values from 1 to 12 representing the respective industry. I do have SIC codes in my data.
Each industry according to Fama French covers a range of SIC codes. Unfortunately SIC codes are string in my data, so I can't use
gen ffinds = 1 if ((sic<=0299 & sic>=0100) | (sic>=0700 & sic<=0799) | (sic>=0910 & sic<=0919) | sic==2048)
Does anybody have an idea how to solve this problem?
I already tried to recast the variable sic, but this didn't really work. E.g. if the sic code was originally 3089 the value after recasting was 107.
Thanks in advance.
I would like to create a variable for the Fama French 12 industry classifications (ffinds) with values from 1 to 12 representing the respective industry. I do have SIC codes in my data.
Each industry according to Fama French covers a range of SIC codes. Unfortunately SIC codes are string in my data, so I can't use
gen ffinds = 1 if ((sic<=0299 & sic>=0100) | (sic>=0700 & sic<=0799) | (sic>=0910 & sic<=0919) | sic==2048)
Does anybody have an idea how to solve this problem?
I already tried to recast the variable sic, but this didn't really work. E.g. if the sic code was originally 3089 the value after recasting was 107.
Thanks in advance.
Comment