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
How to correctly simulate a xtregAR process ?For a MonteCarlo study, we would like to have some simulated data that follows the process that the …
Report predicted probability from Probit model using outreg2Hi everyone, I'm using outreg2 to export my probit results to excel. Here's the command and output…
testFor a MonteCarlo study, we would like to have some simulated data that follows the process that the …
Reorder a matrix columns according to the values of one of its rowsI have a matrix A in STATA and I want to obtain a new matrix B with the same contents as A but with …
Using a single database for a Difference-in-Difference analysis with three time periodsHello all I'm assessing the impact of an intervention over the course of two years (from 2016-17, an…
Subscribe to:
Post Comments (Atom)
0 Response to how to create a categorical dummy from a group of dummy variables
Post a Comment