I have some activity data which asks respondents how much time they spent in paid work across two variables - one for pre-COVID and the second for during COVID-19, but I would like to merge these two into one variable and then have an indicator for pre- and during-COVID so I can do some modelling on this. I think I need to reshape the data as well. Any suggestions would be most welcome
Best
Brendan
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float id double(Q23_1 Q23_2) 100001 0 0 100002 0 0 100003 6 6 100004 0 0 100005 0 0 100006 0 0 100007 4 7 100008 0 0 100009 0 0 100010 0 0 100011 0 0 100012 1 4 100013 1 1 100014 5 6 100015 5 10 100016 4 5 100017 4 6 100018 0 0 100019 0 0 100020 0 0 100021 4 10 100022 0 0 100023 8 10 100024 1 0 100025 2 2 100026 8 10 100027 2 2 100028 4 10 100029 3 7 100030 0 0 100031 0 0 100032 8 10 100033 0 0 100034 4 8 100035 6 10 100036 10 10 100037 0 0 100038 0 0 100039 0 0 100040 3 3 100041 3 3 100042 10 10 100043 0 0 100044 0 0 100045 9 9 100046 6 10 100047 0 0 100048 0 0 100049 0 0 100050 0 0 100051 3 10 100052 3 9 100053 1 3 100054 3 4 100055 2 5 100056 0 0 100057 5 10 100058 3 5 100059 2 2 100060 0 0 100061 3 5 100062 10 10 100063 0 0 100064 0 0 100065 0 0 100066 0 0 100067 4 8 100068 4 7 100069 3 5 100070 10 3 100071 0 0 100072 10 10 100073 10 10 100074 8 8 100075 0 0 100076 2 4 100077 0 0 100078 1 0 100079 2 4 100080 2 2 100081 0 0 100082 5 8 100083 4 10 100084 0 0 100085 2 10 100086 0 0 100087 4 7 100088 8 10 100089 4 6 100090 2 1 100091 10 10 100092 0 0 100093 5 10 100094 0 0 100095 0 0 100096 0 0 100097 3 5 100098 0 0 100099 0 0 100100 6 10 end
0 Response to Merging two variables + time
Post a Comment