Hi all,
I'm attempting to recode several string variables. Specifically, I have 5 variables representing industries, ie, Industry1, Industry2 Industry3, etc. Possible values for each variable are the same (eg, Construction, Manufacturing, Health Care, etc). Because the "encode" command assigns values to string observations alphabetically, in "Industry1", Construction may be coded as 1, but if Construction does not appear in the variable "Industry2", Health Care may be coded as 1.
Is there an efficient way to encode all 5 variables so that the same string value takes on the same numeric value across all 5?
Thank you in advance!
I'm attempting to recode several string variables. Specifically, I have 5 variables representing industries, ie, Industry1, Industry2 Industry3, etc. Possible values for each variable are the same (eg, Construction, Manufacturing, Health Care, etc). Because the "encode" command assigns values to string observations alphabetically, in "Industry1", Construction may be coded as 1, but if Construction does not appear in the variable "Industry2", Health Care may be coded as 1.
Is there an efficient way to encode all 5 variables so that the same string value takes on the same numeric value across all 5?
Thank you in advance!
Comment