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!
Related Posts with how to create a categorical dummy from a group of dummy variables
Drop variables based on nameHi, I have a dataset with 100 variables, 50 of which are called Xi_ante and 50 of which are called X…
Logit & conformability error in inteff I am using a survey data to run a logit regression, and currently I am testing the interactions of …
Instrumental variable analysis with multiple imputationHello all, I will please like to find out if IV analysis works with imputed data (i.e using multipl…
Fractional logit model for proportions over timeDear all, I have calculated a “Diversity Index” for a given population. Per the census website, the …
Comparing age adjusted mortality ratesHello everyone. I am trying to compare age-adjusted mortality rate for two population. Rural age ad…
Subscribe to:
Post Comments (Atom)
0 Response to how to create a categorical dummy from a group of dummy variables
Post a Comment