I have a survey that includes many nominal variables (country, type of institution, etc.), a number of which have 10-16 possible levels. (For country alone, there are about 16.) I want to bring this into R in order to do a logistic regression. The dependent variable will be binary.
I have to recode almost all of those variables, obviously. But when I do a google search of recoding categorical or nominal variables, I get suggestions such as the following: Code a base level as all zeros, with ones in different places, as below:
I II III
A 0 0 0
B 1 0 0
C 0 1 0
D 0 0 1
where I, II, and III are new variables, using k - 1 levels for the number of new variables as a rule of thumb. So if A, B, C, and D are the UK, France, Canada, and Germany respectively, I'm going to create 3 columns out of the 1 original column? (There are several hundred rows.) I'm not seeing how the UK would end up represented in the new data, since the zeros under I could represent A, C, or D.
Please help. This is not homework. Is it against group policy to ask this kind of question?
Thank you in advance.