I have a dataset with many “employment status” variables, such as full-time job is called variable A, part-time job is called variable B, and unemployment is called variable C. Now I need to combine them into a dichotomous variable (full-time job and part-time job equals 1; unemployment equals 0), but I don't know what command to use to combine them, so I hope someone can give me some guidance, thank you very much.
By the way, the data type is string, should I re-encode it with an "encode" command first?
Thanks very much and have a nice day!

0 Response to Generate a new binary variable from different variables in a dataset
Post a Comment