Hello, I have a large dataset that contains multiple categorical variables.
For each variable, entry options are:
Yes / No / Unknown / Missing
I need to transform each variable into a binary variable: Yes vs. No/Unknown/Missing.
Two questions:
1) Is there a way to do this directly in proc freq or is it necessary to create a large number of new variables (e.g. apple_bin, orange_bin) in a data step first?
2) If a data step is necessary, is there a way to generate all of these new variables using a do loop? Each variable has a different name (e.g., apples, oranges, bananas) so I can't use a range (var1-var3).
Thanks very much,
Emily