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
Format the number of decimals in Table command in Stata-17Hello everyone. I use the command below to determine the number of decimals in my table in Stata-17.…
testing difference between coefficients in different equationsI would like to run the following regressions: xtreg a x y z i.mth_seq, fe vce(robust) *equation 1 …
Sample from joint distributionHi, I was wondering if there is a way to generate a dataset with 100 observations, with two variabl…
how do I get an overall p value for independent factor variables in linear regressionHi, I am running a backwards stepwise linear model with factor and continuous predictor variables. M…
How to generate mean by groupGood morning everyone ! I have a problem of calculating the decile by group. Here is the datset that…
Subscribe to:
Post Comments (Atom)
0 Response to how to create a categorical dummy from a group of dummy variables
Post a Comment