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
Announcing power tworates_zhu: Stata module to calculate sample size or power for a two-sample test of rates (negative binomial regression)Dear Statalisters, I have just posted my program -power tworates_zhu- on SSC. It implements the equ…
GLM for grouped/ blocked population standardized binary data.Sorry for imposing further but I could really use some help. Let me explain more. I have data on in…
correct to use*svy brr syntax with bootstrap weights and svy bootstrap syntax with brr weights?*Dear Statalisters, Is it correct to use the svy brr syntax with bootstrap weights and svy bootstrap…
Loops cannot capture words with spaceGood day Statalists, I have a panel data for hundreds countries in dozens years. Now I want to extr…
Name confusion: Heckman or HeckitHello everyone, Regarding the Heckman two-step selection model for sample selection problem, Wooldri…
Subscribe to:
Post Comments (Atom)
0 Response to how to create a categorical dummy from a group of dummy variables
Post a Comment