I have a starting dataset that looks like the following
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int year byte(group value average_by_group_year) 2019 1 . 23 2019 2 . 26 2020 2 14 . 2020 1 13 . end
Code:
. list +---------------------------------+ | year group value averag~r | |---------------------------------| 1. | 2019 1 . 23 | 2. | 2019 2 . 26 | 3. | 2020 2 14 . | 4. | 2020 1 13 . | +---------------------------------+
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int year byte(group value average_by_group_year comparison) 2019 1 . 23 . 2019 2 . 26 . 2020 2 14 . 26 2020 1 13 . 23 end
Code:
. list +--------------------------------------------+ | year group value averag~r compar~n | |--------------------------------------------| 1. | 2019 1 . 23 . | 2. | 2019 2 . 26 . | 3. | 2020 2 14 . 26 | 4. | 2020 1 13 . 23 | +--------------------------------------------+
Any suggestion or hints would be greatly appreciated. Thanks.
0 Response to Align rows based on common group
Post a Comment