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
How to pairwise t-test slopes of a three-way interaction?Hi, I hope you had a merry Christmas. Currently I face difficulties on how to pairwise t-test a th…
insufficient observationsHi Everybody, Someone can help me ? I have run the regression as a fixed effects model xtreg GDP In…
Differences in differences with matchingHi, I'm working with a survey data which covers 5 rounds (1995, 2000, 2005 , 2010 and 2015). Howeve…
Do Statacorp's lasso/elasticnet commands automatically normalize independent variables?It is generally advisable to normalize (or standardize, or rescale) independent variables before run…
How to randomly select control sample for the treatment sample multiple times and run regressions?Dear all, I am using Stata 14.0 to solve the questions about randomly selecting control sample for t…
Subscribe to:
Post Comments (Atom)
0 Response to creating a categorical variable from multiple dummy variables
Post a Comment