Dear Statalist,
I have a categorical variable, status, which takes the value of 1, 2 or 3 for mandatory, voluntary and non-disclosure respectively. I also have another variable, industry, indicating which industry the firm belongs to (from 1 to 13). I want to create a dummy variable which = 1 if status==2 and the firm is in the same industry as other firms with status==3, and 0 otherwise. Or alternatively, I could use a categorical variable which = 1 if status==2 and the firm is in the same industry as other firms with status==3, and = 2 if status==3 and the firm is in the same industry as other firms with status==2. I don't know if this is possible, and if so, how to write the code for them.
Thanks a lot in advance for any kind help!
I have a categorical variable, status, which takes the value of 1, 2 or 3 for mandatory, voluntary and non-disclosure respectively. I also have another variable, industry, indicating which industry the firm belongs to (from 1 to 13). I want to create a dummy variable which = 1 if status==2 and the firm is in the same industry as other firms with status==3, and 0 otherwise. Or alternatively, I could use a categorical variable which = 1 if status==2 and the firm is in the same industry as other firms with status==3, and = 2 if status==3 and the firm is in the same industry as other firms with status==2. I don't know if this is possible, and if so, how to write the code for them.
Thanks a lot in advance for any kind help!
Comment