Dear Statalist

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          . |
     +---------------------------------+
And I would like to create a new variable that copies the values from average_by_group_year from the year 2019 & whose values are assigned in such an order that they match the group value in 2020, viz.

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 |
     +--------------------------------------------+
The order of 26 & 23 is based on matching the group values.

Any suggestion or hints would be greatly appreciated. Thanks.