Hello my data has 2 variables. I want to generate a dummy variable if there is something in A (=1) and nothing in A(=0) within the group B. my data looks like this (with how I want my dummy generated).
I used the code
gen dummy =!missing(A), group(B)
but it says group ()not allowed please help. Thanks
A | B | Dummy |
Tom | Group1 | 1 |
Group1 | 1 | |
Group2 | 0 | |
Carl | Group3 | 1 |
I used the code
gen dummy =!missing(A), group(B)
but it says group ()not allowed please help. Thanks
Comment