Below is an example of my dataset. Notably, I have included a variable with my desired outcome. Groups AAA, CCC and DDD have at least one non-missing case.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str3 group byte(price desired_outcome) "AAA" . 1 "AAA" 1 1 "AAA" 3 1 "BBB" . 0 "BBB" . 0 "CCC" 1 1 "DDD" 2 1 "DDD" . 1 "EEE" . 0 "EEE" . 0 "EEE" . 0 end
0 Response to Creating a dummy based on group
Post a Comment