Dear community
I have the following types of panel data:
The actual data is huge, so ask questions to reduce the workload as much as possible.

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(id var1 target1 target2)
1 . 4 4
1 4 . 4
1 4 . 4
1 . . .
2 . 8 8
2 . . 8
2 8 . 8
2 . . .
end
I want to make target1 or target2 column as simple as possible using var1 column.
It doesn't matter whether target1 or target2.

The way I thought about it is as follows in the code
Code:
by id: replace var1[1] = max(var1)
Then there's an error called "weights not allowed."

thanks!