I want to create a categorical variable called 'climateshock' from ten dummy variables. The each dummy variable represents a kind of climate shock. These dummy variables were created from a multiple choice question which asked the respondent to choose what kind of climate shock they experienced in last five years. I want to create a categorical variable to account for every kind of climate shock that were chosen by a respondent. For example, in the observation 3 below variable clsh5 and clsh8 were observed. I want to create the categorical variable in a way which will observe both clsh5 & clsh8 for the observation 3. Here is the example of the data below.
clsh1 clsh2 clsh3 clsh4 clsh5 clsh6 clsh7 clsh8 clsh9 clsh10
1. . . . . Yes . . . . .
2. . . . . Yes . . . . .
3. . . . . Yes . . Yes . .
4. . . . . Yes . . . . .
5. . . . . Yes . . Yes . .
6. . . . . Yes . . . . .
7. . . . . Yes . Yes . . .
8. . . . . Yes . . . . .
9. . . . . Yes . . Yes . .
10. . . . . Yes . . . . .
11. . . . . Yes . . . . .
12. . . . . Yes . . . . .
13. . . . . Yes . . . . .
14. . . . . Yes . . . . .
15. . . . . Yes . . . . .
16. . . . . Yes . . . . .
17. . . . . Yes . . . . .
18. . . . . Yes . . . . .
19. . . . . Yes . . . . .
20. . . . . Yes . . . . .
21. . . . . Yes . . . . .
22. . . . . Yes . . . . .
23. . . . . Yes . . . . .
24. . . . . Yes . . Yes . .
25. . . . . Yes . . . . .
26. . . . . Yes . . . . .
27. . . . . Yes . . . . .
28. . . . . Yes . . Yes . .
29. . . . . Yes . . Yes . .
30. . . . . Yes . . Yes . .
31. . . . . Yes . . Yes . .
32. . . . . Yes . . . . .
33. . . . . Yes . . . . .
34. . . . . Yes . . Yes . .
35. . . . . Yes . . . . .
36. . . . . Yes . . . . .
37. . . . . Yes . . . . .
38. . . . . Yes . . . . .
39. . . . . Yes . . Yes . .
40. . . . . Yes . . . . .
41. . . . . Yes . . . . .
42. . . . . . . . . . Yes
43. . . . . . . . . . Yes
44. . . . . . . . . . Yes
45. . . . . . . . . . Yes
46. . . . . . . . . . Yes
47. . . . . . . . . . Yes
48. . . . . . . . . . Yes
49. . . . . . . . . . Yes
50. . . . . . . . . . Yes
51. . . . . . . . . . Yes
52. . . . . . . . . . Yes
53. . . . . . . . . . Yes
54. . . . . . . . . . Yes
55. . . . . . . . . . Yes
56. . . . . . . . . . Yes
57. . . . . . . . . . Yes
58. . . . . . . . . . Yes
59. . . . . . . . . . Yes
60. . . . . . . . . . Yes
61. . . . . . . . . . Yes
62. . . . . . . . . . Yes
63. . . . . . . . . . Yes
64. . . . . . . . . . Yes
65. . . . . . . . . . Yes
66. . . . . . . . . . Yes
67. . . . . . . . . . Yes
68. . . . . . . . . . Yes
69. Yes . . . Yes . . Yes . .
70. . . . . . . . . . Yes
Related Posts with creating a categorical variable from multiple dummy variables
Problems with generating group identifierDear all, I'm having a problem with making a variable that identifies a group. I have a data set wi…
Identify life events in panel dataHi Statalist. I would like to be able to identify life events within a panel dataset with multiple w…
Draw figure like this?Dear All, I have this dataset Code: * Example generated by -dataex-. To install: ssc install dataex…
has problem with : recode with more than one if conditionDear All, I have two variables V1 and V2 . V2 has the option (1= Control , 2= CBE, 3=Government) …
How to remove " and "?Dear All, I have this dataset: Code: * Example generated by -dataex-. To install: ssc install datae…
Subscribe to:
Post Comments (Atom)
0 Response to creating a categorical variable from multiple dummy variables
Post a Comment