Hi everyone,

I want to create a categorical dummy called Engagement, which should take its values from 9 dummy variables, where each dummy variable represents a type of engagement. So I want to have the Engagement variable having values (1 to 9), where each value represents one of the respective 9 engagement activities. I tried using the following command but it gives me wrong total values for each activity (i.e.the totals from tabulating the 9 dummies alone do not equal the totals created from the Engagement variable):

gen engagement=0
replace engagement=1 if Firstactivitydummy==1
replace engagement=2 if Secondactivitydummy==1
...etc

Can someone please advice me what to do?

Thanks in advance!